From 314fcab1904cd0c5e434789bef09766d33e2d6ef Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 13 Aug 2018 16:04:34 -0700 Subject: [PATCH 001/429] add synth.py for generation --- packages/google-cloud-asset/synth.py | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 packages/google-cloud-asset/synth.py diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py new file mode 100644 index 00000000000..45fac29a6ea --- /dev/null +++ b/packages/google-cloud-asset/synth.py @@ -0,0 +1,45 @@ +# copyright 2018 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 subprocess +import logging + +logging.basicconfig(level=logging.debug) + +gapic = gcp.gapicgenerator() +common_templates = gcp.commontemplates() + +version = "v1" + +library = gapic.node_library('asset', version, private=True) +s.copy(library, excludes=['src/index.js', 'readme.md', 'package.json']) + +templates = common_templates.node_library( + package_name="@google-cloud/asset", + repo_name="googleapis/nodejs-asset", +) +s.copy(templates) + + +''' +node.js specific cleanup +''' +subprocess.run(['npm', 'ci']) +subprocess.run(['npm', 'run', 'prettier']) +subprocess.run(['npm', 'run', 'lint']) + From 845b6caf355915777013f0e6759120191b4f39a4 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:07:58 -0700 Subject: [PATCH 002/429] initialize repo --- packages/google-cloud-asset/.appveyor.yml | 20 + .../google-cloud-asset/.circleci/config.yml | 168 ++ .../google-cloud-asset/.cloud-repo-tools.json | 9 + packages/google-cloud-asset/.eslintignore | 3 + packages/google-cloud-asset/.eslintrc.yml | 13 + packages/google-cloud-asset/.gitignore | 13 + packages/google-cloud-asset/.jsdoc.js | 45 + packages/google-cloud-asset/.nycrc | 26 + packages/google-cloud-asset/.prettierignore | 3 + packages/google-cloud-asset/.prettierrc | 8 + .../google-cloud-asset/CODE_OF_CONDUCT.md | 43 + packages/google-cloud-asset/CONTRIBUTORS | 6 + packages/google-cloud-asset/LICENSE | 202 ++ packages/google-cloud-asset/README.md | 31 + packages/google-cloud-asset/package-lock.json | 2543 +++++++++++++++++ packages/google-cloud-asset/package.json | 45 + .../cloud/asset/v1beta1/asset_service.proto | 160 ++ .../google/cloud/asset/v1beta1/assets.proto | 114 + .../google-cloud-asset/samples/.eslintrc.yml | 3 + .../google-cloud-asset/samples/quickstart.js | 22 + packages/google-cloud-asset/src/index.js | 79 + .../src/v1beta1/asset_service_client.js | 454 +++ .../v1beta1/asset_service_client_config.json | 36 + .../cloud/asset/v1beta1/doc_asset_service.js | 189 ++ .../google/cloud/asset/v1beta1/doc_assets.js | 145 + .../v1beta1/doc/google/iam/v1/doc_policy.js | 162 ++ .../doc/google/longrunning/doc_operations.js | 147 + .../v1beta1/doc/google/protobuf/doc_any.js | 131 + .../v1beta1/doc/google/protobuf/doc_struct.js | 112 + .../doc/google/protobuf/doc_timestamp.js | 113 + .../src/v1beta1/doc/google/rpc/doc_status.js | 92 + .../google-cloud-asset/src/v1beta1/index.js | 19 + packages/google-cloud-asset/synth.py | 50 +- .../system-test/.eslintrc.yml | 6 + .../google-cloud-asset/test/.eslintrc.yml | 5 + .../google-cloud-asset/test/gapic-v1beta1.js | 202 ++ 36 files changed, 5393 insertions(+), 26 deletions(-) create mode 100644 packages/google-cloud-asset/.appveyor.yml create mode 100644 packages/google-cloud-asset/.circleci/config.yml create mode 100644 packages/google-cloud-asset/.cloud-repo-tools.json create mode 100644 packages/google-cloud-asset/.eslintignore create mode 100644 packages/google-cloud-asset/.eslintrc.yml create mode 100644 packages/google-cloud-asset/.gitignore create mode 100644 packages/google-cloud-asset/.jsdoc.js create mode 100644 packages/google-cloud-asset/.nycrc create mode 100644 packages/google-cloud-asset/.prettierignore create mode 100644 packages/google-cloud-asset/.prettierrc create mode 100644 packages/google-cloud-asset/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-asset/CONTRIBUTORS create mode 100644 packages/google-cloud-asset/LICENSE create mode 100644 packages/google-cloud-asset/README.md create mode 100644 packages/google-cloud-asset/package-lock.json create mode 100644 packages/google-cloud-asset/package.json create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto create mode 100644 packages/google-cloud-asset/samples/.eslintrc.yml create mode 100644 packages/google-cloud-asset/samples/quickstart.js create mode 100644 packages/google-cloud-asset/src/index.js create mode 100644 packages/google-cloud-asset/src/v1beta1/asset_service_client.js create mode 100644 packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js create mode 100644 packages/google-cloud-asset/src/v1beta1/index.js create mode 100644 packages/google-cloud-asset/system-test/.eslintrc.yml create mode 100644 packages/google-cloud-asset/test/.eslintrc.yml create mode 100644 packages/google-cloud-asset/test/gapic-v1beta1.js diff --git a/packages/google-cloud-asset/.appveyor.yml b/packages/google-cloud-asset/.appveyor.yml new file mode 100644 index 00000000000..24082152655 --- /dev/null +++ b/packages/google-cloud-asset/.appveyor.yml @@ -0,0 +1,20 @@ +environment: + matrix: + - nodejs_version: 8 + +install: + - ps: Install-Product node $env:nodejs_version + - npm install -g npm # Force using the latest npm to get dedupe during install + - set PATH=%APPDATA%\npm;%PATH% + - npm install --force --ignore-scripts + +test_script: + - node --version + - npm --version + - npm rebuild + - npm test + +build: off + +matrix: + fast_finish: true diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml new file mode 100644 index 00000000000..41c82336dbb --- /dev/null +++ b/packages/google-cloud-asset/.circleci/config.yml @@ -0,0 +1,168 @@ +version: 2 +workflows: + version: 2 + tests: + jobs: &workflow_jobs + - node6: + filters: &all_commits + tags: + only: /.*/ + - node8: + filters: *all_commits + - node10: + filters: *all_commits + - lint: + requires: + - node6 + - node8 + - node10 + filters: *all_commits + - docs: + requires: + - node6 + - node8 + - node10 + filters: *all_commits + - system_tests: + requires: + - lint + - docs + filters: &master_and_releases + branches: + only: master + tags: &releases + only: '/^v[\d.]+$/' + - sample_tests: + requires: + - lint + - docs + filters: *master_and_releases + - publish_npm: + requires: + - system_tests + - sample_tests + filters: + branches: + ignore: /.*/ + tags: *releases + nightly: + triggers: + - schedule: + cron: 0 7 * * * + filters: + branches: + only: master + jobs: *workflow_jobs +jobs: + node6: + docker: + - image: 'node:6' + user: node + steps: &unit_tests_steps + - checkout + - run: &npm_install_and_link + name: Install and link the module + command: |- + mkdir -p /home/node/.npm-global + npm install + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: npm test + - run: node_modules/.bin/codecov + + node8: + docker: + - image: 'node:8' + user: node + steps: *unit_tests_steps + node10: + docker: + - image: 'node:10' + user: node + steps: *unit_tests_steps + lint: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: *npm_install_and_link + - run: &samples_npm_install_and_link + name: Link the module being tested to the samples. + command: | + cd samples/ + npm link ../ + npm install + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: + name: Run linting. + command: npm run lint + environment: + NPM_CONFIG_PREFIX: /home/node/.npm-global + docs: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: *npm_install_and_link + - run: + name: Build documentation. + command: npm run docs + sample_tests: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: + name: Decrypt credentials. + command: | + openssl aes-256-cbc -d -in .circleci/key.json.enc \ + -out .circleci/key.json \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + - run: *npm_install_and_link + - run: *samples_npm_install_and_link + - run: + name: Run sample tests. + command: npm run samples-test + environment: + GCLOUD_PROJECT: long-door-651 + GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global + - run: + name: Remove unencrypted key. + command: rm .circleci/key.json + when: always + working_directory: /home/node/samples/ + system_tests: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: + name: Decrypt credentials. + command: | + openssl aes-256-cbc -d -in .circleci/key.json.enc \ + -out .circleci/key.json \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + - run: *npm_install_and_link + - run: + name: Run system tests. + command: npm run system-test + environment: + GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json + - run: + name: Remove unencrypted key. + command: rm .circleci/key.json + when: always + publish_npm: + docker: + - image: 'node:8' + user: node + steps: + - checkout + - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' + - run: npm publish --access=public diff --git a/packages/google-cloud-asset/.cloud-repo-tools.json b/packages/google-cloud-asset/.cloud-repo-tools.json new file mode 100644 index 00000000000..4f06ffc2003 --- /dev/null +++ b/packages/google-cloud-asset/.cloud-repo-tools.json @@ -0,0 +1,9 @@ +{ + "requiresKeyFile": true, + "requiresProjectId": true, + "product": "asset", + "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/asset/latest/", + "release_quality": "alpha", + "samples": [ + ] +} diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-asset/.eslintignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-asset/.eslintrc.yml b/packages/google-cloud-asset/.eslintrc.yml new file mode 100644 index 00000000000..bed57fbc42c --- /dev/null +++ b/packages/google-cloud-asset/.eslintrc.yml @@ -0,0 +1,13 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore new file mode 100644 index 00000000000..5b265aef806 --- /dev/null +++ b/packages/google-cloud-asset/.gitignore @@ -0,0 +1,13 @@ +**/*.log +**/node_modules +.coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +google-cloud-logging-winston-*.tgz +google-cloud-logging-bunyan-*.tgz diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js new file mode 100644 index 00000000000..3fbebfd18bd --- /dev/null +++ b/packages/google-cloud-asset/.jsdoc.js @@ -0,0 +1,45 @@ +/*! + * Copyright 2018 Google LLC. All Rights Reserved. + * + * 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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/ink-docstrap/template', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'src' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2018 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: 'asset', + theme: 'lumen' + } +}; diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc new file mode 100644 index 00000000000..a1a8e6920ce --- /dev/null +++ b/packages/google-cloud-asset/.nycrc @@ -0,0 +1,26 @@ +{ + "report-dir": "./.coverage", + "exclude": [ + "src/*{/*,/**/*}.js", + "src/*/v*/*.js", + "test/**/*.js" + ], + "watermarks": { + "branches": [ + 95, + 100 + ], + "functions": [ + 95, + 100 + ], + "lines": [ + 95, + 100 + ], + "statements": [ + 95, + 100 + ] + } +} diff --git a/packages/google-cloud-asset/.prettierignore b/packages/google-cloud-asset/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-asset/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-asset/.prettierrc b/packages/google-cloud-asset/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-asset/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-asset/CODE_OF_CONDUCT.md b/packages/google-cloud-asset/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-asset/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-asset/CONTRIBUTORS b/packages/google-cloud-asset/CONTRIBUTORS new file mode 100644 index 00000000000..6585b55f8f2 --- /dev/null +++ b/packages/google-cloud-asset/CONTRIBUTORS @@ -0,0 +1,6 @@ +# The names of individuals who have contributed to this project. +# +# Names are formatted as: +# name +# +Jonathan Lui diff --git a/packages/google-cloud-asset/LICENSE b/packages/google-cloud-asset/LICENSE new file mode 100644 index 00000000000..7a4a3ea2424 --- /dev/null +++ b/packages/google-cloud-asset/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. \ No newline at end of file diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md new file mode 100644 index 00000000000..4369a07b2a2 --- /dev/null +++ b/packages/google-cloud-asset/README.md @@ -0,0 +1,31 @@ +# Node.js Client for Cloud Asset API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-node#versioning)) + +[Cloud Asset API][Product Documentation]: +The cloud asset API manages the history and inventory of cloud resources. +- [Client Library Documentation][] +- [Product Documentation][] + +## Quick Start +In order to use this library, you first need to go through the following +steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +3. [Enable the Cloud Asset API.](https://console.cloud.google.com/apis/library/cloudasset.googleapis.com) +4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/master/guides/authentication) + +### Installation +``` +$ npm install --save asset +``` + +### Next Steps +- Read the [Client Library Documentation][] for Cloud Asset API + to see other available methods on the client. +- Read the [Cloud Asset API Product documentation][Product Documentation] + to learn more about the product and see How-to Guides. +- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/README.md) + to see the full list of Cloud APIs that we cover. + +[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/cloudasset +[Product Documentation]: https://cloud.google.com/cloudasset \ No newline at end of file diff --git a/packages/google-cloud-asset/package-lock.json b/packages/google-cloud-asset/package-lock.json new file mode 100644 index 00000000000..8816113e4d4 --- /dev/null +++ b/packages/google-cloud-asset/package-lock.json @@ -0,0 +1,2543 @@ +{ + "name": "asset", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "requires": { + "call-me-maybe": "1.0.1", + "glob-to-regexp": "0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz", + "integrity": "sha512-KU/VDjC5RwtDUZiz3d+DHXJF2lp5hB9dn552TXIyptj8SH1vXmR40mG0JgGq03IlYsOgGfcv8xrLpSQ0YUMQdA==" + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "1.1.2", + "@protobufjs/inquire": "1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/node": { + "version": "10.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.7.1.tgz", + "integrity": "sha512-EGoI4ylB/lPOaqXqtzAyL8HcgOuCtH2hkEaLmkueOYufsTFWBn4VCvlCDC2HW8Q+9iF+QVC3sxjDKQYjHQeZ9w==" + }, + "acorn": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.2.tgz", + "integrity": "sha512-cJrKCNcr2kv8dlDnbw+JPUGjHZzo4myaxOLmpOX8a+rgX94YeTcTMv/LFJUSByRpc+i4GgVnnhLxvMu/2Y+rqw==" + }, + "acorn-es7-plugin": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", + "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "ascli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", + "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", + "requires": { + "colour": "0.7.1", + "optjs": "3.2.2" + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, + "axios": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "requires": { + "follow-redirects": "1.5.7", + "is-buffer": "1.1.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.3", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "bytebuffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", + "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", + "requires": { + "long": "3.2.0" + }, + "dependencies": { + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, + "call-signature": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", + "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "colour": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", + "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" + }, + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "diff-match-patch": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.1.tgz", + "integrity": "sha512-A0QEhr4PxGUMEtKxd6X+JLnOTFd3BfIPSDpsc4dMvj+CbSaErDwTpoTo/nFJDMSrjxLW4BiNq+FbNisAAHhWeQ==" + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "requires": { + "arrify": "1.0.1", + "path-type": "3.0.0" + } + }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "stream-shift": "1.0.0" + } + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "ecdsa-sig-formatter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "empower": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.0.tgz", + "integrity": "sha512-tP2WqM7QzrPguCCQEQfFFDF+6Pw6YWLQal3+GHQaV+0uIr0S+jyREQPWljE02zFCYPFYLZ3LosiRV+OzTrxPpQ==", + "requires": { + "core-js": "2.5.7", + "empower-core": "1.2.0" + } + }, + "empower-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", + "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", + "requires": { + "call-signature": "0.0.2", + "core-js": "2.5.7" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "espurify": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", + "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", + "requires": { + "core-js": "2.5.7" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "fast-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.2.tgz", + "integrity": "sha512-TR6zxCKftDQnUAPvkrCWdBgDq/gbqx8A3ApnBrR5rMvpp6+KMJI0Igw7fkWPgeVK0uhRXTXdvO3O+YP0CaUX2g==", + "requires": { + "@mrmlnc/readdir-enhanced": "2.2.1", + "@nodelib/fs.stat": "1.1.1", + "glob-parent": "3.1.0", + "is-glob": "4.0.0", + "merge2": "1.2.2", + "micromatch": "3.1.10" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "follow-redirects": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.7.tgz", + "integrity": "sha512-NONJVIFiX7Z8k2WxfqBjtwqMifx7X42ORLFrOZ2LTKGj71G3C0kfdyTqGqr8fx5zSX6Foo/D95dgGWbPUiwnew==", + "requires": { + "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "gcp-metadata": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", + "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", + "requires": { + "axios": "0.18.0", + "extend": "3.0.2", + "retry-axios": "0.3.2" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "2.1.1" + } + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" + }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "requires": { + "array-union": "1.0.2", + "dir-glob": "2.0.0", + "fast-glob": "2.2.2", + "glob": "7.1.2", + "ignore": "3.3.10", + "pify": "3.0.0", + "slash": "1.0.0" + } + }, + "google-auth-library": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.6.1.tgz", + "integrity": "sha512-jYiWC8NA9n9OtQM7ANn0Tk464do9yhKEtaJ72pKcaBiEwn4LwcGYIYOfwtfsSm3aur/ed3tlSxbmg24IAT6gAg==", + "requires": { + "axios": "0.18.0", + "gcp-metadata": "0.6.3", + "gtoken": "2.3.0", + "jws": "3.1.5", + "lodash.isstring": "4.0.1", + "lru-cache": "4.1.3", + "retry-axios": "0.3.2" + } + }, + "google-gax": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.17.1.tgz", + "integrity": "sha512-fAKvFx++SRr6bGWamWuVOkJzJnQqMgpJkhaB2oEwfFJ91rbFgEmIPRmZZ/MeIVVFUOuHUVyZ8nwjm5peyTZJ6g==", + "requires": { + "duplexify": "3.6.0", + "extend": "3.0.2", + "globby": "8.0.1", + "google-auth-library": "1.6.1", + "google-proto-files": "0.16.1", + "grpc": "1.14.1", + "is-stream-ended": "0.1.4", + "lodash": "4.17.10", + "protobufjs": "6.8.8", + "retry-request": "4.0.0", + "through2": "2.0.3" + } + }, + "google-p12-pem": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", + "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", + "requires": { + "node-forge": "0.7.6", + "pify": "3.0.0" + } + }, + "google-proto-files": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.16.1.tgz", + "integrity": "sha512-ykdhaYDiU/jlyrkzZDPemraKwVIgLT31XMHVNSJW//R9VED56hqSDRMx1Jlxbf0O4iDZnBWQ0JQLHbM2r5+wuA==", + "requires": { + "globby": "8.0.1", + "power-assert": "1.6.0", + "protobufjs": "6.8.8" + } + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "grpc": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.14.1.tgz", + "integrity": "sha512-UQA+WSa6CJYKv8rWAHX2RXCKhcxbB/5kyVnkiK3U+dPm4PlfZT4PrEeEdt2uzmvMhp9PB0SVKpVAukng1By+7w==", + "requires": { + "lodash": "4.17.10", + "nan": "2.10.0", + "node-pre-gyp": "0.10.3", + "protobufjs": "5.0.3" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "requires": { + "minipass": "2.3.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.3" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "iconv-lite": { + "version": "0.4.23", + "bundled": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "bundled": true + }, + "minipass": { + "version": "2.3.3", + "bundled": true, + "requires": { + "safe-buffer": "5.1.2", + "yallist": "3.0.2" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "requires": { + "minipass": "2.3.3" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true + } + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "needle": { + "version": "2.2.2", + "bundled": true, + "requires": { + "debug": "2.6.9", + "iconv-lite": "0.4.23", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.3", + "bundled": true, + "requires": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.1", + "needle": "2.2.2", + "nopt": "4.0.1", + "npm-packlist": "1.1.11", + "npmlog": "4.1.2", + "rc": "1.2.8", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.6" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true + }, + "npm-packlist": { + "version": "1.1.11", + "bundled": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "1.1.5", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true + }, + "protobufjs": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", + "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", + "requires": { + "ascli": "1.0.1", + "bytebuffer": "5.0.1", + "glob": "7.1.2", + "yargs": "3.32.0" + } + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "requires": { + "deep-extend": "0.6.0", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "sax": { + "version": "1.2.4", + "bundled": true + }, + "semver": { + "version": "5.5.0", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "4.4.6", + "bundled": true, + "requires": { + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.3.3", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.2", + "yallist": "3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true + } + } + }, + "gtoken": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", + "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", + "requires": { + "axios": "0.18.0", + "google-p12-pem": "1.0.2", + "jws": "3.1.5", + "mime": "2.3.1", + "pify": "3.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "3.0.1" + } + }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "jwa": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.10", + "safe-buffer": "5.1.2" + } + }, + "jws": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", + "requires": { + "jwa": "1.1.6", + "safe-buffer": "5.1.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true, + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._basecreate": "3.0.3", + "lodash._isiterateecall": "3.0.9" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "1.0.1" + } + }, + "merge2": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.2.tgz", + "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==" + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "mime": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "node-forge": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", + "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==" + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "3.0.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "optjs": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", + "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "1.0.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "power-assert": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.0.tgz", + "integrity": "sha512-nDb6a+p2C7Wj8Y2zmFtLpuv+xobXz4+bzT5s7dr0nn71tLozn7nRMQqzwbefzwZN5qOm0N7Cxhw4kXP75xboKA==", + "requires": { + "define-properties": "1.1.3", + "empower": "1.3.0", + "power-assert-formatter": "1.4.1", + "universal-deep-strict-equal": "1.2.2", + "xtend": "4.0.1" + } + }, + "power-assert-context-formatter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", + "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", + "requires": { + "core-js": "2.5.7", + "power-assert-context-traversal": "1.2.0" + } + }, + "power-assert-context-reducer-ast": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", + "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", + "requires": { + "acorn": "5.7.2", + "acorn-es7-plugin": "1.1.7", + "core-js": "2.5.7", + "espurify": "1.8.1", + "estraverse": "4.2.0" + } + }, + "power-assert-context-traversal": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", + "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", + "requires": { + "core-js": "2.5.7", + "estraverse": "4.2.0" + } + }, + "power-assert-formatter": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", + "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", + "requires": { + "core-js": "2.5.7", + "power-assert-context-formatter": "1.2.0", + "power-assert-context-reducer-ast": "1.2.0", + "power-assert-renderer-assertion": "1.2.0", + "power-assert-renderer-comparison": "1.2.0", + "power-assert-renderer-diagram": "1.2.0", + "power-assert-renderer-file": "1.2.0" + } + }, + "power-assert-renderer-assertion": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", + "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", + "requires": { + "power-assert-renderer-base": "1.1.1", + "power-assert-util-string-width": "1.2.0" + } + }, + "power-assert-renderer-base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", + "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" + }, + "power-assert-renderer-comparison": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", + "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", + "requires": { + "core-js": "2.5.7", + "diff-match-patch": "1.0.1", + "power-assert-renderer-base": "1.1.1", + "stringifier": "1.4.0", + "type-name": "2.0.2" + } + }, + "power-assert-renderer-diagram": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", + "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", + "requires": { + "core-js": "2.5.7", + "power-assert-renderer-base": "1.1.1", + "power-assert-util-string-width": "1.2.0", + "stringifier": "1.4.0" + } + }, + "power-assert-renderer-file": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", + "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", + "requires": { + "power-assert-renderer-base": "1.1.1" + } + }, + "power-assert-util-string-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", + "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", + "requires": { + "eastasianwidth": "0.2.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "1.1.2", + "@protobufjs/base64": "1.1.2", + "@protobufjs/codegen": "2.0.4", + "@protobufjs/eventemitter": "1.1.0", + "@protobufjs/fetch": "1.1.0", + "@protobufjs/float": "1.0.2", + "@protobufjs/inquire": "1.1.0", + "@protobufjs/path": "1.1.2", + "@protobufjs/pool": "1.1.0", + "@protobufjs/utf8": "1.1.0", + "@types/long": "4.0.0", + "@types/node": "10.7.1", + "long": "4.0.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "retry-axios": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", + "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" + }, + "retry-request": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", + "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", + "requires": { + "through2": "2.0.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "0.1.15" + } + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "2.1.2", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "3.0.2" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "stringifier": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.4.0.tgz", + "integrity": "sha512-cNsMOqqrcbLcHTXEVmkw9y0fwDwkdgtZwlfyolzpQDoAE1xdNGhQhxBUfiDvvZIKl1hnUEgMv66nHwtMz3OjPw==", + "requires": { + "core-js": "2.5.7", + "traverse": "0.6.6", + "type-name": "2.0.2" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + }, + "type-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", + "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "universal-deep-strict-equal": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", + "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", + "requires": { + "array-filter": "1.0.0", + "indexof": "0.0.1", + "object-keys": "1.0.12" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", + "requires": { + "camelcase": "2.1.1", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "os-locale": "1.4.0", + "string-width": "1.0.2", + "window-size": "0.1.4", + "y18n": "3.2.1" + } + } + } +} diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json new file mode 100644 index 00000000000..b5daf898d34 --- /dev/null +++ b/packages/google-cloud-asset/package.json @@ -0,0 +1,45 @@ +{ + "repository": "GoogleCloudPlatform/google-cloud-node", + "name": "asset", + "version": "0.1.0", + "author": "Google LLC", + "description": "Cloud Asset API client for Node.js", + "main": "src/index.js", + "files": [ + "protos", + "src", + "AUTHORS", + "COPYING" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google cloudasset", + "cloudasset", + "Cloud Asset API" + ], + "dependencies": { + "google-gax": "^0.17.1", + "lodash.merge": "^4.6.0", + "protobufjs": "^6.8.0" + }, + "devDependencies": { + "mocha": "^3.2.0", + "through2": "^2.0.3" + }, + "scripts": { + "publish-module": "node ../../scripts/publish.js cloudasset", + "smoke-test": "mocha smoke-test/*.js --timeout 5000", + "test": "mocha test/*.js" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=4.0.0" + } +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto new file mode 100644 index 00000000000..da859d102f3 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -0,0 +1,160 @@ +// Copyright 2018 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.asset.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/asset/v1beta1/assets.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; + + +// Asset service definition. +service AssetService { + // Exports assets with time and resource types to a given Google Cloud Storage + // location. The output format is newline delimited JSON. + // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users + // to keep track of the export. + rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}:exportAssets" + body: "*" + additional_bindings { + post: "/v1beta1/{parent=organizations/*}:exportAssets" + body: "*" + } + }; + } + + // Batch gets assets update history that overlaps a time window. + // For RESOURCE content, this API outputs history with asset in both + // non-delete or deleted status. + // For IAM_POLICY content, this API only outputs history when asset and its + // attached IAM POLICY both exist. So there may be gaps in the output history. + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}:batchGetAssetsHistory" + additional_bindings { + get: "/v1beta1/{parent=organizations/*}:batchGetAssetHistory" + } + }; + } +} + +// Export asset request. +message ExportAssetsRequest { + // Required. The relative name of the root asset. It can only be an + // organization number (e.g. "organizations/123") or a project number + // (e.g. "projects/12345"). + string parent = 1; + + // Timestamp to take an asset snapshot. This can only be current or past + // time. If not specified, the current time will be used. Due to delays in + // resource data collection and indexing, there is a volatile window during + // which running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. Example: + // "google.compute.disk". If specified, only matching assets will be returned. + repeated string asset_types = 3; + + // A list of asset content types. If specified, only matching content will be + // returned. Otherwise, no content but the asset name will be returned. + repeated ContentType content_types = 4; + + // Required. Output configuration indicating where the results will be output + // to. All results will be in newline delimited JSON format. + OutputConfig output_config = 5; +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +message ExportAssetsResponse { + // Required. Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Required. Output configuration indicating where the results were output to. + // All results are in JSON format. + OutputConfig output_config = 2; +} + +// Batch get assets history request. +message BatchGetAssetsHistoryRequest { + // Required. The relative name of the root asset. It can only be an + // organization ID (e.g. "organizations/123") or a project ID + // (e.g. "projects/12345"). + string parent = 1; + + // A list of the full names of the assets. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // Example: + // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // + // The request becomes a no-op if the asset name list is empty. + repeated string asset_names = 2; + + // Required. The content type. + ContentType content_type = 3; + + // Required. The time window for the asset history. The returned results + // contain all temporal assets whose time window overlap with + // read_time_window. + TimeWindow read_time_window = 4; +} + +// Batch get assets history response. +message BatchGetAssetsHistoryResponse { + // A list of assets with valid time windows. + repeated TemporalAsset assets = 1; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Google Cloud Storage (GCS). + GcsDestination gcs_destination = 1; + } +} + +// A Google Cloud Storage (GCS) location. +message GcsDestination { + // The path of the GCS objects. It's the same path that is used by gsutil, for + // example: "gs://bucket_name/object_path". See: + // https://cloud.google.com/storage/docs/viewing-editing-metadata for more + // information. + string uri = 1; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto new file mode 100644 index 00000000000..ca4f144f08a --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -0,0 +1,114 @@ +// Copyright 2018 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.asset.v1beta1; + +import "google/api/annotations.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; + + +// Temporal asset. In addition to the asset, the temporal asset includes the +// status of the asset and valid from and to time of it. +message TemporalAsset { + // The time window when the asset data and state was observed. + TimeWindow window = 1; + + // If the asset is deleted or not. + bool deleted = 2; + + // Asset. + Asset asset = 3; +} + +// A time window of [start_time, end_time). +message TimeWindow { + // Start time of the time window (inclusive). + // Infinite past if not specified. + google.protobuf.Timestamp start_time = 1; + + // End time of the time window (exclusive). + // Infinite future if not specified. + google.protobuf.Timestamp end_time = 2; +} + +// Cloud asset. This include all Google Cloud Platform resources, as well as +// IAM policies and other non-GCP assets. +message Asset { + // The full name of the asset. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // Example: + // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + string name = 1; + + // Type of the asset. Example: "google.compute.disk". + string asset_type = 2; + + // Representation of the resource. + Resource resource = 3; + + // Representation of the actual IAM policy set on a cloud resource. For each + // resource, there must be at most one IAM policy set on it. + google.iam.v1.Policy iam_policy = 4; +} + +// Representation of a cloud resource. +message Resource { + // The API version. Example: "v1". + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // Example: + // "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + // It will be left unspecified for resources without a discovery-based API, + // such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. + // Example: "Project". It will be left unspecified for resources (such as + // Cloud Bigtable) without a discovery-based API. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP GET operation using this + // URL returns the resource itself. + // Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + // It will be left unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // + // For GCP assets, it is the parent resource defined in the IAM policy + // hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + // Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + // + // For third-party assets, it is up to the users to define. + string parent = 5; + + // The content of the resource, in which some sensitive fields are scrubbed + // away and may not be present. + google.protobuf.Struct data = 6; +} diff --git a/packages/google-cloud-asset/samples/.eslintrc.yml b/packages/google-cloud-asset/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-asset/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js new file mode 100644 index 00000000000..04ca2353c69 --- /dev/null +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -0,0 +1,22 @@ +/** + * Copyright 2018, 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'; + +// [START asset_quickstart] +// Imports the Google Cloud client library +const asset = require('@google-cloud/asset'); + +// [END asset_quickstart] diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js new file mode 100644 index 00000000000..0bcf16f39b8 --- /dev/null +++ b/packages/google-cloud-asset/src/index.js @@ -0,0 +1,79 @@ +// Copyright 2018 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. + +/** + * @namespace google + */ +/** + * @namespace google.cloud + */ +/** + * @namespace google.cloud.asset + */ +/** + * @namespace google.cloud.asset.v1beta1 + */ + +'use strict'; + +// Import the clients for each version supported by this package. +const gapic = Object.freeze({ + v1beta1: require('./v1beta1'), +}); + +/** + * The `asset` package has the following named exports: + * + * - `AssetServiceClient` - Reference to + * {@link v1beta1.AssetServiceClient} + * - `v1beta1` - This is used for selecting or pinning a + * particular backend service version. It exports: + * - `AssetServiceClient` - Reference to + * {@link v1beta1.AssetServiceClient} + * + * @module {object} asset + * @alias nodejs-asset + * + * @example Install the client library with npm: + * npm install --save asset + * + * @example Import the client library: + * const asset = require('asset'); + * + * @example Create a client that uses Application Default Credentials (ADC): + * const client = new asset.AssetServiceClient(); + * + * @example Create a client with explicit credentials: + * const client = new asset.AssetServiceClient({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json', + * }); + */ + +/** + * @type {object} + * @property {constructor} AssetServiceClient + * Reference to {@link v1beta1.AssetServiceClient} + */ +module.exports = gapic.v1beta1; + +/** + * @type {object} + * @property {constructor} AssetServiceClient + * Reference to {@link v1beta1.AssetServiceClient} + */ +module.exports.v1beta1 = gapic.v1beta1; + +// Alias `module.exports` as `module.exports.default`, for future-proofing. +module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js new file mode 100644 index 00000000000..a6ae27165b4 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -0,0 +1,454 @@ +// Copyright 2018 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. + +'use strict'; + +const gapicConfig = require('./asset_service_client_config'); +const gax = require('google-gax'); +const merge = require('lodash.merge'); +const path = require('path'); +const protobuf = require('protobufjs'); + +const VERSION = require('../../package.json').version; + +/** + * Asset service definition. + * + * @class + * @memberof v1beta1 + */ +class AssetServiceClient { + /** + * Construct an instance of AssetServiceClient. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(opts) { + this._descriptors = {}; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath: this.constructor.servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + var gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + var clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}`, + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + var protos = merge( + {}, + gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + 'google/cloud/asset/v1beta1/asset_service.proto' + ) + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + projectPathTemplate: new gax.PathTemplate( + 'projects/{project}' + ), + }; + var protoFilesRoot = new gax.GoogleProtoFilesRoot(); + protoFilesRoot = protobuf.loadSync( + path.join(__dirname, '..', '..', 'protos', 'google/cloud/asset/v1beta1/asset_service.proto'), + protoFilesRoot + ); + + + // 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 = new gax.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc, + }).operationsClient(opts); + + var exportAssetsResponse = protoFilesRoot.lookup( + 'google.cloud.asset.v1beta1.ExportAssetsResponse' + ); + var exportAssetsMetadata = protoFilesRoot.lookup( + 'google.cloud.asset.v1beta1.ExportAssetsRequest' + ); + + this._descriptors.longrunning = { + exportAssets: new gax.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata) + ), + }; + + // Put together the default options sent with requests. + var defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1beta1.AssetService', + gapicConfig, + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1beta1.AssetService. + var assetServiceStub = gaxGrpc.createStub( + protos.google.cloud.asset.v1beta1.AssetService, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + var assetServiceStubMethods = [ + 'exportAssets', + 'batchGetAssetsHistory', + ]; + for (let methodName of assetServiceStubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + assetServiceStub.then( + stub => + function() { + var args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + } + ), + defaults[methodName], + this._descriptors.longrunning[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.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', + ]; + } + + /** + * 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) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Exports assets with time and resource types to a given Google Cloud Storage + * location. The output format is newline delimited JSON. + * This API implements the google.longrunning.Operation API allowing users + * to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization number (e.g. "organizations/123") or a project number + * (e.g. "projects/12345"). + * @param {number[]} request.contentTypes + * A list of asset content types. If specified, only matching content will be + * returned. Otherwise, no content but the asset name will be returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} + * @param {Object} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} + * @param {Object} [request.readTime] + * Timestamp to take an asset snapshot. This can only be current or past + * time. If not specified, the current time will be used. Due to delays in + * resource data collection and indexing, there is a volatile window during + * which running the same query may get different results. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {string[]} [request.assetTypes] + * A list of asset types to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + * @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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1beta1'); + * + * var client = new asset.v1beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * var formattedParent = client.projectPath('[PROJECT]'); + * var contentTypes = []; + * var outputConfig = {}; + * var request = { + * parent: formattedParent, + * contentTypes: contentTypes, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the promise pattern. + * client.exportAssets(request) + * .then(responses => { + * var operation = responses[0]; + * var initialApiResponse = responses[1]; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * // The final result of the operation. + * var result = responses[0]; + * + * // The metadata value of the completed operation. + * var metadata = responses[1]; + * + * // The response of the api call returning the complete operation. + * var finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * var formattedParent = client.projectPath('[PROJECT]'); + * var contentTypes = []; + * var outputConfig = {}; + * var request = { + * parent: formattedParent, + * contentTypes: contentTypes, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.exportAssets(request) + * .then(responses => { + * var operation = responses[0]; + * var initialApiResponse = responses[1]; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + */ + exportAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.exportAssets(request, options, callback); + } + + /** + * Batch gets assets update history that overlaps a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API only outputs history when asset and its + * attached IAM POLICY both exist. So there may be gaps in the output history. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization ID (e.g. "organizations/123") or a project ID + * (e.g. "projects/12345"). + * @param {string[]} request.assetNames + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * + * The request becomes a no-op if the asset name list is empty. + * @param {number} request.contentType + * Required. The content type. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} + * @param {Object} request.readTimeWindow + * Required. The time window for the asset history. The returned results + * contain all temporal assets whose time window overlap with + * read_time_window. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} + * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1beta1'); + * + * var client = new asset.v1beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * var formattedParent = client.projectPath('[PROJECT]'); + * var assetNames = []; + * var contentType = 'CONTENT_TYPE_UNSPECIFIED'; + * var readTimeWindow = {}; + * var request = { + * parent: formattedParent, + * assetNames: assetNames, + * contentType: contentType, + * readTimeWindow: readTimeWindow, + * }; + * client.batchGetAssetsHistory(request) + * .then(responses => { + * var response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + batchGetAssetsHistory(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.batchGetAssetsHistory(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {String} project + * @returns {String} + */ + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the projectName from a project resource. + * + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate + .match(projectName) + .project; + } +} + + +module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json new file mode 100644 index 00000000000..412e8028be3 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.asset.v1beta1.AssetService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExportAssets": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchGetAssetsHistory": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js new file mode 100644 index 00000000000..68ab69d4ef8 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -0,0 +1,189 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Export asset request. + * + * @property {string} parent + * Required. The relative name of the root asset. It can only be an + * organization number (e.g. "organizations/123") or a project number + * (e.g. "projects/12345"). + * + * @property {Object} readTime + * Timestamp to take an asset snapshot. This can only be current or past + * time. If not specified, the current time will be used. Due to delays in + * resource data collection and indexing, there is a volatile window during + * which running the same query may get different results. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string[]} assetTypes + * A list of asset types to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + * + * @property {number[]} contentTypes + * A list of asset content types. If specified, only matching content will be + * returned. Otherwise, no content but the asset name will be returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} + * + * @property {Object} outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} + * + * @typedef ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} + */ +var ExportAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The export asset response. This message is returned by the + * google.longrunning.Operations.GetOperation method in the returned + * google.longrunning.Operation.response field. + * + * @property {Object} readTime + * Required. Time the snapshot was taken. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} outputConfig + * Required. Output configuration indicating where the results were output to. + * All results are in JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} + * + * @typedef ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} + */ +var ExportAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Batch get assets history request. + * + * @property {string} parent + * Required. The relative name of the root asset. It can only be an + * organization ID (e.g. "organizations/123") or a project ID + * (e.g. "projects/12345"). + * + * @property {string[]} assetNames + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * + * The request becomes a no-op if the asset name list is empty. + * + * @property {number} contentType + * Required. The content type. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} + * + * @property {Object} readTimeWindow + * Required. The time window for the asset history. The returned results + * contain all temporal assets whose time window overlap with + * read_time_window. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} + * + * @typedef BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} + */ +var BatchGetAssetsHistoryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Batch get assets history response. + * + * @property {Object[]} assets + * A list of assets with valid time windows. + * + * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1beta1.TemporalAsset} + * + * @typedef BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} + */ +var BatchGetAssetsHistoryResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for export assets destination. + * + * @property {Object} gcsDestination + * Destination on Google Cloud Storage (GCS). + * + * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1beta1.GcsDestination} + * + * @typedef OutputConfig + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} + */ +var OutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A Google Cloud Storage (GCS) location. + * + * @property {string} uri + * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + * + * @typedef GcsDestination + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} + */ +var GcsDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Asset content type. + * + * @enum {number} + * @memberof google.cloud.asset.v1beta1 + */ +var ContentType = { + + /** + * Unspecified content type. + */ + CONTENT_TYPE_UNSPECIFIED: 0, + + /** + * Resource metadata. + */ + RESOURCE: 1, + + /** + * The actual IAM policy set on a resource. + */ + IAM_POLICY: 2 +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js new file mode 100644 index 00000000000..dc45bc0ad0f --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -0,0 +1,145 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Temporal asset. In addition to the asset, the temporal asset includes the + * status of the asset and valid from and to time of it. + * + * @property {Object} window + * The time window when the asset data and state was observed. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} + * + * @property {boolean} deleted + * If the asset is deleted or not. + * + * @property {Object} asset + * Asset. + * + * This object should have the same structure as [Asset]{@link google.cloud.asset.v1beta1.Asset} + * + * @typedef TemporalAsset + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} + */ +var TemporalAsset = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A time window of [start_time, end_time). + * + * @property {Object} startTime + * Start time of the time window (inclusive). + * Infinite past if not specified. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} endTime + * End time of the time window (exclusive). + * Infinite future if not specified. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef TimeWindow + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} + */ +var TimeWindow = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Cloud asset. This include all Google Cloud Platform resources, as well as + * IAM policies and other non-GCP assets. + * + * @property {string} name + * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * + * @property {string} assetType + * Type of the asset. Example: "google.compute.disk". + * + * @property {Object} resource + * Representation of the resource. + * + * This object should have the same structure as [Resource]{@link google.cloud.asset.v1beta1.Resource} + * + * @property {Object} iamPolicy + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * + * @typedef Asset + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} + */ +var Asset = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Representation of a cloud resource. + * + * @property {string} version + * The API version. Example: "v1". + * + * @property {string} discoveryDocumentUri + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + * + * @property {string} discoveryName + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + * + * @property {string} resourceUrl + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + * + * @property {string} parent + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * + * For third-party assets, it is up to the users to define. + * + * @property {Object} data + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @typedef Resource + * @memberof google.cloud.asset.v1beta1 + * @see [google.cloud.asset.v1beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} + */ +var Resource = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js new file mode 100644 index 00000000000..0163cf59f58 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -0,0 +1,162 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. + * + * + * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * `members` to a `role`, where the members can be user accounts, Google groups, + * Google domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. + * + * **Example** + * + * { + * "bindings": [ + * { + * "role": "roles/owner", + * "members": [ + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * ] + * }, + * { + * "role": "roles/viewer", + * "members": ["user:sean@example.com"] + * } + * ] + * } + * + * For a description of IAM and its features, see the + * [IAM developer's guide](https://cloud.google.com/iam). + * + * @property {number} version + * Version of the `Policy`. The default version is 0. + * + * @property {Object[]} bindings + * Associates a list of `members` to a `role`. + * Multiple `bindings` must not be specified for the same `role`. + * `bindings` with no members will result in an error. + * + * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} + * + * @property {string} etag + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + * + * @typedef Policy + * @memberof google.iam.v1 + * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +var Policy = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Associates `members` with a `role`. + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * @property {string[]} members + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * @typedef Binding + * @memberof google.iam.v1 + * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +var Binding = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The difference delta between two policies. + * + * @property {Object[]} bindingDeltas + * The delta for Bindings between two policies. + * + * This object should have the same structure as [BindingDelta]{@link google.iam.v1.BindingDelta} + * + * @typedef PolicyDelta + * @memberof google.iam.v1 + * @see [google.iam.v1.PolicyDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +var PolicyDelta = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * One delta entry for Binding. Each individual change (only one member in each + * entry) to a binding will be a separate entry. + * + * @property {number} action + * The action that was performed on a Binding. + * Required + * + * The number should be among the values of [Action]{@link google.iam.v1.Action} + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * @property {string} member + * A single identity requesting access for a Cloud Platform resource. + * Follows the same format of Binding.members. + * Required + * + * @typedef BindingDelta + * @memberof google.iam.v1 + * @see [google.iam.v1.BindingDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +var BindingDelta = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js new file mode 100644 index 00000000000..79ef6344437 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -0,0 +1,147 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If true, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +var Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.GetOperation. + * + * @property {string} name + * The name of the operation resource. + * + * @typedef GetOperationRequest + * @memberof google.longrunning + * @see [google.longrunning.GetOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +var GetOperationRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.ListOperations. + * + * @property {string} name + * The name of the operation collection. + * + * @property {string} filter + * The standard list filter. + * + * @property {number} pageSize + * The standard list page size. + * + * @property {string} pageToken + * The standard list page token. + * + * @typedef ListOperationsRequest + * @memberof google.longrunning + * @see [google.longrunning.ListOperationsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +var ListOperationsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The response message for Operations.ListOperations. + * + * @property {Object[]} operations + * A list of operations that matches the specified filter in the request. + * + * This object should have the same structure as [Operation]{@link google.longrunning.Operation} + * + * @property {string} nextPageToken + * The standard List next-page token. + * + * @typedef ListOperationsResponse + * @memberof google.longrunning + * @see [google.longrunning.ListOperationsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +var ListOperationsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.CancelOperation. + * + * @property {string} name + * The name of the operation resource to be cancelled. + * + * @typedef CancelOperationRequest + * @memberof google.longrunning + * @see [google.longrunning.CancelOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +var CancelOperationRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message for Operations.DeleteOperation. + * + * @property {string} name + * The name of the operation resource to be deleted. + * + * @typedef DeleteOperationRequest + * @memberof google.longrunning + * @see [google.longrunning.DeleteOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +var DeleteOperationRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js new file mode 100644 index 00000000000..f55fa17ff12 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -0,0 +1,131 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * # JSON + * + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message google.protobuf.Duration): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * @property {string} typeUrl + * A URL/resource name whose content describes the type of the + * serialized protocol buffer message. + * + * For URLs which use the scheme `http`, `https`, or no scheme, the + * following restrictions and interpretations apply: + * + * * If no scheme is provided, `https` is assumed. + * * The last segment of the URL's path must represent the fully + * qualified name of the type (as in `path/google.protobuf.Duration`). + * The name should be in a canonical form (e.g., leading "." is + * not accepted). + * * An HTTP GET on the URL must yield a google.protobuf.Type + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * @property {string} value + * Must be a valid serialized protocol buffer of the above specified type. + * + * @typedef Any + * @memberof google.protobuf + * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} + */ +var Any = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js new file mode 100644 index 00000000000..efcd8ac5af9 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -0,0 +1,112 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @property {Object.} fields + * Unordered map of dynamically typed values. + * + * @typedef Struct + * @memberof google.protobuf + * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +var Struct = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @property {number} nullValue + * Represents a null value. + * + * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} + * + * @property {number} numberValue + * Represents a double value. + * + * @property {string} stringValue + * Represents a string value. + * + * @property {boolean} boolValue + * Represents a boolean value. + * + * @property {Object} structValue + * Represents a structured value. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @property {Object} listValue + * Represents a repeated `Value`. + * + * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} + * + * @typedef Value + * @memberof google.protobuf + * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +var Value = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @property {Object[]} values + * Repeated field of dynamically typed values. + * + * This object should have the same structure as [Value]{@link google.protobuf.Value} + * + * @typedef ListValue + * @memberof google.protobuf + * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +var ListValue = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @enum {number} + * @memberof google.protobuf + */ +var NullValue = { + + /** + * Null value. + */ + NULL_VALUE: 0 +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..a02db52bdeb --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,113 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required, though only UTC (as indicated by "Z") is presently supported. + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) + * to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +var Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js new file mode 100644 index 00000000000..7122f1682e0 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js @@ -0,0 +1,92 @@ +// Copyright 2018 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `Status` type defines a logical error model that is suitable for different + * programming environments, including REST APIs and RPC APIs. It is used by + * [gRPC](https://github.com/grpc). The error model is designed to be: + * + * - Simple to use and understand for most users + * - Flexible enough to meet unexpected needs + * + * # Overview + * + * The `Status` message contains three pieces of data: error code, error message, + * and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes if needed. The + * error message should be a developer-facing English message that helps + * developers *understand* and *resolve* the error. If a localized user-facing + * error message is needed, put the localized message in the error details or + * localize it in the client. The optional error details may contain arbitrary + * information about the error. There is a predefined set of error detail types + * in the package `google.rpc` that can be used for common error conditions. + * + * # Language mapping + * + * The `Status` message is the logical representation of the error model, but it + * is not necessarily the actual wire format. When the `Status` message is + * exposed in different client libraries and different wire protocols, it can be + * mapped differently. For example, it will likely be mapped to some exceptions + * in Java, but more likely mapped to some error codes in C. + * + * # Other uses + * + * The error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a + * consistent developer experience across different environments. + * + * Example uses of this error model include: + * + * - Partial errors. If a service needs to return partial errors to the client, + * it may embed the `Status` in the normal response to indicate the partial + * errors. + * + * - Workflow errors. A typical workflow has multiple steps. Each step may + * have a `Status` message for error reporting. + * + * - Batch operations. If a client uses batch request and batch response, the + * `Status` message should be used directly inside batch response, one for + * each error sub-response. + * + * - Asynchronous operations. If an API call embeds asynchronous operation + * results in its response, the status of those operations should be + * represented directly using the `Status` message. + * + * - Logging. If some API errors are stored in logs, the message `Status` could + * be used directly after any stripping needed for security/privacy reasons. + * + * @property {number} code + * The status code, which should be an enum value of google.rpc.Code. + * + * @property {string} message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + * + * @property {Object[]} details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Status + * @memberof google.rpc + * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} + */ +var Status = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/index.js b/packages/google-cloud-asset/src/v1beta1/index.js new file mode 100644 index 00000000000..e2d8ba4f042 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/index.js @@ -0,0 +1,19 @@ +// Copyright 2018 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. + +'use strict'; + +const AssetServiceClient = require('./asset_service_client'); + +module.exports.AssetServiceClient = AssetServiceClient; diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 45fac29a6ea..61b52ee2cea 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -1,45 +1,43 @@ -# copyright 2018 google LLC +# Copyright 2018 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 +# 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 +# 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.""" +# 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 subprocess import logging -logging.basicconfig(level=logging.debug) +logging.basicConfig(level=logging.DEBUG) + +gapic = gcp.GAPICGenerator() +common_templates = gcp.CommonTemplates() -gapic = gcp.gapicgenerator() -common_templates = gcp.commontemplates() +version = 'v1beta1' -version = "v1" +library = gapic.node_library( + 'asset', version, config_path="artman_cloudasset_v1beta1.yaml", + artman_output_name=f"cloudasset-{version}") -library = gapic.node_library('asset', version, private=True) -s.copy(library, excludes=['src/index.js', 'readme.md', 'package.json']) +s.copy(library) +# , excludes=['src/index.js', 'README.md', 'package.json']) templates = common_templates.node_library( - package_name="@google-cloud/asset", - repo_name="googleapis/nodejs-asset", -) + package_name="@google-cloud/asset", repo_name="googleapis/nodejs-asset") s.copy(templates) - - ''' -node.js specific cleanup +Node.js specific cleanup ''' -subprocess.run(['npm', 'ci']) +subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'prettier']) subprocess.run(['npm', 'run', 'lint']) - diff --git a/packages/google-cloud-asset/system-test/.eslintrc.yml b/packages/google-cloud-asset/system-test/.eslintrc.yml new file mode 100644 index 00000000000..2e6882e46d2 --- /dev/null +++ b/packages/google-cloud-asset/system-test/.eslintrc.yml @@ -0,0 +1,6 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off + no-console: off diff --git a/packages/google-cloud-asset/test/.eslintrc.yml b/packages/google-cloud-asset/test/.eslintrc.yml new file mode 100644 index 00000000000..73f7bbc946f --- /dev/null +++ b/packages/google-cloud-asset/test/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +env: + mocha: true +rules: + node/no-unpublished-require: off diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js new file mode 100644 index 00000000000..5adeca94880 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -0,0 +1,202 @@ +// Copyright 2018 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. + +'use strict'; + +const assert = require('assert'); + +const assetModule = require('../src'); + +var FAKE_STATUS_CODE = 1; +var error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe('AssetServiceClient', () => { + describe('exportAssets', function() { + it('invokes exportAssets without error', done => { + var client = new assetModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + var formattedParent = client.projectPath('[PROJECT]'); + var contentTypes = []; + var outputConfig = {}; + var request = { + parent: formattedParent, + contentTypes: contentTypes, + outputConfig: outputConfig, + }; + + // Mock response + var expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod(request, expectedResponse); + + client.exportAssets(request).then(responses => { + var operation = responses[0]; + return operation.promise(); + }).then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }).catch(err => { + done(err); + }); + }); + + it('invokes exportAssets with error', done => { + var client = new assetModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + var formattedParent = client.projectPath('[PROJECT]'); + var contentTypes = []; + var outputConfig = {}; + var request = { + parent: formattedParent, + contentTypes: contentTypes, + outputConfig: outputConfig, + }; + + // Mock Grpc layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod(request, null, error); + + client.exportAssets(request).then(responses => { + var operation = responses[0]; + return operation.promise(); + }).then(() => { + assert.fail(); + }).catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + var client = new assetModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert(client._descriptors.longrunning.exportAssets.responseDecoder instanceof Function); + assert(client._descriptors.longrunning.exportAssets.metadataDecoder instanceof Function); + }); + }); + + describe('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', done => { + var client = new assetModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + var formattedParent = client.projectPath('[PROJECT]'); + var assetNames = []; + var contentType = 'CONTENT_TYPE_UNSPECIFIED'; + var readTimeWindow = {}; + var request = { + parent: formattedParent, + assetNames: assetNames, + contentType: contentType, + readTimeWindow: readTimeWindow, + }; + + // Mock response + var expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.batchGetAssetsHistory(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes batchGetAssetsHistory with error', done => { + var client = new assetModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + var formattedParent = client.projectPath('[PROJECT]'); + var assetNames = []; + var contentType = 'CONTENT_TYPE_UNSPECIFIED'; + var readTimeWindow = {}; + var request = { + parent: formattedParent, + assetNames: assetNames, + contentType: contentType, + readTimeWindow: readTimeWindow, + }; + + // Mock Grpc layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.batchGetAssetsHistory(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} + +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + var mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } + else { + resolve([response]); + } + }); + } + }; + return Promise.resolve([mockOperation]); + }; +} From 1cd2ee3a0712748504058d02e13b7e0a747126d6 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:09:48 -0700 Subject: [PATCH 003/429] add some missing namespaces --- packages/google-cloud-asset/src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js index 0bcf16f39b8..1367370632e 100644 --- a/packages/google-cloud-asset/src/index.js +++ b/packages/google-cloud-asset/src/index.js @@ -24,6 +24,15 @@ /** * @namespace google.cloud.asset.v1beta1 */ +/** + * @namespace google.protobuf + */ +/** + * @namespace google.rpc + */ +/** + * @namespace google.type + */ 'use strict'; From 88e32d17ecdd51a0cf41fae21b13d94b5373c7d5 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:11:01 -0700 Subject: [PATCH 004/429] src/index.js import from correct scope --- packages/google-cloud-asset/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js index 1367370632e..a0d2ad6f8d2 100644 --- a/packages/google-cloud-asset/src/index.js +++ b/packages/google-cloud-asset/src/index.js @@ -55,10 +55,10 @@ const gapic = Object.freeze({ * @alias nodejs-asset * * @example Install the client library with npm: - * npm install --save asset + * npm install --save @google-cloud/asset * * @example Import the client library: - * const asset = require('asset'); + * const asset = require('@google-cloud/asset'); * * @example Create a client that uses Application Default Credentials (ADC): * const client = new asset.AssetServiceClient(); From 454e001442d9fc77b2cedf178ae5a343862a91c4 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:11:40 -0700 Subject: [PATCH 005/429] repo and package name --- packages/google-cloud-asset/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b5daf898d34..bc3e7e6534e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,6 +1,6 @@ { - "repository": "GoogleCloudPlatform/google-cloud-node", - "name": "asset", + "repository": "googleapis/nodejs-asset", + "name": "@google-cloud/asset", "version": "0.1.0", "author": "Google LLC", "description": "Cloud Asset API client for Node.js", From 24aa141b39654eb7ed94caff99e6bc9dd3b4702b Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:15:04 -0700 Subject: [PATCH 006/429] remove package-lock.json from repo --- packages/google-cloud-asset/.gitignore | 1 + packages/google-cloud-asset/package-lock.json | 2543 ----------------- 2 files changed, 1 insertion(+), 2543 deletions(-) delete mode 100644 packages/google-cloud-asset/package-lock.json diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index 5b265aef806..b895f87eb0b 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -8,6 +8,7 @@ build/ system-test/secrets.js system-test/*key.json *.lock +**/package-lock.json .DS_Store google-cloud-logging-winston-*.tgz google-cloud-logging-bunyan-*.tgz diff --git a/packages/google-cloud-asset/package-lock.json b/packages/google-cloud-asset/package-lock.json deleted file mode 100644 index 8816113e4d4..00000000000 --- a/packages/google-cloud-asset/package-lock.json +++ /dev/null @@ -1,2543 +0,0 @@ -{ - "name": "asset", - "version": "0.1.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "requires": { - "call-me-maybe": "1.0.1", - "glob-to-regexp": "0.3.0" - } - }, - "@nodelib/fs.stat": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz", - "integrity": "sha512-KU/VDjC5RwtDUZiz3d+DHXJF2lp5hB9dn552TXIyptj8SH1vXmR40mG0JgGq03IlYsOgGfcv8xrLpSQ0YUMQdA==" - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/inquire": "1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@types/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", - "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" - }, - "@types/node": { - "version": "10.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.7.1.tgz", - "integrity": "sha512-EGoI4ylB/lPOaqXqtzAyL8HcgOuCtH2hkEaLmkueOYufsTFWBn4VCvlCDC2HW8Q+9iF+QVC3sxjDKQYjHQeZ9w==" - }, - "acorn": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.2.tgz", - "integrity": "sha512-cJrKCNcr2kv8dlDnbw+JPUGjHZzo4myaxOLmpOX8a+rgX94YeTcTMv/LFJUSByRpc+i4GgVnnhLxvMu/2Y+rqw==" - }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "ascli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", - "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", - "requires": { - "colour": "0.7.1", - "optjs": "3.2.2" - } - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, - "axios": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", - "requires": { - "follow-redirects": "1.5.7", - "is-buffer": "1.1.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.3", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "bytebuffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", - "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", - "requires": { - "long": "3.2.0" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, - "call-signature": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" - } - }, - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" - }, - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": "1.0.1" - } - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", - "dev": true - }, - "diff-match-patch": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.1.tgz", - "integrity": "sha512-A0QEhr4PxGUMEtKxd6X+JLnOTFd3BfIPSDpsc4dMvj+CbSaErDwTpoTo/nFJDMSrjxLW4BiNq+FbNisAAHhWeQ==" - }, - "dir-glob": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", - "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", - "requires": { - "arrify": "1.0.1", - "path-type": "3.0.0" - } - }, - "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", - "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" - } - }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "ecdsa-sig-formatter": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", - "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "empower": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.0.tgz", - "integrity": "sha512-tP2WqM7QzrPguCCQEQfFFDF+6Pw6YWLQal3+GHQaV+0uIr0S+jyREQPWljE02zFCYPFYLZ3LosiRV+OzTrxPpQ==", - "requires": { - "core-js": "2.5.7", - "empower-core": "1.2.0" - } - }, - "empower-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", - "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", - "requires": { - "call-signature": "0.0.2", - "core-js": "2.5.7" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "1.4.0" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "espurify": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", - "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", - "requires": { - "core-js": "2.5.7" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "fast-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.2.tgz", - "integrity": "sha512-TR6zxCKftDQnUAPvkrCWdBgDq/gbqx8A3ApnBrR5rMvpp6+KMJI0Igw7fkWPgeVK0uhRXTXdvO3O+YP0CaUX2g==", - "requires": { - "@mrmlnc/readdir-enhanced": "2.2.1", - "@nodelib/fs.stat": "1.1.1", - "glob-parent": "3.1.0", - "is-glob": "4.0.0", - "merge2": "1.2.2", - "micromatch": "3.1.10" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "follow-redirects": { - "version": "1.5.7", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.7.tgz", - "integrity": "sha512-NONJVIFiX7Z8k2WxfqBjtwqMifx7X42ORLFrOZ2LTKGj71G3C0kfdyTqGqr8fx5zSX6Foo/D95dgGWbPUiwnew==", - "requires": { - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "requires": { - "map-cache": "0.2.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "gcp-metadata": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", - "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", - "requires": { - "axios": "0.18.0", - "extend": "3.0.2", - "retry-axios": "0.3.2" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "2.1.1" - } - } - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" - }, - "globby": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", - "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", - "requires": { - "array-union": "1.0.2", - "dir-glob": "2.0.0", - "fast-glob": "2.2.2", - "glob": "7.1.2", - "ignore": "3.3.10", - "pify": "3.0.0", - "slash": "1.0.0" - } - }, - "google-auth-library": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.6.1.tgz", - "integrity": "sha512-jYiWC8NA9n9OtQM7ANn0Tk464do9yhKEtaJ72pKcaBiEwn4LwcGYIYOfwtfsSm3aur/ed3tlSxbmg24IAT6gAg==", - "requires": { - "axios": "0.18.0", - "gcp-metadata": "0.6.3", - "gtoken": "2.3.0", - "jws": "3.1.5", - "lodash.isstring": "4.0.1", - "lru-cache": "4.1.3", - "retry-axios": "0.3.2" - } - }, - "google-gax": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.17.1.tgz", - "integrity": "sha512-fAKvFx++SRr6bGWamWuVOkJzJnQqMgpJkhaB2oEwfFJ91rbFgEmIPRmZZ/MeIVVFUOuHUVyZ8nwjm5peyTZJ6g==", - "requires": { - "duplexify": "3.6.0", - "extend": "3.0.2", - "globby": "8.0.1", - "google-auth-library": "1.6.1", - "google-proto-files": "0.16.1", - "grpc": "1.14.1", - "is-stream-ended": "0.1.4", - "lodash": "4.17.10", - "protobufjs": "6.8.8", - "retry-request": "4.0.0", - "through2": "2.0.3" - } - }, - "google-p12-pem": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.2.tgz", - "integrity": "sha512-+EuKr4CLlGsnXx4XIJIVkcKYrsa2xkAmCvxRhX2HsazJzUBAJ35wARGeApHUn4nNfPD03Vl057FskNr20VaCyg==", - "requires": { - "node-forge": "0.7.6", - "pify": "3.0.0" - } - }, - "google-proto-files": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.16.1.tgz", - "integrity": "sha512-ykdhaYDiU/jlyrkzZDPemraKwVIgLT31XMHVNSJW//R9VED56hqSDRMx1Jlxbf0O4iDZnBWQ0JQLHbM2r5+wuA==", - "requires": { - "globby": "8.0.1", - "power-assert": "1.6.0", - "protobufjs": "6.8.8" - } - }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true - }, - "grpc": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.14.1.tgz", - "integrity": "sha512-UQA+WSa6CJYKv8rWAHX2RXCKhcxbB/5kyVnkiK3U+dPm4PlfZT4PrEeEdt2uzmvMhp9PB0SVKpVAukng1By+7w==", - "requires": { - "lodash": "4.17.10", - "nan": "2.10.0", - "node-pre-gyp": "0.10.3", - "protobufjs": "5.0.3" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "requires": { - "minipass": "2.3.3" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "iconv-lite": { - "version": "0.4.23", - "bundled": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "1.2.0", - "bundled": true - }, - "minipass": { - "version": "2.3.3", - "bundled": true, - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.2" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "requires": { - "minipass": "2.3.3" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true - } - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "needle": { - "version": "2.2.2", - "bundled": true, - "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.23", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "bundled": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.2", - "nopt": "4.0.1", - "npm-packlist": "1.1.11", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.6" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true - }, - "npm-packlist": { - "version": "1.1.11", - "bundled": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true - }, - "protobufjs": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", - "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", - "requires": { - "ascli": "1.0.1", - "bytebuffer": "5.0.1", - "glob": "7.1.2", - "yargs": "3.32.0" - } - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true - }, - "sax": { - "version": "1.2.4", - "bundled": true - }, - "semver": { - "version": "5.5.0", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "4.4.6", - "bundled": true, - "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.3", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, - "gtoken": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", - "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", - "requires": { - "axios": "0.18.0", - "google-p12-pem": "1.0.2", - "jws": "3.1.5", - "mime": "2.3.1", - "pify": "3.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "requires": { - "is-extglob": "2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "requires": { - "isobject": "3.0.1" - } - }, - "is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, - "jwa": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", - "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.10", - "safe-buffer": "5.1.2" - } - }, - "jws": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", - "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", - "requires": { - "jwa": "1.1.6", - "safe-buffer": "5.1.2" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "1.0.0" - } - }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" - }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash.keys": "3.1.2" - } - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", - "dev": true, - "requires": { - "lodash._baseassign": "3.2.0", - "lodash._basecreate": "3.0.3", - "lodash._isiterateecall": "3.0.9" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "1.0.1" - } - }, - "merge2": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.2.tgz", - "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", - "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.8", - "diff": "3.2.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "he": "1.1.1", - "json3": "3.3.2", - "lodash.create": "3.1.1", - "mkdirp": "0.5.1", - "supports-color": "3.1.2" - }, - "dependencies": { - "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "node-forge": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", - "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==" - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "3.0.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "3.0.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" - } - }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "1.0.0" - } - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" - }, - "power-assert": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.0.tgz", - "integrity": "sha512-nDb6a+p2C7Wj8Y2zmFtLpuv+xobXz4+bzT5s7dr0nn71tLozn7nRMQqzwbefzwZN5qOm0N7Cxhw4kXP75xboKA==", - "requires": { - "define-properties": "1.1.3", - "empower": "1.3.0", - "power-assert-formatter": "1.4.1", - "universal-deep-strict-equal": "1.2.2", - "xtend": "4.0.1" - } - }, - "power-assert-context-formatter": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", - "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", - "requires": { - "core-js": "2.5.7", - "power-assert-context-traversal": "1.2.0" - } - }, - "power-assert-context-reducer-ast": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", - "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", - "requires": { - "acorn": "5.7.2", - "acorn-es7-plugin": "1.1.7", - "core-js": "2.5.7", - "espurify": "1.8.1", - "estraverse": "4.2.0" - } - }, - "power-assert-context-traversal": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", - "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", - "requires": { - "core-js": "2.5.7", - "estraverse": "4.2.0" - } - }, - "power-assert-formatter": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", - "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", - "requires": { - "core-js": "2.5.7", - "power-assert-context-formatter": "1.2.0", - "power-assert-context-reducer-ast": "1.2.0", - "power-assert-renderer-assertion": "1.2.0", - "power-assert-renderer-comparison": "1.2.0", - "power-assert-renderer-diagram": "1.2.0", - "power-assert-renderer-file": "1.2.0" - } - }, - "power-assert-renderer-assertion": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", - "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", - "requires": { - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.2.0" - } - }, - "power-assert-renderer-base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", - "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" - }, - "power-assert-renderer-comparison": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", - "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", - "requires": { - "core-js": "2.5.7", - "diff-match-patch": "1.0.1", - "power-assert-renderer-base": "1.1.1", - "stringifier": "1.4.0", - "type-name": "2.0.2" - } - }, - "power-assert-renderer-diagram": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", - "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", - "requires": { - "core-js": "2.5.7", - "power-assert-renderer-base": "1.1.1", - "power-assert-util-string-width": "1.2.0", - "stringifier": "1.4.0" - } - }, - "power-assert-renderer-file": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", - "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", - "requires": { - "power-assert-renderer-base": "1.1.1" - } - }, - "power-assert-util-string-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", - "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", - "requires": { - "eastasianwidth": "0.2.0" - } - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "protobufjs": { - "version": "6.8.8", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", - "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/base64": "1.1.2", - "@protobufjs/codegen": "2.0.4", - "@protobufjs/eventemitter": "1.1.0", - "@protobufjs/fetch": "1.1.0", - "@protobufjs/float": "1.0.2", - "@protobufjs/inquire": "1.1.0", - "@protobufjs/path": "1.1.2", - "@protobufjs/pool": "1.1.0", - "@protobufjs/utf8": "1.1.0", - "@types/long": "4.0.0", - "@types/node": "10.7.1", - "long": "4.0.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, - "retry-axios": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", - "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" - }, - "retry-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", - "requires": { - "through2": "2.0.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "0.1.15" - } - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.2", - "use": "3.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "requires": { - "atob": "2.1.2", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "requires": { - "extend-shallow": "3.0.2" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "stringifier": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.4.0.tgz", - "integrity": "sha512-cNsMOqqrcbLcHTXEVmkw9y0fwDwkdgtZwlfyolzpQDoAE1xdNGhQhxBUfiDvvZIKl1hnUEgMv66nHwtMz3OjPw==", - "requires": { - "core-js": "2.5.7", - "traverse": "0.6.6", - "type-name": "2.0.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.1.1" - } - }, - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" - } - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" - } - }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" - }, - "type-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", - "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "0.1.1" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" - } - } - } - }, - "universal-deep-strict-equal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", - "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", - "requires": { - "array-filter": "1.0.0", - "indexof": "0.0.1", - "object-keys": "1.0.12" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", - "requires": { - "camelcase": "2.1.1", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "os-locale": "1.4.0", - "string-width": "1.0.2", - "window-size": "0.1.4", - "y18n": "3.2.1" - } - } - } -} From 2ab044c7a0fe2e798e60baa3e06980207258ca63 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:15:13 -0700 Subject: [PATCH 007/429] add missing deps --- packages/google-cloud-asset/package.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index bc3e7e6534e..775b4ac0ec6 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,6 +1,6 @@ { - "repository": "googleapis/nodejs-asset", - "name": "@google-cloud/asset", + "repository": "GoogleCloudPlatform/google-cloud-node", + "name": "asset", "version": "0.1.0", "author": "Google LLC", "description": "Cloud Asset API client for Node.js", @@ -34,9 +34,15 @@ "through2": "^2.0.3" }, "scripts": { - "publish-module": "node ../../scripts/publish.js cloudasset", - "smoke-test": "mocha smoke-test/*.js --timeout 5000", - "test": "mocha test/*.js" + "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", + "docs": "jsdoc -c .jsdoc.js", + "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", + "lint": "eslint src/ samples/ system-test/ test/", + "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", + "test-no-cover": "mocha test/*.js", + "test": "npm run cover" }, "license": "Apache-2.0", "engines": { From 62e494707ad86e2b2b521fa08a482a1fb71e6b4a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:15:46 -0700 Subject: [PATCH 008/429] update synth.py; --- packages/google-cloud-asset/synth.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 61b52ee2cea..b274b946b05 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -29,12 +29,11 @@ 'asset', version, config_path="artman_cloudasset_v1beta1.yaml", artman_output_name=f"cloudasset-{version}") -s.copy(library) -# , excludes=['src/index.js', 'README.md', 'package.json']) +s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) -templates = common_templates.node_library( - package_name="@google-cloud/asset", repo_name="googleapis/nodejs-asset") +templates = common_templates.node_library() s.copy(templates) + ''' Node.js specific cleanup ''' From d9da856848903f059d86c6ce3e65c378cbc05276 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:17:04 -0700 Subject: [PATCH 009/429] add a samples/package.json --- .../google-cloud-asset/samples/package.json | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/google-cloud-asset/samples/package.json diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json new file mode 100644 index 00000000000..6173a72d768 --- /dev/null +++ b/packages/google-cloud-asset/samples/package.json @@ -0,0 +1,22 @@ +{ + "name": "@google-cloud/asset-samples", + "description": "Samples for the Cloud Asset API Client Library for Node.js.", + "version": "0.0.1", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=8" + }, + "repository": "googleapis/nodejs-asset", + "private": true, + "nyc": { + "exclude": [ + "**/*.test.js" + ] + }, + "scripts": {}, + "dependencies": { + "@google-cloud/asset": "^0.1.0" + }, + "devDependencies": {} +} From 143d6c91fa8f22c2be8c620ca19bb3e8e4d6934d Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:17:41 -0700 Subject: [PATCH 010/429] add empty file to system-test --- packages/google-cloud-asset/system-test/no-tests.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/google-cloud-asset/system-test/no-tests.js diff --git a/packages/google-cloud-asset/system-test/no-tests.js b/packages/google-cloud-asset/system-test/no-tests.js new file mode 100644 index 00000000000..ed54b008e0c --- /dev/null +++ b/packages/google-cloud-asset/system-test/no-tests.js @@ -0,0 +1 @@ +console.log('no tests yet'); From f582fd0c8677c088761d2271d1814762ae127946 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:20:02 -0700 Subject: [PATCH 011/429] add dev deps to package.json --- packages/google-cloud-asset/package.json | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 775b4ac0ec6..18787838b61 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,6 +1,6 @@ { - "repository": "GoogleCloudPlatform/google-cloud-node", - "name": "asset", + "repository": "googleapis/nodejs-asset", + "name": "@google-cloud/asset", "version": "0.1.0", "author": "Google LLC", "description": "Cloud Asset API client for Node.js", @@ -30,7 +30,19 @@ "protobufjs": "^6.8.0" }, "devDependencies": { - "mocha": "^3.2.0", + "@google-cloud/nodejs-repo-tools": "^2.3.1", + "codecov": "^3.0.4", + "eslint": "^5.1.0", + "eslint-config-prettier": "^3.0.0", + "eslint-plugin-node": "^7.0.0", + "eslint-plugin-prettier": "^2.6.2", + "ink-docstrap": "^1.3.2", + "intelli-espower-loader": "^1.0.1", + "jsdoc": "^3.5.5", + "mocha": "^5.2.0", + "nyc": "^12.0.2", + "power-assert": "^1.6.0", + "prettier": "^1.13.7", "through2": "^2.0.3" }, "scripts": { @@ -46,6 +58,6 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=4.0.0" + "node": ">=6.0.0" } } From 99c52258f71f15922877fc9f9be9b09ff1630a5a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:22:14 -0700 Subject: [PATCH 012/429] npm run prettier --- .../src/v1beta1/asset_service_client.js | 33 ++++---- .../google-cloud-asset/test/gapic-v1beta1.js | 75 ++++++++++++------- 2 files changed, 63 insertions(+), 45 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index a6ae27165b4..cffe3aeb5f0 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -101,17 +101,20 @@ class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gax.PathTemplate( - 'projects/{project}' - ), + projectPathTemplate: new gax.PathTemplate('projects/{project}'), }; var protoFilesRoot = new gax.GoogleProtoFilesRoot(); protoFilesRoot = protobuf.loadSync( - path.join(__dirname, '..', '..', 'protos', 'google/cloud/asset/v1beta1/asset_service.proto'), + path.join( + __dirname, + '..', + '..', + 'protos', + 'google/cloud/asset/v1beta1/asset_service.proto' + ), protoFilesRoot ); - // 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. @@ -157,10 +160,7 @@ class AssetServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. - var assetServiceStubMethods = [ - 'exportAssets', - 'batchGetAssetsHistory', - ]; + var assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; for (let methodName of assetServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( assetServiceStub.then( @@ -195,9 +195,7 @@ class AssetServiceClient { * in this service. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } /** @@ -417,7 +415,11 @@ class AssetServiceClient { } options = options || {}; - return this._innerApiCalls.batchGetAssetsHistory(request, options, callback); + return this._innerApiCalls.batchGetAssetsHistory( + request, + options, + callback + ); } // -------------------- @@ -444,11 +446,8 @@ class AssetServiceClient { * @returns {String} - A string representing the project. */ matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate - .match(projectName) - .project; + return this._pathTemplates.projectPathTemplate.match(projectName).project; } } - module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index 5adeca94880..5fdcecf0d49 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -44,17 +44,24 @@ describe('AssetServiceClient', () => { var expectedResponse = {}; // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod(request, expectedResponse); + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + expectedResponse + ); - client.exportAssets(request).then(responses => { - var operation = responses[0]; - return operation.promise(); - }).then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }).catch(err => { - done(err); - }); + client + .exportAssets(request) + .then(responses => { + var operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); }); it('invokes exportAssets with error', done => { @@ -74,18 +81,26 @@ describe('AssetServiceClient', () => { }; // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod(request, null, error); - - client.exportAssets(request).then(responses => { - var operation = responses[0]; - return operation.promise(); - }).then(() => { - assert.fail(); - }).catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .exportAssets(request) + .then(responses => { + var operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); }); it('has longrunning decoder functions', () => { @@ -93,8 +108,14 @@ describe('AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - assert(client._descriptors.longrunning.exportAssets.responseDecoder instanceof Function); - assert(client._descriptors.longrunning.exportAssets.metadataDecoder instanceof Function); + assert( + client._descriptors.longrunning.exportAssets.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.exportAssets.metadataDecoder instanceof + Function + ); }); }); @@ -166,7 +187,6 @@ describe('AssetServiceClient', () => { }); }); }); - }); function mockSimpleGrpcMethod(expectedRequest, response, error) { @@ -190,12 +210,11 @@ function mockLongRunningGrpcMethod(expectedRequest, response, error) { return new Promise((resolve, reject) => { if (error) { reject(error); - } - else { + } else { resolve([response]); } }); - } + }, }; return Promise.resolve([mockOperation]); }; From 59565e4bb23cbe88cc900b31f303218f22ba9a2b Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:29:53 -0700 Subject: [PATCH 013/429] make eslint pass --- packages/google-cloud-asset/samples/quickstart.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 04ca2353c69..88ca9ff5add 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -19,4 +19,10 @@ // Imports the Google Cloud client library const asset = require('@google-cloud/asset'); +// eslint-disable-next-line +const client = new asset.AssetServiceClient({ + projectId: 'your-project-id', + keyFilename: '/path/to/keyfile.json', +}); + // [END asset_quickstart] From 4debd2e22399d137e2595e0c8bbf7727b03bf65d Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:33:50 -0700 Subject: [PATCH 014/429] run synthtool@0.5.0 --- packages/google-cloud-asset/.jsdoc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 3fbebfd18bd..9e32e521370 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -39,7 +39,7 @@ module.exports = { copyright: 'Copyright 2018 Google, LLC.', includeDate: false, sourceFiles: false, - systemName: 'asset', + systemName: '@google-cloud/asset', theme: 'lumen' } }; From 74a2ae376c1594ad2771231a5e36c369aac5ff35 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:38:41 -0700 Subject: [PATCH 015/429] refresh scaffolding --- packages/google-cloud-asset/.gitignore | 1 - packages/google-cloud-asset/.jsdoc.js | 4 +- packages/google-cloud-asset/README.md | 109 ++++++++++++++++++----- packages/google-cloud-asset/package.json | 37 ++++---- 4 files changed, 107 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index b895f87eb0b..5b265aef806 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -8,7 +8,6 @@ build/ system-test/secrets.js system-test/*key.json *.lock -**/package-lock.json .DS_Store google-cloud-logging-winston-*.tgz google-cloud-logging-bunyan-*.tgz diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 9e32e521370..4abc6bc70b1 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -1,5 +1,5 @@ /*! - * Copyright 2018 Google LLC. All Rights Reserved. + * Copyright 2017 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2017 Google, Inc.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/asset', diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 4369a07b2a2..188f7a77121 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -1,31 +1,92 @@ -# Node.js Client for Cloud Asset API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-node#versioning)) +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `npm run generate-scaffolding`." +Google Cloud Platform logo -[Cloud Asset API][Product Documentation]: -The cloud asset API manages the history and inventory of cloud resources. -- [Client Library Documentation][] -- [Product Documentation][] +# [Google Cloud Asset API: Node.js Client](https://github.com/googleapis/nodejs-asset) -## Quick Start -In order to use this library, you first need to go through the following -steps: +[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-asset.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-asset) +[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-asset?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-asset) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -3. [Enable the Cloud Asset API.](https://console.cloud.google.com/apis/library/cloudasset.googleapis.com) -4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/master/guides/authentication) +The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history and inventory of cloud resources. + + +* [Using the client library](#using-the-client-library) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Using the client library + +1. [Select or create a Cloud Platform project][projects]. + +1. [Enable billing for your project][billing]. + +1. [Enable the Google Cloud Asset API API][enable_api]. + +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +1. Install the client library: + + npm install --save @google-cloud/asset + +1. Try an example: + +```javascript +// Imports the Google Cloud client library +const asset = require('@google-cloud/asset'); + +// eslint-disable-next-line +const client = new asset.AssetServiceClient({ + projectId: 'your-project-id', + keyFilename: '/path/to/keyfile.json', +}); -### Installation -``` -$ npm install --save asset ``` -### Next Steps -- Read the [Client Library Documentation][] for Cloud Asset API - to see other available methods on the client. -- Read the [Cloud Asset API Product documentation][Product Documentation] - to learn more about the product and see How-to Guides. -- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/README.md) - to see the full list of Cloud APIs that we cover. -[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/cloudasset -[Product Documentation]: https://cloud.google.com/cloudasset \ No newline at end of file +The [Cloud Asset API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +This library is considered to be in **alpha**. 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] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/blob/master/.github/CONTRIBUTING.md). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) + +## What's Next + +* [Cloud Asset API Documentation][product-docs] +* [Cloud Asset API Node.js Client API Reference][client-docs] +* [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset) + +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 + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/ +[product-docs]: https://cloud.google.com/asset/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=asset.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 18787838b61..c4713853a1d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,9 +1,13 @@ { - "repository": "googleapis/nodejs-asset", "name": "@google-cloud/asset", + "description": "Cloud Asset API client for Node.js", "version": "0.1.0", + "license": "Apache-2.0", "author": "Google LLC", - "description": "Cloud Asset API client for Node.js", + "engines": { + "node": ">=6.0.0" + }, + "repository": "googleapis/nodejs-asset", "main": "src/index.js", "files": [ "protos", @@ -24,6 +28,20 @@ "cloudasset", "Cloud Asset API" ], + "contributors": [ + "Jonathan Lui " + ], + "scripts": { + "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", + "docs": "jsdoc -c .jsdoc.js", + "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", + "lint": "eslint src/ samples/ system-test/ test/", + "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", + "test-no-cover": "mocha test/*.js", + "test": "npm run cover" + }, "dependencies": { "google-gax": "^0.17.1", "lodash.merge": "^4.6.0", @@ -44,20 +62,5 @@ "power-assert": "^1.6.0", "prettier": "^1.13.7", "through2": "^2.0.3" - }, - "scripts": { - "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", - "docs": "jsdoc -c .jsdoc.js", - "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint src/ samples/ system-test/ test/", - "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", - "test-no-cover": "mocha test/*.js", - "test": "npm run cover" - }, - "license": "Apache-2.0", - "engines": { - "node": ">=6.0.0" } } From 3a55a71e9290586f93d464eea8493e071cd2574b Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 24 Aug 2018 17:39:13 -0700 Subject: [PATCH 016/429] gitignore package-lock.json --- packages/google-cloud-asset/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index 5b265aef806..b895f87eb0b 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -8,6 +8,7 @@ build/ system-test/secrets.js system-test/*key.json *.lock +**/package-lock.json .DS_Store google-cloud-logging-winston-*.tgz google-cloud-logging-bunyan-*.tgz From 43c5b467356cf10b5ea67d74dc85d8e4a908bf43 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 28 Aug 2018 08:01:01 -0700 Subject: [PATCH 017/429] Update dependency nyc to v13 (#4) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c4713853a1d..849020a4981 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -58,7 +58,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.2.0", - "nyc": "^12.0.2", + "nyc": "^13.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7", "through2": "^2.0.3" From a7102054a659609f0d87283f04330618ea376ca0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 30 Aug 2018 07:35:28 -0700 Subject: [PATCH 018/429] Update dependency google-gax to ^0.19.0 (#3) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 849020a4981..aaf9798972b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -43,7 +43,7 @@ "test": "npm run cover" }, "dependencies": { - "google-gax": "^0.17.1", + "google-gax": "^0.19.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From a481442f6c2c67b85437e6ff15357373fd459929 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 4 Sep 2018 10:57:10 -0700 Subject: [PATCH 019/429] Retry npm install in CI (#7) --- .../google-cloud-asset/.circleci/config.yml | 29 +++++---- .../.circleci/npm-install-retry.js | 60 +++++++++++++++++++ 2 files changed, 79 insertions(+), 10 deletions(-) create mode 100755 packages/google-cloud-asset/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml index 41c82336dbb..80dcf7e67d9 100644 --- a/packages/google-cloud-asset/.circleci/config.yml +++ b/packages/google-cloud-asset/.circleci/config.yml @@ -64,7 +64,7 @@ jobs: name: Install and link the module command: |- mkdir -p /home/node/.npm-global - npm install + ./.circleci/npm-install-retry.js environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: npm test @@ -92,7 +92,7 @@ jobs: command: | cd samples/ npm link ../ - npm install + ./../.circleci/npm-install-retry.js environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: @@ -107,9 +107,7 @@ jobs: steps: - checkout - run: *npm_install_and_link - - run: - name: Build documentation. - command: npm run docs + - run: npm run docs sample_tests: docker: - image: 'node:8' @@ -119,9 +117,11 @@ jobs: - run: name: Decrypt credentials. command: | - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + openssl aes-256-cbc -d -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + fi - run: *npm_install_and_link - run: *samples_npm_install_and_link - run: @@ -133,7 +133,10 @@ jobs: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Remove unencrypted key. - command: rm .circleci/key.json + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + rm .circleci/key.json + fi when: always working_directory: /home/node/samples/ system_tests: @@ -145,9 +148,11 @@ jobs: - run: name: Decrypt credentials. command: | - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + openssl aes-256-cbc -d -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + fi - run: *npm_install_and_link - run: name: Run system tests. @@ -156,7 +161,10 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json - run: name: Remove unencrypted key. - command: rm .circleci/key.json + command: | + if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then + rm .circleci/key.json + fi when: always publish_npm: docker: @@ -164,5 +172,6 @@ jobs: user: node steps: - checkout - - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' + - run: ./.circleci/npm-install-retry.js + - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - run: npm publish --access=public diff --git a/packages/google-cloud-asset/.circleci/npm-install-retry.js b/packages/google-cloud-asset/.circleci/npm-install-retry.js new file mode 100755 index 00000000000..ae3220d7348 --- /dev/null +++ b/packages/google-cloud-asset/.circleci/npm-install-retry.js @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +let spawn = require('child_process').spawn; + +// +//USE: ./index.js [... NPM ARGS] +// + +let timeout = process.argv[2] || 60000; +let attempts = process.argv[3] || 3; +let args = process.argv.slice(4); +if (args.length === 0) { + args = ['install']; +} + +(function npm() { + let timer; + args.push('--verbose'); + let proc = spawn('npm', args); + proc.stdout.pipe(process.stdout); + proc.stderr.pipe(process.stderr); + proc.stdin.end(); + proc.stdout.on('data', () => { + setTimer(); + }); + proc.stderr.on('data', () => { + setTimer(); + }); + + // side effect: this also restarts when npm exits with a bad code even if it + // didnt timeout + proc.on('close', (code, signal) => { + clearTimeout(timer); + if (code || signal) { + console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); + + if (--attempts) { + console.log('[npm-are-you-sleeping] restarting'); + npm(); + } else { + console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); + throw new Error("npm install fails"); + } + } + }); + + function setTimer() { + clearTimeout(timer); + timer = setTimeout(() => { + console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); + proc.kill('SIGTERM'); + // wait a couple seconds + timer = setTimeout(() => { + // its it's still not closed sigkill + console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); + proc.kill('SIGKILL'); + }, 2000); + }, timeout); + } +})(); From fbefacd6c661da80cf6664b38a1562d3ac7a2e38 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Wed, 5 Sep 2018 11:29:17 -0700 Subject: [PATCH 020/429] update synth.py and run it (#8) * fix synth.py artman config path * synth: sync .kokoro cfgs * synth: generate library * synth: node templates --- .../google-cloud-asset/.circleci/config.yml | 11 ++-- packages/google-cloud-asset/.jsdoc.js | 4 +- .../cloud/asset/v1beta1/asset_service.proto | 45 +++++++------- .../google/cloud/asset/v1beta1/assets.proto | 6 +- .../src/v1beta1/asset_service_client.js | 60 +++++++++---------- .../cloud/asset/v1beta1/doc_asset_service.js | 40 +++++++------ .../google/cloud/asset/v1beta1/doc_assets.js | 3 +- .../v1beta1/doc/google/protobuf/doc_any.js | 21 ++++--- .../doc/google/protobuf/doc_timestamp.js | 8 ++- packages/google-cloud-asset/synth.py | 3 +- .../google-cloud-asset/test/gapic-v1beta1.js | 8 --- 11 files changed, 105 insertions(+), 104 deletions(-) diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml index 80dcf7e67d9..8af6a4d0489 100644 --- a/packages/google-cloud-asset/.circleci/config.yml +++ b/packages/google-cloud-asset/.circleci/config.yml @@ -149,21 +149,24 @@ jobs: name: Decrypt credentials. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + for encrypted_key in .circleci/*.json.enc; do + openssl aes-256-cbc -d -in $encrypted_key \ + -out $(echo $encrypted_key | sed 's/\.enc//') \ + -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" + done fi - run: *npm_install_and_link - run: name: Run system tests. command: npm run system-test environment: + GCLOUD_PROJECT: long-door-651 GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json - run: name: Remove unencrypted key. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json + rm .circleci/*.json fi when: always publish_npm: diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 4abc6bc70b1..9e32e521370 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -1,5 +1,5 @@ /*! - * Copyright 2017 Google Inc. All Rights Reserved. + * Copyright 2018 Google LLC. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2017 Google, Inc.', + copyright: 'Copyright 2018 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/asset', diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto index da859d102f3..b64502f68e4 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // 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"; @@ -32,7 +33,7 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; // Asset service definition. service AssetService { // Exports assets with time and resource types to a given Google Cloud Storage - // location. The output format is newline delimited JSON. + // location. The output format is newline-delimited JSON. // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users // to keep track of the export. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { @@ -63,24 +64,25 @@ service AssetService { // Export asset request. message ExportAssetsRequest { - // Required. The relative name of the root asset. It can only be an - // organization number (e.g. "organizations/123") or a project number - // (e.g. "projects/12345"). + // Required. The relative name of the root asset. Can only be an organization + // number (such as "organizations/123"), or a project id (such as + // "projects/my-project-id") or a project number (such as "projects/12345"). string parent = 1; - // Timestamp to take an asset snapshot. This can only be current or past - // time. If not specified, the current time will be used. Due to delays in - // resource data collection and indexing, there is a volatile window during - // which running the same query may get different results. + // Timestamp to take an asset snapshot. This can only be set to a timestamp in + // the past or of the current time. If not specified, the current time will be + // used. Due to delays in resource data collection and indexing, there is a + // volatile window during which running the same query may get different + // results. google.protobuf.Timestamp read_time = 2; - // A list of asset types to take a snapshot for. Example: + // A list of asset types of which to take a snapshot for. Example: // "google.compute.disk". If specified, only matching assets will be returned. repeated string asset_types = 3; - // A list of asset content types. If specified, only matching content will be - // returned. Otherwise, no content but the asset name will be returned. - repeated ContentType content_types = 4; + // Asset content type. If not specified, no content but the asset name will be + // returned. + ContentType content_type = 4; // Required. Output configuration indicating where the results will be output // to. All results will be in newline delimited JSON format. @@ -91,10 +93,10 @@ message ExportAssetsRequest { // [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned // [google.longrunning.Operation.response][google.longrunning.Operation.response] field. message ExportAssetsResponse { - // Required. Time the snapshot was taken. + // Time the snapshot was taken. google.protobuf.Timestamp read_time = 1; - // Required. Output configuration indicating where the results were output to. + // Output configuration indicating where the results were output to. // All results are in JSON format. OutputConfig output_config = 2; } @@ -102,8 +104,8 @@ message ExportAssetsResponse { // Batch get assets history request. message BatchGetAssetsHistoryRequest { // Required. The relative name of the root asset. It can only be an - // organization ID (e.g. "organizations/123") or a project ID - // (e.g. "projects/12345"). + // organization number (such as "organizations/123"), or a project id (such as + // "projects/my-project-id")"or a project number (such as "projects/12345"). string parent = 1; // A list of the full names of the assets. See: @@ -111,15 +113,16 @@ message BatchGetAssetsHistoryRequest { // Example: // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". // - // The request becomes a no-op if the asset name list is empty. + // The request becomes a no-op if the asset name list is empty, and the max + // size of the asset name list is 100 in one request. repeated string asset_names = 2; // Required. The content type. ContentType content_type = 3; - // Required. The time window for the asset history. The returned results - // contain all temporal assets whose time window overlap with - // read_time_window. + // Required. The time window for the asset history. The start time is + // required. The returned results contain all temporal assets whose time + // window overlap with read_time_window. TimeWindow read_time_window = 4; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto index ca4f144f08a..db270b0879f 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // 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"; @@ -46,11 +47,10 @@ message TemporalAsset { // A time window of [start_time, end_time). message TimeWindow { // Start time of the time window (inclusive). - // Infinite past if not specified. google.protobuf.Timestamp start_time = 1; // End time of the time window (exclusive). - // Infinite future if not specified. + // Current timestamp if not specified. google.protobuf.Timestamp end_time = 2; } diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index cffe3aeb5f0..ce5366704b6 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -213,36 +213,37 @@ class AssetServiceClient { /** * Exports assets with time and resource types to a given Google Cloud Storage - * location. The output format is newline delimited JSON. + * location. The output format is newline-delimited JSON. * This API implements the google.longrunning.Operation API allowing users * to keep track of the export. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The relative name of the root asset. It can only be an - * organization number (e.g. "organizations/123") or a project number - * (e.g. "projects/12345"). - * @param {number[]} request.contentTypes - * A list of asset content types. If specified, only matching content will be - * returned. Otherwise, no content but the asset name will be returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). * @param {Object} request.outputConfig * Required. Output configuration indicating where the results will be output * to. All results will be in newline delimited JSON format. * * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be current or past - * time. If not specified, the current time will be used. Due to delays in - * resource data collection and indexing, there is a volatile window during - * which running the same query may get different results. + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {string[]} [request.assetTypes] - * A list of asset types to take a snapshot for. Example: + * A list of asset types of which to take a snapshot for. Example: * "google.compute.disk". If specified, only matching assets will be returned. + * @param {number} [request.contentType] + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * @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. @@ -263,11 +264,9 @@ class AssetServiceClient { * }); * * var formattedParent = client.projectPath('[PROJECT]'); - * var contentTypes = []; * var outputConfig = {}; * var request = { * parent: formattedParent, - * contentTypes: contentTypes, * outputConfig: outputConfig, * }; * @@ -295,11 +294,9 @@ class AssetServiceClient { * }); * * var formattedParent = client.projectPath('[PROJECT]'); - * var contentTypes = []; * var outputConfig = {}; * var request = { * parent: formattedParent, - * contentTypes: contentTypes, * outputConfig: outputConfig, * }; * @@ -351,25 +348,26 @@ class AssetServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The relative name of the root asset. It can only be an - * organization ID (e.g. "organizations/123") or a project ID - * (e.g. "projects/12345"). - * @param {string[]} request.assetNames - * A list of the full names of the assets. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * Example: - * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". - * - * The request becomes a no-op if the asset name list is empty. + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). * @param {number} request.contentType * Required. The content type. * * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * @param {Object} request.readTimeWindow - * Required. The time window for the asset history. The returned results - * contain all temporal assets whose time window overlap with - * read_time_window. + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. * * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} + * @param {string[]} [request.assetNames] + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. * @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. @@ -390,12 +388,10 @@ class AssetServiceClient { * }); * * var formattedParent = client.projectPath('[PROJECT]'); - * var assetNames = []; * var contentType = 'CONTENT_TYPE_UNSPECIFIED'; * var readTimeWindow = {}; * var request = { * parent: formattedParent, - * assetNames: assetNames, * contentType: contentType, * readTimeWindow: readTimeWindow, * }; diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js index 68ab69d4ef8..b6f25fb1716 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -19,25 +19,26 @@ * Export asset request. * * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (e.g. "organizations/123") or a project number - * (e.g. "projects/12345"). + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). * * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be current or past - * time. If not specified, the current time will be used. Due to delays in - * resource data collection and indexing, there is a volatile window during - * which running the same query may get different results. + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {string[]} assetTypes - * A list of asset types to take a snapshot for. Example: + * A list of asset types of which to take a snapshot for. Example: * "google.compute.disk". If specified, only matching assets will be returned. * - * @property {number[]} contentTypes - * A list of asset content types. If specified, only matching content will be - * returned. Otherwise, no content but the asset name will be returned. + * @property {number} contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. * * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * @@ -61,12 +62,12 @@ var ExportAssetsRequest = { * google.longrunning.Operation.response field. * * @property {Object} readTime - * Required. Time the snapshot was taken. + * Time the snapshot was taken. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {Object} outputConfig - * Required. Output configuration indicating where the results were output to. + * Output configuration indicating where the results were output to. * All results are in JSON format. * * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} @@ -84,8 +85,8 @@ var ExportAssetsResponse = { * * @property {string} parent * Required. The relative name of the root asset. It can only be an - * organization ID (e.g. "organizations/123") or a project ID - * (e.g. "projects/12345"). + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). * * @property {string[]} assetNames * A list of the full names of the assets. See: @@ -93,7 +94,8 @@ var ExportAssetsResponse = { * Example: * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". * - * The request becomes a no-op if the asset name list is empty. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. * * @property {number} contentType * Required. The content type. @@ -101,9 +103,9 @@ var ExportAssetsResponse = { * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * * @property {Object} readTimeWindow - * Required. The time window for the asset history. The returned results - * contain all temporal assets whose time window overlap with - * read_time_window. + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. * * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} * diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index dc45bc0ad0f..7214e6518fb 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -45,13 +45,12 @@ var TemporalAsset = { * * @property {Object} startTime * Start time of the time window (inclusive). - * Infinite past if not specified. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {Object} endTime * End time of the time window (exclusive). - * Infinite future if not specified. + * Current timestamp if not specified. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js index f55fa17ff12..c5c5bbafa23 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -97,17 +97,18 @@ * } * * @property {string} typeUrl - * A URL/resource name whose content describes the type of the - * serialized protocol buffer message. + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). * - * For URLs which use the scheme `http`, `https`, or no scheme, the - * following restrictions and interpretations apply: + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: * * * If no scheme is provided, `https` is assumed. - * * The last segment of the URL's path must represent the fully - * qualified name of the type (as in `path/google.protobuf.Duration`). - * The name should be in a canonical form (e.g., leading "." is - * not accepted). * * An HTTP GET on the URL must yield a google.protobuf.Type * value in binary format, or produce an error. * * Applications are allowed to cache lookup results based on the @@ -116,6 +117,10 @@ * on changes to types. (Use versioned type names to manage * breaking changes.) * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index a02db52bdeb..51d8f40f54d 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -79,7 +79,9 @@ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required, though only UTC (as indicated by "Z") is presently supported. + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). * * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past * 01:30 UTC on January 15, 2017. @@ -90,8 +92,8 @@ * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) - * to obtain a formatter capable of generating timestamps in this format. + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- + * ) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index b274b946b05..60354eebace 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -27,7 +27,7 @@ library = gapic.node_library( 'asset', version, config_path="artman_cloudasset_v1beta1.yaml", - artman_output_name=f"cloudasset-{version}") + artman_output_name=f"asset-{version}") s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) @@ -39,4 +39,3 @@ ''' subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'prettier']) -subprocess.run(['npm', 'run', 'lint']) diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index 5fdcecf0d49..f8d582d11be 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -32,11 +32,9 @@ describe('AssetServiceClient', () => { // Mock request var formattedParent = client.projectPath('[PROJECT]'); - var contentTypes = []; var outputConfig = {}; var request = { parent: formattedParent, - contentTypes: contentTypes, outputConfig: outputConfig, }; @@ -72,11 +70,9 @@ describe('AssetServiceClient', () => { // Mock request var formattedParent = client.projectPath('[PROJECT]'); - var contentTypes = []; var outputConfig = {}; var request = { parent: formattedParent, - contentTypes: contentTypes, outputConfig: outputConfig, }; @@ -128,12 +124,10 @@ describe('AssetServiceClient', () => { // Mock request var formattedParent = client.projectPath('[PROJECT]'); - var assetNames = []; var contentType = 'CONTENT_TYPE_UNSPECIFIED'; var readTimeWindow = {}; var request = { parent: formattedParent, - assetNames: assetNames, contentType: contentType, readTimeWindow: readTimeWindow, }; @@ -162,12 +156,10 @@ describe('AssetServiceClient', () => { // Mock request var formattedParent = client.projectPath('[PROJECT]'); - var assetNames = []; var contentType = 'CONTENT_TYPE_UNSPECIFIED'; var readTimeWindow = {}; var request = { parent: formattedParent, - assetNames: assetNames, contentType: contentType, readTimeWindow: readTimeWindow, }; From 2d18dd69c30f94a50f93ad265d8794845d97863c Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Sep 2018 18:59:50 -0700 Subject: [PATCH 021/429] add system test key (#11) --- .../google-cloud-asset/.circleci/key.json.enc | Bin 0 -> 2352 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/google-cloud-asset/.circleci/key.json.enc diff --git a/packages/google-cloud-asset/.circleci/key.json.enc b/packages/google-cloud-asset/.circleci/key.json.enc new file mode 100644 index 0000000000000000000000000000000000000000..341784e163234c6f3d082c356c803d95f67f3c21 GIT binary patch literal 2352 zcmV-03D5RZVQh3|WM5xC+dsrL^Vz4CWC0sJ!T6LRAeF~$gcxK{^KpNl-;U**2?qYe8D-YEaKHB6{xQBghoAlq%4)|#H@r#oB`DJdXgtX z)an?%G4oNqzmQ1}lEhTi050Wi_)7v=))E9rI=p4&KU-*XH5CswB8?c%h-(eym^DPw z%)EDkNzb5?4Pv$kaXBi0JvX{fr$di;WaDd|F2qk6JTLSWdwOMX0uSMMOOOy<3Gq9a zX$Z6yyhBQ|t)k1!Z~;yLFNi%O1%00w5FcuFEHWa!WL9WJkC^OTd4zayqcD-m{8(y4 zOQeO==4P-QdI0HoVC;MAmzFQ)|7e`^0xdJa>YA>+NW+30p+k4v1d3!Af?H&j%xi6gPOnDq8!CG-=PbHhC4A?j(vj-goJWWEW1jyHx2 zA!c=`f^8QhdNZ|@K-pioa3tdF6 zV4x>5#g|E$*9)*juWB+^asMb<_m+7osL%?4k+ z!XYgLWbSygpZP;WmW+I^bRP_zDvEy?Emg0%uNJvU{d3Y5I^+S9!b18fLoyR8P9LxD2Vs^n3g={O)2XaQX)&(qTTsB(fLml(Yz=_CxxJygsP z57SxGaNGaDZbfkl6J$J)?b*`cOV@nQ)Wt6G5%fk2i5f-O74I{F@*pOeV=#E~_^5v> zVicSOR)PJ0(xzGFZbT!ZyD-gEH|${1ph=e{wZLgK7M(QMZw+Md5(Ilj8I0w9r<7*M zd>zP>%Ixm+Fm8_i(F*>4bt|B$^H|6A|E^wY!V$bW{5?Uc1@xDDjQ^S^FCi!S19rE7 z;ImSsJlb(GpJPD=sqtSekcCFWrU=fYX}z>z7G!O0W0Tb4$)}jo+Xi;No%k?U_f~A& z11XkOuIz7AnAz*FkNI5P-iSAm?|zU|rF*gj(3YA*e?i!_2W7_JSq65nqpgv(!zsM> zsDXIPZX2a_6rGw4WNj2`>^An|6)_v`l&UZXL-$7pE5iZ$khu--VCSOl-`$n^IKwVa z-1{7;20X02I&472ovW{c0#da`Y8{PY3mpLm#{V{QqO~-AF6C5Q=)AaG02WtNK%*!O zmBx@>hYgVUL_@!!C=UawX>L3MXrYXsn)AGp=w_wdGFm#D28zb>9x%F-Hfe%)Q(Sd;zTaFPE>(*1J6(e0)F~L zoo!}>uU0FCgU$~Tn#P#G+uRO;p&|Wtl}}q2s5_rrC~dyhVe$AY3t4a!IV3!pz^Mxh zFzMjaQj&pw{)wP#hpat9PzP;~2Ant`K2&;#8x;sjp*CAClSioGURE*jgGLxN(j!L~ zK1i4(_M5n(foV@8tFBgM0f^+q8m1d{g^BS)jP}mPH!Pq{3VuLv+T(MBvp=(+cDf=z zh~=G)NP(a2mN}e<5J`}x< z5omGP!Kyqp)P2;>qQjd7<6tT&E|G?N?nqyQ% z4(^*jMVqV`L%Xflmd9FPpv{AVzn6Vbyesk|Ph@8E`bxJRh=Po+A6ApI6-_^grIv@)Qh

O+CDgC%8#7rudA%szi#$h6m}+lDNnc7#Ib9?CY%AaC}-XV`?ml6iph!PkrI)P?wRu=rMZ0tvp} zyz7oJj-J6yi=&M(;+78){b;}|eEo*%virh(I(7q>zV$`;)oDG4TlC5GHXC*8j-7MIkmzMRyZ`?9dF(?>PE Date: Thu, 13 Sep 2018 06:47:38 -0700 Subject: [PATCH 022/429] Update dependency google-gax to ^0.20.0 (#12) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index aaf9798972b..c02319e5603 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -43,7 +43,7 @@ "test": "npm run cover" }, "dependencies": { - "google-gax": "^0.19.0", + "google-gax": "^0.20.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From bec5e73b249d0e6cca377f36c77eca7b28d3490a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 18 Sep 2018 10:53:12 -0700 Subject: [PATCH 023/429] Enable no-var in eslint (#13) --- packages/google-cloud-asset/.eslintrc.yml | 1 + .../src/v1beta1/asset_service_client.js | 20 +++---- .../google-cloud-asset/test/gapic-v1beta1.js | 52 +++++++++---------- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/packages/google-cloud-asset/.eslintrc.yml b/packages/google-cloud-asset/.eslintrc.yml index bed57fbc42c..65f1dce6c0c 100644 --- a/packages/google-cloud-asset/.eslintrc.yml +++ b/packages/google-cloud-asset/.eslintrc.yml @@ -11,3 +11,4 @@ rules: block-scoped-var: error eqeqeq: error no-warning-comments: warn + no-var: error diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index ce5366704b6..133720b41d2 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -72,13 +72,13 @@ class AssetServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - var gaxGrpc = new gax.GrpcClient(opts); + let gaxGrpc = new gax.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - var clientHeader = [ + let clientHeader = [ `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, @@ -89,7 +89,7 @@ class AssetServiceClient { } // Load the applicable protos. - var protos = merge( + let protos = merge( {}, gaxGrpc.loadProto( path.join(__dirname, '..', '..', 'protos'), @@ -103,7 +103,7 @@ class AssetServiceClient { this._pathTemplates = { projectPathTemplate: new gax.PathTemplate('projects/{project}'), }; - var protoFilesRoot = new gax.GoogleProtoFilesRoot(); + let protoFilesRoot = new gax.GoogleProtoFilesRoot(); protoFilesRoot = protobuf.loadSync( path.join( __dirname, @@ -123,10 +123,10 @@ class AssetServiceClient { grpc: gaxGrpc.grpc, }).operationsClient(opts); - var exportAssetsResponse = protoFilesRoot.lookup( + let exportAssetsResponse = protoFilesRoot.lookup( 'google.cloud.asset.v1beta1.ExportAssetsResponse' ); - var exportAssetsMetadata = protoFilesRoot.lookup( + let exportAssetsMetadata = protoFilesRoot.lookup( 'google.cloud.asset.v1beta1.ExportAssetsRequest' ); @@ -139,7 +139,7 @@ class AssetServiceClient { }; // Put together the default options sent with requests. - var defaults = gaxGrpc.constructSettings( + let defaults = gaxGrpc.constructSettings( 'google.cloud.asset.v1beta1.AssetService', gapicConfig, opts.clientConfig, @@ -153,20 +153,20 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1beta1.AssetService. - var assetServiceStub = gaxGrpc.createStub( + let assetServiceStub = gaxGrpc.createStub( protos.google.cloud.asset.v1beta1.AssetService, opts ); // Iterate over each of the methods that the service provides // and create an API call method for each. - var assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; + let assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; for (let methodName of assetServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( assetServiceStub.then( stub => function() { - var args = Array.prototype.slice.call(arguments, 0); + let args = Array.prototype.slice.call(arguments, 0); return stub[methodName].apply(stub, args); } ), diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index f8d582d11be..8c9e45e0685 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -18,28 +18,28 @@ const assert = require('assert'); const assetModule = require('../src'); -var FAKE_STATUS_CODE = 1; -var error = new Error(); +let FAKE_STATUS_CODE = 1; +let error = new Error(); error.code = FAKE_STATUS_CODE; describe('AssetServiceClient', () => { describe('exportAssets', function() { it('invokes exportAssets without error', done => { - var client = new assetModule.v1beta1.AssetServiceClient({ + let client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - var formattedParent = client.projectPath('[PROJECT]'); - var outputConfig = {}; - var request = { + let formattedParent = client.projectPath('[PROJECT]'); + let outputConfig = {}; + let request = { parent: formattedParent, outputConfig: outputConfig, }; // Mock response - var expectedResponse = {}; + let expectedResponse = {}; // Mock Grpc layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( @@ -50,7 +50,7 @@ describe('AssetServiceClient', () => { client .exportAssets(request) .then(responses => { - var operation = responses[0]; + let operation = responses[0]; return operation.promise(); }) .then(responses => { @@ -63,15 +63,15 @@ describe('AssetServiceClient', () => { }); it('invokes exportAssets with error', done => { - var client = new assetModule.v1beta1.AssetServiceClient({ + let client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - var formattedParent = client.projectPath('[PROJECT]'); - var outputConfig = {}; - var request = { + let formattedParent = client.projectPath('[PROJECT]'); + let outputConfig = {}; + let request = { parent: formattedParent, outputConfig: outputConfig, }; @@ -86,7 +86,7 @@ describe('AssetServiceClient', () => { client .exportAssets(request) .then(responses => { - var operation = responses[0]; + let operation = responses[0]; return operation.promise(); }) .then(() => { @@ -100,7 +100,7 @@ describe('AssetServiceClient', () => { }); it('has longrunning decoder functions', () => { - var client = new assetModule.v1beta1.AssetServiceClient({ + let client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -117,23 +117,23 @@ describe('AssetServiceClient', () => { describe('batchGetAssetsHistory', () => { it('invokes batchGetAssetsHistory without error', done => { - var client = new assetModule.v1beta1.AssetServiceClient({ + let client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - var formattedParent = client.projectPath('[PROJECT]'); - var contentType = 'CONTENT_TYPE_UNSPECIFIED'; - var readTimeWindow = {}; - var request = { + let formattedParent = client.projectPath('[PROJECT]'); + let contentType = 'CONTENT_TYPE_UNSPECIFIED'; + let readTimeWindow = {}; + let request = { parent: formattedParent, contentType: contentType, readTimeWindow: readTimeWindow, }; // Mock response - var expectedResponse = {}; + let expectedResponse = {}; // Mock Grpc layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( @@ -149,16 +149,16 @@ describe('AssetServiceClient', () => { }); it('invokes batchGetAssetsHistory with error', done => { - var client = new assetModule.v1beta1.AssetServiceClient({ + let client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - var formattedParent = client.projectPath('[PROJECT]'); - var contentType = 'CONTENT_TYPE_UNSPECIFIED'; - var readTimeWindow = {}; - var request = { + let formattedParent = client.projectPath('[PROJECT]'); + let contentType = 'CONTENT_TYPE_UNSPECIFIED'; + let readTimeWindow = {}; + let request = { parent: formattedParent, contentType: contentType, readTimeWindow: readTimeWindow, @@ -197,7 +197,7 @@ function mockSimpleGrpcMethod(expectedRequest, response, error) { function mockLongRunningGrpcMethod(expectedRequest, response, error) { return request => { assert.deepStrictEqual(request, expectedRequest); - var mockOperation = { + let mockOperation = { promise: function() { return new Promise((resolve, reject) => { if (error) { From 967787688ebc47a8455be64adab699c4adaf0588 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 18 Sep 2018 13:39:27 -0700 Subject: [PATCH 024/429] Release v0.1.0 (#14) --- packages/google-cloud-asset/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 packages/google-cloud-asset/CHANGELOG.md diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md new file mode 100644 index 00000000000..e786fae203b --- /dev/null +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions + +## v0.1.0 + +Initial release of the Cloud Asset API. + From 0530daed716d78045e6b2662f2ecd2966464ae11 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 20 Sep 2018 12:31:28 -0700 Subject: [PATCH 025/429] Enable prefer-const in the eslint config (#15) --- packages/google-cloud-asset/.eslintrc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-asset/.eslintrc.yml b/packages/google-cloud-asset/.eslintrc.yml index 65f1dce6c0c..73eeec27612 100644 --- a/packages/google-cloud-asset/.eslintrc.yml +++ b/packages/google-cloud-asset/.eslintrc.yml @@ -12,3 +12,4 @@ rules: eqeqeq: error no-warning-comments: warn no-var: error + prefer-const: error From 8630d23a689d467f71b3dc6deab4e0231545c970 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 20 Sep 2018 18:19:04 -0700 Subject: [PATCH 026/429] Fix the linter (#16) --- packages/google-cloud-asset/package.json | 3 +- .../src/v1beta1/asset_service_client.js | 20 +++---- .../google-cloud-asset/test/gapic-v1beta1.js | 52 +++++++++---------- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c02319e5603..269518b39cc 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -40,7 +40,8 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", - "test": "npm run cover" + "test": "npm run cover", + "fix": "eslint --fix '**/*.js' && npm run prettier" }, "dependencies": { "google-gax": "^0.20.0", diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 133720b41d2..c1c1fd40b2e 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -72,13 +72,13 @@ class AssetServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - let gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gax.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - let clientHeader = [ + const clientHeader = [ `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, @@ -89,7 +89,7 @@ class AssetServiceClient { } // Load the applicable protos. - let protos = merge( + const protos = merge( {}, gaxGrpc.loadProto( path.join(__dirname, '..', '..', 'protos'), @@ -123,10 +123,10 @@ class AssetServiceClient { grpc: gaxGrpc.grpc, }).operationsClient(opts); - let exportAssetsResponse = protoFilesRoot.lookup( + const exportAssetsResponse = protoFilesRoot.lookup( 'google.cloud.asset.v1beta1.ExportAssetsResponse' ); - let exportAssetsMetadata = protoFilesRoot.lookup( + const exportAssetsMetadata = protoFilesRoot.lookup( 'google.cloud.asset.v1beta1.ExportAssetsRequest' ); @@ -139,7 +139,7 @@ class AssetServiceClient { }; // Put together the default options sent with requests. - let defaults = gaxGrpc.constructSettings( + const defaults = gaxGrpc.constructSettings( 'google.cloud.asset.v1beta1.AssetService', gapicConfig, opts.clientConfig, @@ -153,20 +153,20 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1beta1.AssetService. - let assetServiceStub = gaxGrpc.createStub( + const assetServiceStub = gaxGrpc.createStub( protos.google.cloud.asset.v1beta1.AssetService, opts ); // Iterate over each of the methods that the service provides // and create an API call method for each. - let assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; - for (let methodName of assetServiceStubMethods) { + const assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; + for (const methodName of assetServiceStubMethods) { this._innerApiCalls[methodName] = gax.createApiCall( assetServiceStub.then( stub => function() { - let args = Array.prototype.slice.call(arguments, 0); + const args = Array.prototype.slice.call(arguments, 0); return stub[methodName].apply(stub, args); } ), diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index 8c9e45e0685..64614d4cbf6 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -18,28 +18,28 @@ const assert = require('assert'); const assetModule = require('../src'); -let FAKE_STATUS_CODE = 1; -let error = new Error(); +const FAKE_STATUS_CODE = 1; +const error = new Error(); error.code = FAKE_STATUS_CODE; describe('AssetServiceClient', () => { describe('exportAssets', function() { it('invokes exportAssets without error', done => { - let client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - let formattedParent = client.projectPath('[PROJECT]'); - let outputConfig = {}; - let request = { + const formattedParent = client.projectPath('[PROJECT]'); + const outputConfig = {}; + const request = { parent: formattedParent, outputConfig: outputConfig, }; // Mock response - let expectedResponse = {}; + const expectedResponse = {}; // Mock Grpc layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( @@ -50,7 +50,7 @@ describe('AssetServiceClient', () => { client .exportAssets(request) .then(responses => { - let operation = responses[0]; + const operation = responses[0]; return operation.promise(); }) .then(responses => { @@ -63,15 +63,15 @@ describe('AssetServiceClient', () => { }); it('invokes exportAssets with error', done => { - let client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - let formattedParent = client.projectPath('[PROJECT]'); - let outputConfig = {}; - let request = { + const formattedParent = client.projectPath('[PROJECT]'); + const outputConfig = {}; + const request = { parent: formattedParent, outputConfig: outputConfig, }; @@ -86,7 +86,7 @@ describe('AssetServiceClient', () => { client .exportAssets(request) .then(responses => { - let operation = responses[0]; + const operation = responses[0]; return operation.promise(); }) .then(() => { @@ -100,7 +100,7 @@ describe('AssetServiceClient', () => { }); it('has longrunning decoder functions', () => { - let client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -117,23 +117,23 @@ describe('AssetServiceClient', () => { describe('batchGetAssetsHistory', () => { it('invokes batchGetAssetsHistory without error', done => { - let client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - let formattedParent = client.projectPath('[PROJECT]'); - let contentType = 'CONTENT_TYPE_UNSPECIFIED'; - let readTimeWindow = {}; - let request = { + const formattedParent = client.projectPath('[PROJECT]'); + const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + const readTimeWindow = {}; + const request = { parent: formattedParent, contentType: contentType, readTimeWindow: readTimeWindow, }; // Mock response - let expectedResponse = {}; + const expectedResponse = {}; // Mock Grpc layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( @@ -149,16 +149,16 @@ describe('AssetServiceClient', () => { }); it('invokes batchGetAssetsHistory with error', done => { - let client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - let formattedParent = client.projectPath('[PROJECT]'); - let contentType = 'CONTENT_TYPE_UNSPECIFIED'; - let readTimeWindow = {}; - let request = { + const formattedParent = client.projectPath('[PROJECT]'); + const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + const readTimeWindow = {}; + const request = { parent: formattedParent, contentType: contentType, readTimeWindow: readTimeWindow, @@ -197,7 +197,7 @@ function mockSimpleGrpcMethod(expectedRequest, response, error) { function mockLongRunningGrpcMethod(expectedRequest, response, error) { return request => { assert.deepStrictEqual(request, expectedRequest); - let mockOperation = { + const mockOperation = { promise: function() { return new Promise((resolve, reject) => { if (error) { From c6b5a945651ffe0683e053d39566c1b65e6a09c6 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 24 Sep 2018 17:02:15 -0700 Subject: [PATCH 027/429] test: remove appveyor config (#17) --- packages/google-cloud-asset/.appveyor.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 packages/google-cloud-asset/.appveyor.yml diff --git a/packages/google-cloud-asset/.appveyor.yml b/packages/google-cloud-asset/.appveyor.yml deleted file mode 100644 index 24082152655..00000000000 --- a/packages/google-cloud-asset/.appveyor.yml +++ /dev/null @@ -1,20 +0,0 @@ -environment: - matrix: - - nodejs_version: 8 - -install: - - ps: Install-Product node $env:nodejs_version - - npm install -g npm # Force using the latest npm to get dedupe during install - - set PATH=%APPDATA%\npm;%PATH% - - npm install --force --ignore-scripts - -test_script: - - node --version - - npm --version - - npm rebuild - - npm test - -build: off - -matrix: - fast_finish: true From 12b1f55f69a82f10bc42ce70bc53095039b1ffdf Mon Sep 17 00:00:00 2001 From: DPE bot Date: Thu, 27 Sep 2018 08:55:19 -0700 Subject: [PATCH 028/429] Update CI config and move to const (#19) --- .../.circleci/npm-install-retry.js | 2 +- .../src/v1beta1/asset_service_client.js | 40 +++++++++---------- .../cloud/asset/v1beta1/doc_asset_service.js | 14 +++---- .../google/cloud/asset/v1beta1/doc_assets.js | 8 ++-- .../v1beta1/doc/google/iam/v1/doc_policy.js | 8 ++-- .../doc/google/longrunning/doc_operations.js | 12 +++--- .../v1beta1/doc/google/protobuf/doc_any.js | 2 +- .../v1beta1/doc/google/protobuf/doc_struct.js | 8 ++-- .../doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1beta1/doc/google/rpc/doc_status.js | 2 +- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/packages/google-cloud-asset/.circleci/npm-install-retry.js b/packages/google-cloud-asset/.circleci/npm-install-retry.js index ae3220d7348..3240aa2cbf2 100755 --- a/packages/google-cloud-asset/.circleci/npm-install-retry.js +++ b/packages/google-cloud-asset/.circleci/npm-install-retry.js @@ -6,7 +6,7 @@ let spawn = require('child_process').spawn; //USE: ./index.js [... NPM ARGS] // -let timeout = process.argv[2] || 60000; +let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; let attempts = process.argv[3] || 3; let args = process.argv.slice(4); if (args.length === 0) { diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index c1c1fd40b2e..9a7efa6df3d 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -259,13 +259,13 @@ class AssetServiceClient { * * const asset = require('asset.v1beta1'); * - * var client = new asset.v1beta1.AssetServiceClient({ + * const client = new asset.v1beta1.AssetServiceClient({ * // optional auth parameters. * }); * - * var formattedParent = client.projectPath('[PROJECT]'); - * var outputConfig = {}; - * var request = { + * const formattedParent = client.projectPath('[PROJECT]'); + * const outputConfig = {}; + * const request = { * parent: formattedParent, * outputConfig: outputConfig, * }; @@ -273,29 +273,29 @@ class AssetServiceClient { * // Handle the operation using the promise pattern. * client.exportAssets(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const operation = responses[0]; + * const initialApiResponse = responses[1]; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { * // The final result of the operation. - * var result = responses[0]; + * const result = responses[0]; * * // The metadata value of the completed operation. - * var metadata = responses[1]; + * const metadata = responses[1]; * * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var formattedParent = client.projectPath('[PROJECT]'); - * var outputConfig = {}; - * var request = { + * const formattedParent = client.projectPath('[PROJECT]'); + * const outputConfig = {}; + * const request = { * parent: formattedParent, * outputConfig: outputConfig, * }; @@ -303,8 +303,8 @@ class AssetServiceClient { * // Handle the operation using the event emitter pattern. * client.exportAssets(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const operation = responses[0]; + * const initialApiResponse = responses[1]; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -383,21 +383,21 @@ class AssetServiceClient { * * const asset = require('asset.v1beta1'); * - * var client = new asset.v1beta1.AssetServiceClient({ + * const client = new asset.v1beta1.AssetServiceClient({ * // optional auth parameters. * }); * - * var formattedParent = client.projectPath('[PROJECT]'); - * var contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * var readTimeWindow = {}; - * var request = { + * const formattedParent = client.projectPath('[PROJECT]'); + * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + * const readTimeWindow = {}; + * const request = { * parent: formattedParent, * contentType: contentType, * readTimeWindow: readTimeWindow, * }; * client.batchGetAssetsHistory(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js index b6f25fb1716..93a2fb93b62 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -52,7 +52,7 @@ * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} */ -var ExportAssetsRequest = { +const ExportAssetsRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -76,7 +76,7 @@ var ExportAssetsRequest = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} */ -var ExportAssetsResponse = { +const ExportAssetsResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -113,7 +113,7 @@ var ExportAssetsResponse = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} */ -var BatchGetAssetsHistoryRequest = { +const BatchGetAssetsHistoryRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -129,7 +129,7 @@ var BatchGetAssetsHistoryRequest = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} */ -var BatchGetAssetsHistoryResponse = { +const BatchGetAssetsHistoryResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -145,7 +145,7 @@ var BatchGetAssetsHistoryResponse = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} */ -var OutputConfig = { +const OutputConfig = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -162,7 +162,7 @@ var OutputConfig = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} */ -var GcsDestination = { +const GcsDestination = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -172,7 +172,7 @@ var GcsDestination = { * @enum {number} * @memberof google.cloud.asset.v1beta1 */ -var ContentType = { +const ContentType = { /** * Unspecified content type. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index 7214e6518fb..7a84f8bc39a 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -36,7 +36,7 @@ * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} */ -var TemporalAsset = { +const TemporalAsset = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -58,7 +58,7 @@ var TemporalAsset = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} */ -var TimeWindow = { +const TimeWindow = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -90,7 +90,7 @@ var TimeWindow = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} */ -var Asset = { +const Asset = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -139,6 +139,6 @@ var Asset = { * @memberof google.cloud.asset.v1beta1 * @see [google.cloud.asset.v1beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} */ -var Resource = { +const Resource = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 0163cf59f58..59fca18810c 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -74,7 +74,7 @@ * @memberof google.iam.v1 * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} */ -var Policy = { +const Policy = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -113,7 +113,7 @@ var Policy = { * @memberof google.iam.v1 * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} */ -var Binding = { +const Binding = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -129,7 +129,7 @@ var Binding = { * @memberof google.iam.v1 * @see [google.iam.v1.PolicyDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} */ -var PolicyDelta = { +const PolicyDelta = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -157,6 +157,6 @@ var PolicyDelta = { * @memberof google.iam.v1 * @see [google.iam.v1.BindingDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} */ -var BindingDelta = { +const BindingDelta = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js index 79ef6344437..4af5d7d3574 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -58,7 +58,7 @@ * @memberof google.longrunning * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} */ -var Operation = { +const Operation = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -72,7 +72,7 @@ var Operation = { * @memberof google.longrunning * @see [google.longrunning.GetOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} */ -var GetOperationRequest = { +const GetOperationRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -95,7 +95,7 @@ var GetOperationRequest = { * @memberof google.longrunning * @see [google.longrunning.ListOperationsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} */ -var ListOperationsRequest = { +const ListOperationsRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -114,7 +114,7 @@ var ListOperationsRequest = { * @memberof google.longrunning * @see [google.longrunning.ListOperationsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} */ -var ListOperationsResponse = { +const ListOperationsResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -128,7 +128,7 @@ var ListOperationsResponse = { * @memberof google.longrunning * @see [google.longrunning.CancelOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} */ -var CancelOperationRequest = { +const CancelOperationRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -142,6 +142,6 @@ var CancelOperationRequest = { * @memberof google.longrunning * @see [google.longrunning.DeleteOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} */ -var DeleteOperationRequest = { +const DeleteOperationRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js index c5c5bbafa23..3accb1fc0d8 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -131,6 +131,6 @@ * @memberof google.protobuf * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} */ -var Any = { +const Any = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js index efcd8ac5af9..ddf7e5c95dc 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -32,7 +32,7 @@ * @memberof google.protobuf * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} */ -var Struct = { +const Struct = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -72,7 +72,7 @@ var Struct = { * @memberof google.protobuf * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} */ -var Value = { +const Value = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -90,7 +90,7 @@ var Value = { * @memberof google.protobuf * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} */ -var ListValue = { +const ListValue = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -103,7 +103,7 @@ var ListValue = { * @enum {number} * @memberof google.protobuf */ -var NullValue = { +const NullValue = { /** * Null value. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 51d8f40f54d..1ebe2e6e1a5 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -110,6 +110,6 @@ * @memberof google.protobuf * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} */ -var Timestamp = { +const Timestamp = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js index 7122f1682e0..13cfcab1021 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js @@ -87,6 +87,6 @@ * @memberof google.rpc * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} */ -var Status = { +const Status = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file From cbdff82c81d2525ca5302fcc784cddf1a695f1af Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 1 Oct 2018 05:03:33 -0700 Subject: [PATCH 029/429] chore(deps): update dependency eslint-plugin-prettier to v3 (#21) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 269518b39cc..86a28a99699 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -54,7 +54,7 @@ "eslint": "^5.1.0", "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^7.0.0", - "eslint-plugin-prettier": "^2.6.2", + "eslint-plugin-prettier": "^3.0.0", "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", From 58278e736b8f3ee8ecbaf2627a2bf768bc835276 Mon Sep 17 00:00:00 2001 From: DPE bot Date: Tue, 2 Oct 2018 05:47:55 -0700 Subject: [PATCH 030/429] Update CI config (#22) --- .../google-cloud-asset/.circleci/config.yml | 2 - packages/google-cloud-asset/codecov.yaml | 4 ++ .../cloud/asset/v1beta1/asset_service.proto | 43 +++++++++---------- .../google/cloud/asset/v1beta1/assets.proto | 30 ++++++------- .../src/v1beta1/asset_service_client.js | 30 ++++++------- .../cloud/asset/v1beta1/doc_asset_service.js | 31 +++++++------ .../google/cloud/asset/v1beta1/doc_assets.js | 30 ++++++------- 7 files changed, 85 insertions(+), 85 deletions(-) create mode 100644 packages/google-cloud-asset/codecov.yaml diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml index 8af6a4d0489..da54155fc57 100644 --- a/packages/google-cloud-asset/.circleci/config.yml +++ b/packages/google-cloud-asset/.circleci/config.yml @@ -68,8 +68,6 @@ jobs: environment: NPM_CONFIG_PREFIX: /home/node/.npm-global - run: npm test - - run: node_modules/.bin/codecov - node8: docker: - image: 'node:8' diff --git a/packages/google-cloud-asset/codecov.yaml b/packages/google-cloud-asset/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-asset/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto index b64502f68e4..aaaa0ba223b 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -32,9 +32,9 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; // Asset service definition. service AssetService { - // Exports assets with time and resource types to a given Google Cloud Storage + // Exports assets with time and resource types to a given Cloud Storage // location. The output format is newline-delimited JSON. - // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users + // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you // to keep track of the export. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -47,16 +47,16 @@ service AssetService { }; } - // Batch gets assets update history that overlaps a time window. + // Batch gets the update history of assets that overlap a time window. // For RESOURCE content, this API outputs history with asset in both // non-delete or deleted status. - // For IAM_POLICY content, this API only outputs history when asset and its - // attached IAM POLICY both exist. So there may be gaps in the output history. + // For IAM_POLICY content, this API outputs history when the asset and its + // attached IAM POLICY both exist. This can create gaps in the output history. rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*}:batchGetAssetsHistory" additional_bindings { - get: "/v1beta1/{parent=organizations/*}:batchGetAssetHistory" + get: "/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" } }; } @@ -64,9 +64,9 @@ service AssetService { // Export asset request. message ExportAssetsRequest { - // Required. The relative name of the root asset. Can only be an organization - // number (such as "organizations/123"), or a project id (such as - // "projects/my-project-id") or a project number (such as "projects/12345"). + // Required. The relative name of the root asset. This can only be an organization + // number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). string parent = 1; // Timestamp to take an asset snapshot. This can only be set to a timestamp in @@ -76,7 +76,7 @@ message ExportAssetsRequest { // results. google.protobuf.Timestamp read_time = 2; - // A list of asset types of which to take a snapshot for. Example: + // A list of asset types of which to take a snapshot for. For example: // "google.compute.disk". If specified, only matching assets will be returned. repeated string asset_types = 3; @@ -104,14 +104,14 @@ message ExportAssetsResponse { // Batch get assets history request. message BatchGetAssetsHistoryRequest { // Required. The relative name of the root asset. It can only be an - // organization number (such as "organizations/123"), or a project id (such as - // "projects/my-project-id")"or a project number (such as "projects/12345"). + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id")", or a project number (such as "projects/12345"). string parent = 1; - // A list of the full names of the assets. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name - // Example: - // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // A list of the full names of the assets. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more info. // // The request becomes a no-op if the asset name list is empty, and the max // size of the asset name list is 100 in one request. @@ -136,17 +136,16 @@ message BatchGetAssetsHistoryResponse { message OutputConfig { // Asset export destination. oneof destination { - // Destination on Google Cloud Storage (GCS). + // Destination on Cloud Storage. GcsDestination gcs_destination = 1; } } -// A Google Cloud Storage (GCS) location. +// A Cloud Storage location. message GcsDestination { - // The path of the GCS objects. It's the same path that is used by gsutil, for - // example: "gs://bucket_name/object_path". See: - // https://cloud.google.com/storage/docs/viewing-editing-metadata for more - // information. + // The path of the Cloud Storage objects. It's the same path that is used by + // gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. string uri = 1; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto index db270b0879f..5d339a20f00 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -54,13 +54,12 @@ message TimeWindow { google.protobuf.Timestamp end_time = 2; } -// Cloud asset. This include all Google Cloud Platform resources, as well as -// IAM policies and other non-GCP assets. +// Cloud asset. This includes all Google Cloud Platform resources, +// Cloud IAM policies, and other non-GCP assets. message Asset { - // The full name of the asset. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name - // Example: - // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // The full name of the asset. For example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. string name = 1; // Type of the asset. Example: "google.compute.disk". @@ -69,8 +68,8 @@ message Asset { // Representation of the resource. Resource resource = 3; - // Representation of the actual IAM policy set on a cloud resource. For each - // resource, there must be at most one IAM policy set on it. + // Representation of the actual Cloud IAM policy set on a cloud resource. For each + // resource, there must be at most one Cloud IAM policy set on it. google.iam.v1.Policy iam_policy = 4; } @@ -80,8 +79,8 @@ message Resource { string version = 1; // The URL of the discovery document containing the resource's JSON schema. - // Example: - // "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + // For example: + // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. // It will be left unspecified for resources without a discovery-based API, // such as Cloud Bigtable. string discovery_document_uri = 2; @@ -98,12 +97,13 @@ message Resource { // It will be left unspecified for resources without a REST API. string resource_url = 4; - // The full name of the immediate parent of this resource. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name + // The full name of the immediate parent of this resource. See + // [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. // - // For GCP assets, it is the parent resource defined in the IAM policy - // hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. - // Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + // For GCP assets, it is the parent resource defined in the [Cloud IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // For example: `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. // // For third-party assets, it is up to the users to define. string parent = 5; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 9a7efa6df3d..4004fcf77f8 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -212,17 +212,17 @@ class AssetServiceClient { // ------------------- /** - * Exports assets with time and resource types to a given Google Cloud Storage + * Exports assets with time and resource types to a given Cloud Storage * location. The output format is newline-delimited JSON. - * This API implements the google.longrunning.Operation API allowing users + * This API implements the google.longrunning.Operation API allowing you * to keep track of the export. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The relative name of the root asset. Can only be an organization - * number (such as "organizations/123"), or a project id (such as - * "projects/my-project-id") or a project number (such as "projects/12345"). + * Required. The relative name of the root asset. This can only be an organization + * number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). * @param {Object} request.outputConfig * Required. Output configuration indicating where the results will be output * to. All results will be in newline delimited JSON format. @@ -237,7 +237,7 @@ class AssetServiceClient { * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. Example: + * A list of asset types of which to take a snapshot for. For example: * "google.compute.disk". If specified, only matching assets will be returned. * @param {number} [request.contentType] * Asset content type. If not specified, no content but the asset name will be @@ -338,18 +338,18 @@ class AssetServiceClient { } /** - * Batch gets assets update history that overlaps a time window. + * Batch gets the update history of assets that overlap a time window. * For RESOURCE content, this API outputs history with asset in both * non-delete or deleted status. - * For IAM_POLICY content, this API only outputs history when asset and its - * attached IAM POLICY both exist. So there may be gaps in the output history. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), or a project id (such as - * "projects/my-project-id")"or a project number (such as "projects/12345"). + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). * @param {number} request.contentType * Required. The content type. * @@ -361,10 +361,10 @@ class AssetServiceClient { * * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} * @param {string[]} [request.assetNames] - * A list of the full names of the assets. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * Example: - * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more info. * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js index 93a2fb93b62..b9d7246991e 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -19,9 +19,9 @@ * Export asset request. * * @property {string} parent - * Required. The relative name of the root asset. Can only be an organization - * number (such as "organizations/123"), or a project id (such as - * "projects/my-project-id") or a project number (such as "projects/12345"). + * Required. The relative name of the root asset. This can only be an organization + * number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). * * @property {Object} readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp in @@ -33,7 +33,7 @@ * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. Example: + * A list of asset types of which to take a snapshot for. For example: * "google.compute.disk". If specified, only matching assets will be returned. * * @property {number} contentType @@ -85,14 +85,14 @@ const ExportAssetsResponse = { * * @property {string} parent * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), or a project id (such as - * "projects/my-project-id")"or a project number (such as "projects/12345"). + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). * * @property {string[]} assetNames - * A list of the full names of the assets. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * Example: - * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more info. * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. @@ -137,7 +137,7 @@ const BatchGetAssetsHistoryResponse = { * Output configuration for export assets destination. * * @property {Object} gcsDestination - * Destination on Google Cloud Storage (GCS). + * Destination on Cloud Storage. * * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1beta1.GcsDestination} * @@ -150,13 +150,12 @@ const OutputConfig = { }; /** - * A Google Cloud Storage (GCS) location. + * A Cloud Storage location. * * @property {string} uri - * The path of the GCS objects. It's the same path that is used by gsutil, for - * example: "gs://bucket_name/object_path". See: - * https://cloud.google.com/storage/docs/viewing-editing-metadata for more - * information. + * The path of the Cloud Storage objects. It's the same path that is used by + * gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. * * @typedef GcsDestination * @memberof google.cloud.asset.v1beta1 diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index 7a84f8bc39a..de6df65b168 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -63,14 +63,13 @@ const TimeWindow = { }; /** - * Cloud asset. This include all Google Cloud Platform resources, as well as - * IAM policies and other non-GCP assets. + * Cloud asset. This includes all Google Cloud Platform resources, + * Cloud IAM policies, and other non-GCP assets. * * @property {string} name - * The full name of the asset. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name - * Example: - * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The full name of the asset. For example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. * * @property {string} assetType * Type of the asset. Example: "google.compute.disk". @@ -81,8 +80,8 @@ const TimeWindow = { * This object should have the same structure as [Resource]{@link google.cloud.asset.v1beta1.Resource} * * @property {Object} iamPolicy - * Representation of the actual IAM policy set on a cloud resource. For each - * resource, there must be at most one IAM policy set on it. + * Representation of the actual Cloud IAM policy set on a cloud resource. For each + * resource, there must be at most one Cloud IAM policy set on it. * * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} * @@ -102,8 +101,8 @@ const Asset = { * * @property {string} discoveryDocumentUri * The URL of the discovery document containing the resource's JSON schema. - * Example: - * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * For example: + * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. * It will be left unspecified for resources without a discovery-based API, * such as Cloud Bigtable. * @@ -120,12 +119,13 @@ const Asset = { * It will be left unspecified for resources without a REST API. * * @property {string} parent - * The full name of the immediate parent of this resource. See: - * https://cloud.google.com/apis/design/resource_names#full_resource_name + * The full name of the immediate parent of this resource. See + * [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. * - * For GCP assets, it is the parent resource defined in the IAM policy - * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. - * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For GCP assets, it is the parent resource defined in the [Cloud IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * For example: `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. * * For third-party assets, it is up to the users to define. * From d99cb02b792a6d3acb67cae54131ae93ce3daec1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 28 Oct 2018 08:35:17 -0700 Subject: [PATCH 031/429] chore(deps): update dependency eslint-plugin-node to v8 (#36) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 86a28a99699..8c6d6e3c4da 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -53,7 +53,7 @@ "codecov": "^3.0.4", "eslint": "^5.1.0", "eslint-config-prettier": "^3.0.0", - "eslint-plugin-node": "^7.0.0", + "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "ink-docstrap": "^1.3.2", "intelli-espower-loader": "^1.0.1", From 24ff936c884858d9f55b6602f3f4156c1038f42e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 30 Oct 2018 10:02:24 -0700 Subject: [PATCH 032/429] chore: include build in eslintignore (#40) --- packages/google-cloud-asset/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore index f6fac98b0a8..f08b0fd1c65 100644 --- a/packages/google-cloud-asset/.eslintignore +++ b/packages/google-cloud-asset/.eslintignore @@ -1,3 +1,4 @@ node_modules/* samples/node_modules/* src/**/doc/* +build/ From 8b05ee3b774141068ada34135f19960613074318 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 1 Nov 2018 12:05:23 -0700 Subject: [PATCH 033/429] chore: update CircleCI config (#43) --- packages/google-cloud-asset/.circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml index da54155fc57..6735ebdaaa1 100644 --- a/packages/google-cloud-asset/.circleci/config.yml +++ b/packages/google-cloud-asset/.circleci/config.yml @@ -159,7 +159,8 @@ jobs: command: npm run system-test environment: GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json + GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json + NPM_CONFIG_PREFIX: /home/node/.npm-global - run: name: Remove unencrypted key. command: | From 72860708fca1a8a889281f74bb0e0c020ca24156 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 7 Nov 2018 08:41:36 -0800 Subject: [PATCH 034/429] chore(deps): update dependency through2 to v3 (#44) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 8c6d6e3c4da..bfce5ba4c49 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -62,6 +62,6 @@ "nyc": "^13.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7", - "through2": "^2.0.3" + "through2": "^3.0.0" } } From d2f60f3e0092598b39eabbd9b23c44e48499ae18 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 9 Nov 2018 10:02:00 -0800 Subject: [PATCH 035/429] chore: drop contributors from multiple places (#46) --- packages/google-cloud-asset/CONTRIBUTORS | 6 ------ packages/google-cloud-asset/package.json | 3 --- 2 files changed, 9 deletions(-) delete mode 100644 packages/google-cloud-asset/CONTRIBUTORS diff --git a/packages/google-cloud-asset/CONTRIBUTORS b/packages/google-cloud-asset/CONTRIBUTORS deleted file mode 100644 index 6585b55f8f2..00000000000 --- a/packages/google-cloud-asset/CONTRIBUTORS +++ /dev/null @@ -1,6 +0,0 @@ -# The names of individuals who have contributed to this project. -# -# Names are formatted as: -# name -# -Jonathan Lui diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index bfce5ba4c49..7a7fdd42bca 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -28,9 +28,6 @@ "cloudasset", "Cloud Asset API" ], - "contributors": [ - "Jonathan Lui " - ], "scripts": { "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", From 2321bd1b48a9990e70504f8847741c1c307c1d99 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 10 Nov 2018 10:50:53 -0800 Subject: [PATCH 036/429] chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#47) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 7a7fdd42bca..1f121e7a53e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -46,7 +46,7 @@ "protobufjs": "^6.8.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^2.3.1", + "@google-cloud/nodejs-repo-tools": "^3.0.0", "codecov": "^3.0.4", "eslint": "^5.1.0", "eslint-config-prettier": "^3.0.0", From c9c4f674d0e29620cce73cd3f46a8f5aebeaf84b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 12 Nov 2018 15:55:58 -0800 Subject: [PATCH 037/429] chore: update eslintignore config (#48) --- packages/google-cloud-asset/.eslintignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore index f08b0fd1c65..2f642cb6044 100644 --- a/packages/google-cloud-asset/.eslintignore +++ b/packages/google-cloud-asset/.eslintignore @@ -1,4 +1,3 @@ -node_modules/* -samples/node_modules/* +**/node_modules src/**/doc/* build/ From f86b0d1547037d2db56cf961306b79ba2cd3ddb1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 15 Nov 2018 11:22:40 -0800 Subject: [PATCH 038/429] fix(deps): update dependency google-gax to ^0.22.0 (#49) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1f121e7a53e..d445ff4767b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -41,7 +41,7 @@ "fix": "eslint --fix '**/*.js' && npm run prettier" }, "dependencies": { - "google-gax": "^0.20.0", + "google-gax": "^0.22.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 744bdf4d15037a8c88845fa57688cb86c29809f7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 19 Nov 2018 10:47:26 -0800 Subject: [PATCH 039/429] chore: add synth.metadata chore: add synth.metadata --- packages/google-cloud-asset/synth.metadata | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/google-cloud-asset/synth.metadata diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata new file mode 100644 index 00000000000..f26e69af884 --- /dev/null +++ b/packages/google-cloud-asset/synth.metadata @@ -0,0 +1,27 @@ +{ + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "5a57f0c13a358b2b15452bf2d67453774a5f6d4f", + "internalRef": "221837528" + } + }, + { + "git": { + "name": "googleapis-private", + "remote": "https://github.com/googleapis/googleapis-private.git", + "sha": "6aa8e1a447bb8d0367150356a28cb4d3f2332641", + "internalRef": "221340946" + } + }, + { + "generator": { + "name": "artman", + "version": "0.16.0", + "dockerImage": "googleapis/artman@sha256:90f9d15e9bad675aeecd586725bce48f5667ffe7d5fc4d1e96d51ff34304815b" + } + } + ] +} \ No newline at end of file From 3a232cf77e6616d6ae065fb75aea6020291b7909 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 19 Nov 2018 15:19:19 -0800 Subject: [PATCH 040/429] chore: do a little lint cleanup (#53) --- packages/google-cloud-asset/.gitignore | 3 --- packages/google-cloud-asset/package.json | 8 +++----- .../google-cloud-asset/samples/.eslintrc.yml | 1 + packages/google-cloud-asset/synth.py | 13 +++++-------- .../google-cloud-asset/system-test/.eslintrc.yml | 1 - .../google-cloud-asset/system-test/no-tests.js | 16 +++++++++++++++- packages/google-cloud-asset/test/.eslintrc.yml | 2 -- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index b895f87eb0b..95fcedf6538 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -3,12 +3,9 @@ .coverage .nyc_output docs/ -out/ build/ system-test/secrets.js system-test/*key.json *.lock **/package-lock.json .DS_Store -google-cloud-logging-winston-*.tgz -google-cloud-logging-bunyan-*.tgz diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index d445ff4767b..38fd8427061 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -32,13 +32,12 @@ "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", - "lint": "eslint src/ samples/ system-test/ test/", - "prettier": "prettier --write src/*.js src/*/*.js samples/*.js samples/*/*.js test/*.js test/*/*.js system-test/*.js system-test/*/*.js", + "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", "test": "npm run cover", - "fix": "eslint --fix '**/*.js' && npm run prettier" + "fix": "eslint --fix '**/*.js'" }, "dependencies": { "google-gax": "^0.22.0", @@ -58,7 +57,6 @@ "mocha": "^5.2.0", "nyc": "^13.0.0", "power-assert": "^1.6.0", - "prettier": "^1.13.7", - "through2": "^3.0.0" + "prettier": "^1.13.7" } } diff --git a/packages/google-cloud-asset/samples/.eslintrc.yml b/packages/google-cloud-asset/samples/.eslintrc.yml index 282535f55f6..0aa37ac630e 100644 --- a/packages/google-cloud-asset/samples/.eslintrc.yml +++ b/packages/google-cloud-asset/samples/.eslintrc.yml @@ -1,3 +1,4 @@ --- rules: no-console: off + node/no-missing-require: off diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 60354eebace..bf03aee86e0 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -20,22 +20,19 @@ logging.basicConfig(level=logging.DEBUG) +# run the gapic generator gapic = gcp.GAPICGenerator() -common_templates = gcp.CommonTemplates() - version = 'v1beta1' - library = gapic.node_library( 'asset', version, config_path="artman_cloudasset_v1beta1.yaml", artman_output_name=f"asset-{version}") +# Copy common templates +common_templates = gcp.CommonTemplates() s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) - templates = common_templates.node_library() s.copy(templates) -''' -Node.js specific cleanup -''' +# Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'prettier']) +subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-asset/system-test/.eslintrc.yml b/packages/google-cloud-asset/system-test/.eslintrc.yml index 2e6882e46d2..f9605165c0f 100644 --- a/packages/google-cloud-asset/system-test/.eslintrc.yml +++ b/packages/google-cloud-asset/system-test/.eslintrc.yml @@ -2,5 +2,4 @@ env: mocha: true rules: - node/no-unpublished-require: off no-console: off diff --git a/packages/google-cloud-asset/system-test/no-tests.js b/packages/google-cloud-asset/system-test/no-tests.js index ed54b008e0c..28550b2df42 100644 --- a/packages/google-cloud-asset/system-test/no-tests.js +++ b/packages/google-cloud-asset/system-test/no-tests.js @@ -1 +1,15 @@ -console.log('no tests yet'); +// Copyright 2018 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. + +console.log('no system tests 👻'); diff --git a/packages/google-cloud-asset/test/.eslintrc.yml b/packages/google-cloud-asset/test/.eslintrc.yml index 73f7bbc946f..6db2a46c535 100644 --- a/packages/google-cloud-asset/test/.eslintrc.yml +++ b/packages/google-cloud-asset/test/.eslintrc.yml @@ -1,5 +1,3 @@ --- env: mocha: true -rules: - node/no-unpublished-require: off From cee33351da640f1642840653ad4d4b22c94788ff Mon Sep 17 00:00:00 2001 From: peter-zheng-g <43967553+peter-zheng-g@users.noreply.github.com> Date: Mon, 19 Nov 2018 16:15:31 -0800 Subject: [PATCH 041/429] docs(samples): add quickstart code for ExportAssets (#50) --- packages/google-cloud-asset/.eslintrc.yml | 1 + .../google-cloud-asset/samples/package.json | 16 ++++- .../google-cloud-asset/samples/quickstart.js | 63 ++++++++++++++++--- 3 files changed, 67 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-asset/.eslintrc.yml b/packages/google-cloud-asset/.eslintrc.yml index 73eeec27612..0e883b65ac7 100644 --- a/packages/google-cloud-asset/.eslintrc.yml +++ b/packages/google-cloud-asset/.eslintrc.yml @@ -7,6 +7,7 @@ plugins: - node - prettier rules: + node/no-unpublished-require: off prettier/prettier: error block-scoped-var: error eqeqeq: error diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 6173a72d768..6a2db240e21 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -14,9 +14,19 @@ "**/*.test.js" ] }, - "scripts": {}, + "scripts": { + "test": "mocha system-test --timeout 20000" + }, "dependencies": { - "@google-cloud/asset": "^0.1.0" + "@google-cloud/asset": "^0.1.0", + "@google-cloud/storage": "^2.3.0", + "express": "^4.16.4", + "uuid": "^3.3.2", + "yargs": "^12.0.0" }, - "devDependencies": {} + "devDependencies": { + "@google-cloud/nodejs-repo-tools": "^3.0.0", + "mocha": "^5.2.0", + "sinon": "^7.0.0" + } } diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 88ca9ff5add..71befdb84d7 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -1,5 +1,5 @@ /** - * Copyright 2018, Google LLC. + * Copyright 2018, 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 @@ -15,14 +15,57 @@ 'use strict'; -// [START asset_quickstart] -// Imports the Google Cloud client library -const asset = require('@google-cloud/asset'); +async function exportAssets(dumpFilePath) { + // [START asset_quickstart_exportassets] + const asset = require('@google-cloud/asset'); + const client = new asset.v1beta1.AssetServiceClient({ + // optional auth parameters. + }); -// eslint-disable-next-line -const client = new asset.AssetServiceClient({ - projectId: 'your-project-id', - keyFilename: '/path/to/keyfile.json', -}); + // Your Google Cloud Platform project ID + const projectId = process.env.GCLOUD_PROJECT; + const projectResource = client.projectPath(projectId); -// [END asset_quickstart] + // var dumpFilePath = 'Dump file path, e.g.: gs:///' + const outputConfig = { + gcsDestination: { + uri: dumpFilePath, + }, + }; + const request = { + parent: projectResource, + outputConfig: outputConfig, + }; + + // Handle the operation using the promise pattern. + const [operation] = await client.exportAssets(request); + // Operation#promise starts polling for the completion of the operation. + const [result] = await operation.promise(); + // Do things with with the response. + console.log(result); + // [END asset_quickstart_exportassets] +} + +const cli = require('yargs') + .demand(1) + .command( + 'export-assets ', + 'Export asserts to specified dump file path.', + {}, + opts => exportAssets(opts.dumpFilePath) + ) + .example( + 'node $0 export-assets gs://my-bucket/my-assets.txt', + 'Export assets to gs://my-bucket/my-assets.txt.' + ) + .wrap(10) + .recommendCommands() + .epilogue( + 'https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview' + ) + .help() + .strict(); + +if (module === require.main) { + cli.parse(process.argv.slice(2)); +} From 5ec686579c71ea26e7a8319cd366b5224325ffe7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 22 Nov 2018 10:37:21 -0800 Subject: [PATCH 042/429] fix: fix the lint rules (#58) --- packages/google-cloud-asset/.eslintrc.yml | 1 - packages/google-cloud-asset/samples/package.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.eslintrc.yml b/packages/google-cloud-asset/.eslintrc.yml index 0e883b65ac7..73eeec27612 100644 --- a/packages/google-cloud-asset/.eslintrc.yml +++ b/packages/google-cloud-asset/.eslintrc.yml @@ -7,7 +7,6 @@ plugins: - node - prettier rules: - node/no-unpublished-require: off prettier/prettier: error block-scoped-var: error eqeqeq: error diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 6a2db240e21..e4f9d36bbe8 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -7,6 +7,9 @@ "engines": { "node": ">=8" }, + "files": [ + "*.js" + ], "repository": "googleapis/nodejs-asset", "private": true, "nyc": { From f6a1133239dfa5559a3c641fa17a2d220500444c Mon Sep 17 00:00:00 2001 From: peter-zheng-g <43967553+peter-zheng-g@users.noreply.github.com> Date: Tue, 27 Nov 2018 15:27:25 -0800 Subject: [PATCH 043/429] sample: Add quickstart sample code for BatchGetAsstesHistory. (#59) --- .../google-cloud-asset/samples/quickstart.js | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 71befdb84d7..d0fa28c2f90 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -16,7 +16,7 @@ 'use strict'; async function exportAssets(dumpFilePath) { - // [START asset_quickstart_exportassets] + // [START asset_quickstart_export_assets] const asset = require('@google-cloud/asset'); const client = new asset.v1beta1.AssetServiceClient({ // optional auth parameters. @@ -43,7 +43,42 @@ async function exportAssets(dumpFilePath) { const [result] = await operation.promise(); // Do things with with the response. console.log(result); - // [END asset_quickstart_exportassets] + // [END asset_quickstart_export_assets] +} + +async function batchGetAssetsHistory(assetNames) { + // [START asset_quickstart_batch_get_assets_history] + const util = require('util'); + const asset = require('@google-cloud/asset'); + const client = new asset.v1beta1.AssetServiceClient({ + // optional auth parameters. + }); + + // Your Google Cloud Platform project ID + const projectId = process.env.GCLOUD_PROJECT; + const projectResource = client.projectPath(projectId); + // Your asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. + // var assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; + + const contentType = 'RESOURCE'; + const readTimeWindow = { + startTime: { + seconds: Math.floor(new Date().getTime() / 1000), + }, + }; + + const request = { + parent: projectResource, + assetNames: assetNames, + contentType: contentType, + readTimeWindow: readTimeWindow, + }; + + // Handle the operation using the promise pattern. + const result = await client.batchGetAssetsHistory(request); + // Do things with with the response. + console.log(util.inspect(result, {depth: null})); + // [END asset_quickstart_batch_get_assets_history] } const cli = require('yargs') @@ -54,10 +89,23 @@ const cli = require('yargs') {}, opts => exportAssets(opts.dumpFilePath) ) + .command( + 'batch-get-history ', + 'Batch get history of assets.', + {}, + opts => { + const assetNameList = opts.assetNames.split(','); + batchGetAssetsHistory(assetNameList); + } + ) .example( 'node $0 export-assets gs://my-bucket/my-assets.txt', 'Export assets to gs://my-bucket/my-assets.txt.' ) + .example( + 'node $0 batch-get-history "//storage.googleapis.com/,"', + 'Batch get history of assets //storage.googleapis.com/ etc.' + ) .wrap(10) .recommendCommands() .epilogue( From f2e2035907c745c287f57907f883275d72413e2f Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Sat, 1 Dec 2018 18:43:17 -0800 Subject: [PATCH 044/429] fix(build): fix system key decryption (#60) --- packages/google-cloud-asset/.circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml index 6735ebdaaa1..86c63432242 100644 --- a/packages/google-cloud-asset/.circleci/config.yml +++ b/packages/google-cloud-asset/.circleci/config.yml @@ -116,7 +116,7 @@ jobs: name: Decrypt credentials. command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -in .circleci/key.json.enc \ + openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ -out .circleci/key.json \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" fi @@ -148,7 +148,7 @@ jobs: command: | if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -in $encrypted_key \ + openssl aes-256-cbc -d -md md5 -in $encrypted_key \ -out $(echo $encrypted_key | sed 's/\.enc//') \ -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" done From ed493ef2e767cbf27d220a79ceaa1313da4edbbd Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Mon, 3 Dec 2018 12:53:35 -0800 Subject: [PATCH 045/429] docs: Fix 404 link to product reference docs. (#62) --- packages/google-cloud-asset/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 188f7a77121..26e4ff9b371 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -84,7 +84,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [explained]: https://cloud.google.com/apis/docs/client-libraries-explained [client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/ -[product-docs]: https://cloud.google.com/asset/docs +[product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [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 From 90cccc3cbc1b2af348ee35a3fea920e251841aee Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 3 Dec 2018 15:34:03 -0800 Subject: [PATCH 046/429] docs: update readme badges (#63) --- packages/google-cloud-asset/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 26e4ff9b371..3750855596d 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -5,8 +5,7 @@ # [Google Cloud Asset API: Node.js Client](https://github.com/googleapis/nodejs-asset) [![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![CircleCI](https://img.shields.io/circleci/project/github/googleapis/nodejs-asset.svg?style=flat)](https://circleci.com/gh/googleapis/nodejs-asset) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/googleapis/nodejs-asset?branch=master&svg=true)](https://ci.appveyor.com/project/googleapis/nodejs-asset) +[![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history and inventory of cloud resources. @@ -90,3 +89,4 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=asset.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started + From f0bdc0c64cb53e31de4d9c1872c9374165485ca7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 4 Dec 2018 09:30:35 -0800 Subject: [PATCH 047/429] chore: update license file (#65) --- packages/google-cloud-asset/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/LICENSE b/packages/google-cloud-asset/LICENSE index 7a4a3ea2424..d6456956733 100644 --- a/packages/google-cloud-asset/LICENSE +++ b/packages/google-cloud-asset/LICENSE @@ -199,4 +199,4 @@ 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. \ No newline at end of file + limitations under the License. From 8fc9c23344d54686ccf39543c46ef028d80a76c5 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 4 Dec 2018 14:31:31 -0800 Subject: [PATCH 048/429] docs: update README.md with correct links (#66) --- .../google-cloud-asset/.cloud-repo-tools.json | 1 - packages/google-cloud-asset/README.md | 52 ++++++++++++------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-asset/.cloud-repo-tools.json b/packages/google-cloud-asset/.cloud-repo-tools.json index 4f06ffc2003..a040dad1f74 100644 --- a/packages/google-cloud-asset/.cloud-repo-tools.json +++ b/packages/google-cloud-asset/.cloud-repo-tools.json @@ -2,7 +2,6 @@ "requiresKeyFile": true, "requiresProjectId": true, "product": "asset", - "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/asset/latest/", "release_quality": "alpha", "samples": [ ] diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 3750855596d..828b2dbe7db 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -2,13 +2,13 @@ [//]: # "To regenerate it, use `npm run generate-scaffolding`." Google Cloud Platform logo -# [Google Cloud Asset API: Node.js Client](https://github.com/googleapis/nodejs-asset) +# [Google Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) [![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) -The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history and inventory of cloud resources. +[Cloud Asset Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) is a storage service that keeps a five week history of Google Cloud Platform (GCP) asset metadata. It allows you to export all asset metadata at a certain timestamp or timeframe. * [Using the client library](#using-the-client-library) @@ -22,7 +22,7 @@ The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history a 1. [Enable billing for your project][billing]. -1. [Enable the Google Cloud Asset API API][enable_api]. +1. [Enable the Google Cloud Asset Inventory API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. @@ -34,19 +34,36 @@ The [Cloud Asset API](https://cloud.google.com/asset/docs) manages the history a 1. Try an example: ```javascript -// Imports the Google Cloud client library -const asset = require('@google-cloud/asset'); - -// eslint-disable-next-line -const client = new asset.AssetServiceClient({ - projectId: 'your-project-id', - keyFilename: '/path/to/keyfile.json', -}); - + const asset = require('@google-cloud/asset'); + const client = new asset.v1beta1.AssetServiceClient({ + // optional auth parameters. + }); + + // Your Google Cloud Platform project ID + const projectId = process.env.GCLOUD_PROJECT; + const projectResource = client.projectPath(projectId); + + // var dumpFilePath = 'Dump file path, e.g.: gs:///' + const outputConfig = { + gcsDestination: { + uri: dumpFilePath, + }, + }; + const request = { + parent: projectResource, + outputConfig: outputConfig, + }; + + // Handle the operation using the promise pattern. + const [operation] = await client.exportAssets(request); + // Operation#promise starts polling for the completion of the operation. + const [result] = await operation.promise(); + // Do things with with the response. + console.log(result); ``` -The [Cloud Asset API Node.js Client API Reference][client-docs] documentation +The [Cloud Asset Node.js Client API Reference][client-docs] documentation also contains samples. ## Versioning @@ -73,8 +90,8 @@ See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) ## What's Next -* [Cloud Asset API Documentation][product-docs] -* [Cloud Asset API Node.js Client API Reference][client-docs] +* [Cloud Asset Documentation][product-docs] +* [Cloud Asset Node.js Client API Reference][client-docs] * [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset) Read more about the client libraries for Cloud APIs, including the older @@ -82,11 +99,10 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [explained]: https://cloud.google.com/apis/docs/client-libraries-explained -[client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/ +[client-docs]: [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [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=asset.googleapis.com +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudasset.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started - From b5f7622c2a20f416f5d64348842d228ac049e4b5 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 4 Dec 2018 15:29:33 -0800 Subject: [PATCH 049/429] Release v0.1.1 (#67) --- packages/google-cloud-asset/CHANGELOG.md | 43 +++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index e786fae203b..4e9adc2d5e8 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,49 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## v0.1.1 + +12-04-2018 14:41 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.22.0 ([#49](https://github.com/googleapis/nodejs-asset/pull/49)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#47](https://github.com/googleapis/nodejs-asset/pull/47)) +- chore(deps): update dependency through2 to v3 ([#44](https://github.com/googleapis/nodejs-asset/pull/44)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#36](https://github.com/googleapis/nodejs-asset/pull/36)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#21](https://github.com/googleapis/nodejs-asset/pull/21)) + +### Documentation +- sample: Add quickstart sample code for BatchGetAsstesHistory. ([#59](https://github.com/googleapis/nodejs-asset/pull/59)) +- refactor(samples): convert sample tests from ava to mocha ([#56](https://github.com/googleapis/nodejs-asset/pull/56)) +- docs: update README.md with correct links ([#66](https://github.com/googleapis/nodejs-asset/pull/66)) +- docs: update readme badges ([#63](https://github.com/googleapis/nodejs-asset/pull/63)) +- docs: Fix 404 link to product reference docs. ([#62](https://github.com/googleapis/nodejs-asset/pull/62)) +- docs(samples): add quickstart code for ExportAssets ([#50](https://github.com/googleapis/nodejs-asset/pull/50)) + +### Internal / Testing Changes +- chore: update license file ([#65](https://github.com/googleapis/nodejs-asset/pull/65)) +- fix(build): fix system key decryption ([#60](https://github.com/googleapis/nodejs-asset/pull/60)) +- fix: fix the lint rules ([#58](https://github.com/googleapis/nodejs-asset/pull/58)) +- chore: do a little lint cleanup ([#53](https://github.com/googleapis/nodejs-asset/pull/53)) +- chore: add synth.metadata +- chore: update eslintignore config ([#48](https://github.com/googleapis/nodejs-asset/pull/48)) +- chore: drop contributors from multiple places ([#46](https://github.com/googleapis/nodejs-asset/pull/46)) +- chore: use latest npm on Windows ([#45](https://github.com/googleapis/nodejs-asset/pull/45)) +- chore: update CircleCI config ([#43](https://github.com/googleapis/nodejs-asset/pull/43)) +- chore: include build in eslintignore ([#40](https://github.com/googleapis/nodejs-asset/pull/40)) +- chore: update issue templates ([#35](https://github.com/googleapis/nodejs-asset/pull/35)) +- chore: remove old issue template ([#33](https://github.com/googleapis/nodejs-asset/pull/33)) +- build: run tests on node11 ([#32](https://github.com/googleapis/nodejs-asset/pull/32)) +- chores(build): run codecov on continuous builds ([#29](https://github.com/googleapis/nodejs-asset/pull/29)) +- chores(build): do not collect sponge.xml from windows builds ([#30](https://github.com/googleapis/nodejs-asset/pull/30)) +- chore: update new issue template ([#28](https://github.com/googleapis/nodejs-asset/pull/28)) +- build: fix codecov uploading on Kokoro ([#24](https://github.com/googleapis/nodejs-asset/pull/24)) +- Update CI config ([#22](https://github.com/googleapis/nodejs-asset/pull/22)) +- Update CI config and move to const ([#19](https://github.com/googleapis/nodejs-asset/pull/19)) +- test: remove appveyor config ([#17](https://github.com/googleapis/nodejs-asset/pull/17)) +- Fix the linter ([#16](https://github.com/googleapis/nodejs-asset/pull/16)) +- Enable prefer-const in the eslint config ([#15](https://github.com/googleapis/nodejs-asset/pull/15)) + ## v0.1.0 Initial release of the Cloud Asset API. diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 38fd8427061..b9aaaa141f9 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "0.1.0", + "version": "0.1.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index e4f9d36bbe8..359ae4253bc 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -21,7 +21,7 @@ "test": "mocha system-test --timeout 20000" }, "dependencies": { - "@google-cloud/asset": "^0.1.0", + "@google-cloud/asset": "^0.1.1", "@google-cloud/storage": "^2.3.0", "express": "^4.16.4", "uuid": "^3.3.2", From ed93ee09d56cf65c99eb3e1996f5a2350d685a55 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 5 Dec 2018 15:56:41 -0800 Subject: [PATCH 050/429] chore: nyc ignore build/test by default (#69) --- packages/google-cloud-asset/.nycrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index a1a8e6920ce..feb032400d4 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -3,7 +3,8 @@ "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", - "test/**/*.js" + "test/**/*.js", + "build/test" ], "watermarks": { "branches": [ From d9513a7c9363addc0abefbf886dad0af13be0d91 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Mon, 10 Dec 2018 13:36:30 -0800 Subject: [PATCH 051/429] build: add Kokoro configs for autorelease (#73) * build: add Kokoro configs for autorelease * build: add Kokoro configs for autorelease * chore: remove CircleCI config --- .../google-cloud-asset/.circleci/config.yml | 179 ------------------ .../google-cloud-asset/.circleci/key.json.enc | Bin 2352 -> 0 bytes .../.circleci/npm-install-retry.js | 60 ------ 3 files changed, 239 deletions(-) delete mode 100644 packages/google-cloud-asset/.circleci/config.yml delete mode 100644 packages/google-cloud-asset/.circleci/key.json.enc delete mode 100755 packages/google-cloud-asset/.circleci/npm-install-retry.js diff --git a/packages/google-cloud-asset/.circleci/config.yml b/packages/google-cloud-asset/.circleci/config.yml deleted file mode 100644 index 86c63432242..00000000000 --- a/packages/google-cloud-asset/.circleci/config.yml +++ /dev/null @@ -1,179 +0,0 @@ -version: 2 -workflows: - version: 2 - tests: - jobs: &workflow_jobs - - node6: - filters: &all_commits - tags: - only: /.*/ - - node8: - filters: *all_commits - - node10: - filters: *all_commits - - lint: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - docs: - requires: - - node6 - - node8 - - node10 - filters: *all_commits - - system_tests: - requires: - - lint - - docs - filters: &master_and_releases - branches: - only: master - tags: &releases - only: '/^v[\d.]+$/' - - sample_tests: - requires: - - lint - - docs - filters: *master_and_releases - - publish_npm: - requires: - - system_tests - - sample_tests - filters: - branches: - ignore: /.*/ - tags: *releases - nightly: - triggers: - - schedule: - cron: 0 7 * * * - filters: - branches: - only: master - jobs: *workflow_jobs -jobs: - node6: - docker: - - image: 'node:6' - user: node - steps: &unit_tests_steps - - checkout - - run: &npm_install_and_link - name: Install and link the module - command: |- - mkdir -p /home/node/.npm-global - ./.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: npm test - node8: - docker: - - image: 'node:8' - user: node - steps: *unit_tests_steps - node10: - docker: - - image: 'node:10' - user: node - steps: *unit_tests_steps - lint: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: &samples_npm_install_and_link - name: Link the module being tested to the samples. - command: | - cd samples/ - npm link ../ - ./../.circleci/npm-install-retry.js - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Run linting. - command: npm run lint - environment: - NPM_CONFIG_PREFIX: /home/node/.npm-global - docs: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: *npm_install_and_link - - run: npm run docs - sample_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - openssl aes-256-cbc -d -md md5 -in .circleci/key.json.enc \ - -out .circleci/key.json \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - fi - - run: *npm_install_and_link - - run: *samples_npm_install_and_link - - run: - name: Run sample tests. - command: npm run samples-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/samples/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/key.json - fi - when: always - working_directory: /home/node/samples/ - system_tests: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: - name: Decrypt credentials. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - for encrypted_key in .circleci/*.json.enc; do - openssl aes-256-cbc -d -md md5 -in $encrypted_key \ - -out $(echo $encrypted_key | sed 's/\.enc//') \ - -k "${SYSTEM_TESTS_ENCRYPTION_KEY}" - done - fi - - run: *npm_install_and_link - - run: - name: Run system tests. - command: npm run system-test - environment: - GCLOUD_PROJECT: long-door-651 - GOOGLE_APPLICATION_CREDENTIALS: /home/node/project/.circleci/key.json - NPM_CONFIG_PREFIX: /home/node/.npm-global - - run: - name: Remove unencrypted key. - command: | - if ! [[ -z "${SYSTEM_TESTS_ENCRYPTION_KEY}" ]]; then - rm .circleci/*.json - fi - when: always - publish_npm: - docker: - - image: 'node:8' - user: node - steps: - - checkout - - run: ./.circleci/npm-install-retry.js - - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - - run: npm publish --access=public diff --git a/packages/google-cloud-asset/.circleci/key.json.enc b/packages/google-cloud-asset/.circleci/key.json.enc deleted file mode 100644 index 341784e163234c6f3d082c356c803d95f67f3c21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2352 zcmV-03D5RZVQh3|WM5xC+dsrL^Vz4CWC0sJ!T6LRAeF~$gcxK{^KpNl-;U**2?qYe8D-YEaKHB6{xQBghoAlq%4)|#H@r#oB`DJdXgtX z)an?%G4oNqzmQ1}lEhTi050Wi_)7v=))E9rI=p4&KU-*XH5CswB8?c%h-(eym^DPw z%)EDkNzb5?4Pv$kaXBi0JvX{fr$di;WaDd|F2qk6JTLSWdwOMX0uSMMOOOy<3Gq9a zX$Z6yyhBQ|t)k1!Z~;yLFNi%O1%00w5FcuFEHWa!WL9WJkC^OTd4zayqcD-m{8(y4 zOQeO==4P-QdI0HoVC;MAmzFQ)|7e`^0xdJa>YA>+NW+30p+k4v1d3!Af?H&j%xi6gPOnDq8!CG-=PbHhC4A?j(vj-goJWWEW1jyHx2 zA!c=`f^8QhdNZ|@K-pioa3tdF6 zV4x>5#g|E$*9)*juWB+^asMb<_m+7osL%?4k+ z!XYgLWbSygpZP;WmW+I^bRP_zDvEy?Emg0%uNJvU{d3Y5I^+S9!b18fLoyR8P9LxD2Vs^n3g={O)2XaQX)&(qTTsB(fLml(Yz=_CxxJygsP z57SxGaNGaDZbfkl6J$J)?b*`cOV@nQ)Wt6G5%fk2i5f-O74I{F@*pOeV=#E~_^5v> zVicSOR)PJ0(xzGFZbT!ZyD-gEH|${1ph=e{wZLgK7M(QMZw+Md5(Ilj8I0w9r<7*M zd>zP>%Ixm+Fm8_i(F*>4bt|B$^H|6A|E^wY!V$bW{5?Uc1@xDDjQ^S^FCi!S19rE7 z;ImSsJlb(GpJPD=sqtSekcCFWrU=fYX}z>z7G!O0W0Tb4$)}jo+Xi;No%k?U_f~A& z11XkOuIz7AnAz*FkNI5P-iSAm?|zU|rF*gj(3YA*e?i!_2W7_JSq65nqpgv(!zsM> zsDXIPZX2a_6rGw4WNj2`>^An|6)_v`l&UZXL-$7pE5iZ$khu--VCSOl-`$n^IKwVa z-1{7;20X02I&472ovW{c0#da`Y8{PY3mpLm#{V{QqO~-AF6C5Q=)AaG02WtNK%*!O zmBx@>hYgVUL_@!!C=UawX>L3MXrYXsn)AGp=w_wdGFm#D28zb>9x%F-Hfe%)Q(Sd;zTaFPE>(*1J6(e0)F~L zoo!}>uU0FCgU$~Tn#P#G+uRO;p&|Wtl}}q2s5_rrC~dyhVe$AY3t4a!IV3!pz^Mxh zFzMjaQj&pw{)wP#hpat9PzP;~2Ant`K2&;#8x;sjp*CAClSioGURE*jgGLxN(j!L~ zK1i4(_M5n(foV@8tFBgM0f^+q8m1d{g^BS)jP}mPH!Pq{3VuLv+T(MBvp=(+cDf=z zh~=G)NP(a2mN}e<5J`}x< z5omGP!Kyqp)P2;>qQjd7<6tT&E|G?N?nqyQ% z4(^*jMVqV`L%Xflmd9FPpv{AVzn6Vbyesk|Ph@8E`bxJRh=Po+A6ApI6-_^grIv@)Qh

O+CDgC%8#7rudA%szi#$h6m}+lDNnc7#Ib9?CY%AaC}-XV`?ml6iph!PkrI)P?wRu=rMZ0tvp} zyz7oJj-J6yi=&M(;+78){b;}|eEo*%virh(I(7q>zV$`;)oDG4TlC5GHXC*8j-7MIkmzMRyZ`?9dF(?>PE [... NPM ARGS] -// - -let timeout = process.argv[2] || process.env.NPM_INSTALL_TIMEOUT || 60000; -let attempts = process.argv[3] || 3; -let args = process.argv.slice(4); -if (args.length === 0) { - args = ['install']; -} - -(function npm() { - let timer; - args.push('--verbose'); - let proc = spawn('npm', args); - proc.stdout.pipe(process.stdout); - proc.stderr.pipe(process.stderr); - proc.stdin.end(); - proc.stdout.on('data', () => { - setTimer(); - }); - proc.stderr.on('data', () => { - setTimer(); - }); - - // side effect: this also restarts when npm exits with a bad code even if it - // didnt timeout - proc.on('close', (code, signal) => { - clearTimeout(timer); - if (code || signal) { - console.log('[npm-are-you-sleeping] npm exited with code ' + code + ''); - - if (--attempts) { - console.log('[npm-are-you-sleeping] restarting'); - npm(); - } else { - console.log('[npm-are-you-sleeping] i tried lots of times. giving up.'); - throw new Error("npm install fails"); - } - } - }); - - function setTimer() { - clearTimeout(timer); - timer = setTimeout(() => { - console.log('[npm-are-you-sleeping] killing npm with SIGTERM'); - proc.kill('SIGTERM'); - // wait a couple seconds - timer = setTimeout(() => { - // its it's still not closed sigkill - console.log('[npm-are-you-sleeping] killing npm with SIGKILL'); - proc.kill('SIGKILL'); - }, 2000); - }, timeout); - } -})(); From f7631cf3144533a100ab7827b273d545e89da1ff Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 11 Dec 2018 10:36:30 -0800 Subject: [PATCH 052/429] chore: update nyc and eslint configs (#77) --- packages/google-cloud-asset/.eslintignore | 1 + packages/google-cloud-asset/.nycrc | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore index 2f642cb6044..f0c7aead4bf 100644 --- a/packages/google-cloud-asset/.eslintignore +++ b/packages/google-cloud-asset/.eslintignore @@ -1,3 +1,4 @@ **/node_modules src/**/doc/* build/ +docs/ diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index feb032400d4..88b001cb587 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -1,5 +1,6 @@ { "report-dir": "./.coverage", + "reporter": "lcov", "exclude": [ "src/*{/*,/**/*}.js", "src/*/v*/*.js", From a3e457c666640846373041000a083de43c3ba4cd Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 12 Dec 2018 22:58:43 -0800 Subject: [PATCH 053/429] fix: fix sample tests (#79) --- packages/google-cloud-asset/samples/package.json | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 359ae4253bc..0b2d6e52c50 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -1,7 +1,6 @@ { "name": "@google-cloud/asset-samples", "description": "Samples for the Cloud Asset API Client Library for Node.js.", - "version": "0.0.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { @@ -12,24 +11,18 @@ ], "repository": "googleapis/nodejs-asset", "private": true, - "nyc": { - "exclude": [ - "**/*.test.js" - ] - }, "scripts": { "test": "mocha system-test --timeout 20000" }, "dependencies": { "@google-cloud/asset": "^0.1.1", "@google-cloud/storage": "^2.3.0", - "express": "^4.16.4", "uuid": "^3.3.2", "yargs": "^12.0.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.0.0", - "mocha": "^5.2.0", - "sinon": "^7.0.0" + "chai": "^4.2.0", + "execa": "^1.0.0", + "mocha": "^5.2.0" } } From d562537a3acaf72dc1a6af79e0fae986b1d147c9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 2 Jan 2019 15:12:34 -0600 Subject: [PATCH 054/429] refactor: drop requirement of setting GCLOUD_PROJECT (#81) --- packages/google-cloud-asset/samples/quickstart.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index d0fa28c2f90..e75e5e6ca08 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -23,7 +23,8 @@ async function exportAssets(dumpFilePath) { }); // Your Google Cloud Platform project ID - const projectId = process.env.GCLOUD_PROJECT; + const projectId = await client.getProjectId(); + console.log(projectId); const projectResource = client.projectPath(projectId); // var dumpFilePath = 'Dump file path, e.g.: gs:///' @@ -55,7 +56,7 @@ async function batchGetAssetsHistory(assetNames) { }); // Your Google Cloud Platform project ID - const projectId = process.env.GCLOUD_PROJECT; + const projectId = await client.getProjectId(); const projectResource = client.projectPath(projectId); // Your asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. // var assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; From 3516db50585bfe0c845b976f0060fa3c49a227f7 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Fri, 11 Jan 2019 15:09:09 -0800 Subject: [PATCH 055/429] fix(docs): broken links in README.md (#84) --- packages/google-cloud-asset/.cloud-repo-tools.json | 4 ++-- packages/google-cloud-asset/README.md | 4 ++-- packages/google-cloud-asset/samples/quickstart.js | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/.cloud-repo-tools.json b/packages/google-cloud-asset/.cloud-repo-tools.json index a040dad1f74..29239a36b73 100644 --- a/packages/google-cloud-asset/.cloud-repo-tools.json +++ b/packages/google-cloud-asset/.cloud-repo-tools.json @@ -2,7 +2,7 @@ "requiresKeyFile": true, "requiresProjectId": true, "product": "asset", + "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/asset/latest/", "release_quality": "alpha", - "samples": [ - ] + "samples": [] } diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 828b2dbe7db..d0427b812e2 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -40,7 +40,7 @@ }); // Your Google Cloud Platform project ID - const projectId = process.env.GCLOUD_PROJECT; + const projectId = await client.getProjectId(); const projectResource = client.projectPath(projectId); // var dumpFilePath = 'Dump file path, e.g.: gs:///' @@ -99,7 +99,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [explained]: https://cloud.google.com/apis/docs/client-libraries-explained -[client-docs]: +[client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/ [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index e75e5e6ca08..682cc327ef0 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -24,7 +24,6 @@ async function exportAssets(dumpFilePath) { // Your Google Cloud Platform project ID const projectId = await client.getProjectId(); - console.log(projectId); const projectResource = client.projectPath(projectId); // var dumpFilePath = 'Dump file path, e.g.: gs:///' From 9e7ece53685ca31496c620fdd76984ee995f27e2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 14 Jan 2019 11:46:17 -0800 Subject: [PATCH 056/429] fix(deps): update dependency google-gax to ^0.23.0 (#85) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b9aaaa141f9..470658be292 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -40,7 +40,7 @@ "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.22.0", + "google-gax": "^0.23.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 50179d07e90a1aa48321cb7235e712dab381b713 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 14 Jan 2019 11:57:04 -0800 Subject: [PATCH 057/429] refactor: remove unused IAM protobuf objects (#83) --- .../v1beta1/doc/google/iam/v1/doc_policy.js | 44 ---------- .../doc/google/longrunning/doc_operations.js | 84 ------------------- packages/google-cloud-asset/synth.metadata | 36 +++++--- 3 files changed, 24 insertions(+), 140 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 59fca18810c..5e7237e0fa9 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -115,48 +115,4 @@ const Policy = { */ const Binding = { // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The difference delta between two policies. - * - * @property {Object[]} bindingDeltas - * The delta for Bindings between two policies. - * - * This object should have the same structure as [BindingDelta]{@link google.iam.v1.BindingDelta} - * - * @typedef PolicyDelta - * @memberof google.iam.v1 - * @see [google.iam.v1.PolicyDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const PolicyDelta = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * One delta entry for Binding. Each individual change (only one member in each - * entry) to a binding will be a separate entry. - * - * @property {number} action - * The action that was performed on a Binding. - * Required - * - * The number should be among the values of [Action]{@link google.iam.v1.Action} - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required - * - * @property {string} member - * A single identity requesting access for a Cloud Platform resource. - * Follows the same format of Binding.members. - * Required - * - * @typedef BindingDelta - * @memberof google.iam.v1 - * @see [google.iam.v1.BindingDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const BindingDelta = { - // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js index 4af5d7d3574..e6dd81d4eea 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -60,88 +60,4 @@ */ const Operation = { // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.GetOperation. - * - * @property {string} name - * The name of the operation resource. - * - * @typedef GetOperationRequest - * @memberof google.longrunning - * @see [google.longrunning.GetOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const GetOperationRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.ListOperations. - * - * @property {string} name - * The name of the operation collection. - * - * @property {string} filter - * The standard list filter. - * - * @property {number} pageSize - * The standard list page size. - * - * @property {string} pageToken - * The standard list page token. - * - * @typedef ListOperationsRequest - * @memberof google.longrunning - * @see [google.longrunning.ListOperationsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const ListOperationsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The response message for Operations.ListOperations. - * - * @property {Object[]} operations - * A list of operations that matches the specified filter in the request. - * - * This object should have the same structure as [Operation]{@link google.longrunning.Operation} - * - * @property {string} nextPageToken - * The standard List next-page token. - * - * @typedef ListOperationsResponse - * @memberof google.longrunning - * @see [google.longrunning.ListOperationsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const ListOperationsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.CancelOperation. - * - * @property {string} name - * The name of the operation resource to be cancelled. - * - * @typedef CancelOperationRequest - * @memberof google.longrunning - * @see [google.longrunning.CancelOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const CancelOperationRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message for Operations.DeleteOperation. - * - * @property {string} name - * The name of the operation resource to be deleted. - * - * @typedef DeleteOperationRequest - * @memberof google.longrunning - * @see [google.longrunning.DeleteOperationRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const DeleteOperationRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f26e69af884..fc222222956 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,26 +1,38 @@ { + "updateTime": "2019-01-03T17:55:38.797029Z", "sources": [ + { + "generator": { + "name": "artman", + "version": "0.16.4", + "dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5a57f0c13a358b2b15452bf2d67453774a5f6d4f", - "internalRef": "221837528" + "sha": "2a5caab4315cb5ab3d5c97c90c6d4e9441052b16", + "internalRef": "227195651" } }, { - "git": { - "name": "googleapis-private", - "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "6aa8e1a447bb8d0367150356a28cb4d3f2332641", - "internalRef": "221340946" + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2018.12.6" } - }, + } + ], + "destinations": [ { - "generator": { - "name": "artman", - "version": "0.16.0", - "dockerImage": "googleapis/artman@sha256:90f9d15e9bad675aeecd586725bce48f5667ffe7d5fc4d1e96d51ff34304815b" + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" } } ] From 01abcf62715533c69b4655233507c6035e315175 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 15 Jan 2019 12:39:38 -0800 Subject: [PATCH 058/429] build: check broken links in generated docs (#82) --- packages/google-cloud-asset/.jsdoc.js | 2 +- packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/src/index.js | 6 ++++++ .../src/v1beta1/doc/google/protobuf/doc_timestamp.js | 6 ++---- packages/google-cloud-asset/synth.py | 11 +++++++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 9e32e521370..8a3eef2f267 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/ink-docstrap/template', + template: './node_modules/jsdoc-baseline', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 470658be292..bdec4574825 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -51,7 +51,7 @@ "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", - "ink-docstrap": "^1.3.2", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.2.0", diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js index a0d2ad6f8d2..7496f49cd6e 100644 --- a/packages/google-cloud-asset/src/index.js +++ b/packages/google-cloud-asset/src/index.js @@ -33,6 +33,12 @@ /** * @namespace google.type */ +/** + * @namespace google.iam.v1 + */ +/** + * @namespace google.longrunning + */ 'use strict'; diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 1ebe2e6e1a5..1cc64cbed80 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -87,13 +87,11 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- - * ) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index bf03aee86e0..e943f386cb6 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -33,6 +33,17 @@ templates = common_templates.node_library() s.copy(templates) +# [START fix-dead-link] +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', + r"https://\1)") + +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'toISOString\]', + 'toISOString)') +# [END fix-dead-link] + + # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) From 941bf07cbf7b994bf7428ec7c2453925879488f1 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Wed, 16 Jan 2019 13:35:20 -0800 Subject: [PATCH 059/429] fix(docs): www discovery link (#87) --- .../src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js | 4 ++-- packages/google-cloud-asset/synth.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index de6df65b168..a3fc72cae71 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -102,7 +102,7 @@ const Asset = { * @property {string} discoveryDocumentUri * The URL of the discovery document containing the resource's JSON schema. * For example: - * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. + * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). * It will be left unspecified for resources without a discovery-based API, * such as Cloud Bigtable. * @@ -141,4 +141,4 @@ const Asset = { */ const Resource = { // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file +}; diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index e943f386cb6..d99c9cd760f 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -34,6 +34,11 @@ s.copy(templates) # [START fix-dead-link] +discovery_url = 'https://www.googleapis.com/discovery/v1/apis/compute/v1/rest' +s.replace('**/doc/google/cloud/asset/v1beta1/doc_assets.js', + f'`"{discovery_url}"`' + f'[`"{discovery_url}"`]({discovery_url})') + s.replace('**/doc/google/protobuf/doc_timestamp.js', 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', r"https://\1)") From 41d87d3292a5b63dccb16e1e97db7bbff69fd484 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 17 Jan 2019 18:35:12 -0800 Subject: [PATCH 060/429] build: update the docs 404 rules (#86) --- packages/google-cloud-asset/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index fc222222956..313e36e62ee 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-01-03T17:55:38.797029Z", + "updateTime": "2019-01-16T12:23:48.319165Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.4", - "dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857" + "version": "0.16.5", + "dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2a5caab4315cb5ab3d5c97c90c6d4e9441052b16", - "internalRef": "227195651" + "sha": "7a81902f287a4ac2ac130994889c80f87f91d035", + "internalRef": "229452079" } }, { From 5b83e52b7fff850b0255c322f5c3f809651ad13e Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 21 Jan 2019 09:07:28 -0800 Subject: [PATCH 061/429] fix(synth): insert missing comma (#89) --- packages/google-cloud-asset/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index d99c9cd760f..13bf4b38f86 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -36,7 +36,7 @@ # [START fix-dead-link] discovery_url = 'https://www.googleapis.com/discovery/v1/apis/compute/v1/rest' s.replace('**/doc/google/cloud/asset/v1beta1/doc_assets.js', - f'`"{discovery_url}"`' + f'`"{discovery_url}"`', f'[`"{discovery_url}"`]({discovery_url})') s.replace('**/doc/google/protobuf/doc_timestamp.js', From 505a70c8cd4c43939b40f7e655aa565070a8d0f1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 22 Jan 2019 10:13:59 -0800 Subject: [PATCH 062/429] fix(proto): update the asset service proto and comments (#90) --- .../cloud/asset/v1beta1/asset_service.proto | 48 ++++++++++++------- .../google/cloud/asset/v1beta1/assets.proto | 8 ++-- .../src/v1beta1/asset_service_client.js | 33 ++++++++----- .../cloud/asset/v1beta1/doc_asset_service.js | 39 +++++++++------ .../google/cloud/asset/v1beta1/doc_assets.js | 12 ++--- .../v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../doc/google/longrunning/doc_operations.js | 2 +- .../v1beta1/doc/google/protobuf/doc_any.js | 2 +- .../v1beta1/doc/google/protobuf/doc_struct.js | 2 +- .../doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1beta1/doc/google/rpc/doc_status.js | 2 +- .../google-cloud-asset/src/v1beta1/index.js | 2 +- packages/google-cloud-asset/synth.metadata | 12 ++--- .../google-cloud-asset/test/gapic-v1beta1.js | 2 +- 14 files changed, 100 insertions(+), 68 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto index aaaa0ba223b..16e0789ebc4 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -40,6 +40,10 @@ service AssetService { option (google.api.http) = { post: "/v1beta1/{parent=projects/*}:exportAssets" body: "*" + additional_bindings { + post: "/v1beta1/{parent=folders/*}:exportAssets" + body: "*" + } additional_bindings { post: "/v1beta1/{parent=organizations/*}:exportAssets" body: "*" @@ -64,20 +68,24 @@ service AssetService { // Export asset request. message ExportAssetsRequest { - // Required. The relative name of the root asset. This can only be an organization - // number (such as "organizations/123"), a project ID (such as - // "projects/my-project-id"), or a project number (such as "projects/12345"). + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), a project number (such as "projects/12345"), or + // a folder number (such as "folders/123"). string parent = 1; - // Timestamp to take an asset snapshot. This can only be set to a timestamp in - // the past or of the current time. If not specified, the current time will be - // used. Due to delays in resource data collection and indexing, there is a - // volatile window during which running the same query may get different - // results. + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between 2018-10-02 UTC (inclusive) and the current time. If not specified, + // the current time will be used. Due to delays in resource data collection + // and indexing, there is a volatile window during which running the same + // query may get different results. google.protobuf.Timestamp read_time = 2; // A list of asset types of which to take a snapshot for. For example: - // "google.compute.disk". If specified, only matching assets will be returned. + // "google.compute.Disk". If specified, only matching assets will be returned. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. repeated string asset_types = 3; // Asset content type. If not specified, no content but the asset name will be @@ -120,9 +128,12 @@ message BatchGetAssetsHistoryRequest { // Required. The content type. ContentType content_type = 3; - // Required. The time window for the asset history. The start time is - // required. The returned results contain all temporal assets whose time - // window overlap with read_time_window. + // Optional. The time window for the asset history. Both start_time and + // end_time are optional and if set, it must be after 2018-10-02 UTC. If + // end_time is not set, it is default to current timestamp. If start_time is + // not set, the snapshot of the assets at end_time will be returned. The + // returned results contain all temporal assets whose time window overlap with + // read_time_window. TimeWindow read_time_window = 4; } @@ -143,10 +154,15 @@ message OutputConfig { // A Cloud Storage location. message GcsDestination { - // The path of the Cloud Storage objects. It's the same path that is used by - // gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - // for more information. - string uri = 1; + // Required. + oneof object_uri { + // The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1; + } } // Asset content type. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto index 5d339a20f00..cde70cddfc0 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -44,12 +44,12 @@ message TemporalAsset { Asset asset = 3; } -// A time window of [start_time, end_time). +// A time window of (start_time, end_time]. message TimeWindow { - // Start time of the time window (inclusive). + // Start time of the time window (exclusive). google.protobuf.Timestamp start_time = 1; - // End time of the time window (exclusive). + // End time of the time window (inclusive). // Current timestamp if not specified. google.protobuf.Timestamp end_time = 2; } @@ -62,7 +62,7 @@ message Asset { // for more information. string name = 1; - // Type of the asset. Example: "google.compute.disk". + // Type of the asset. Example: "google.compute.Disk". string asset_type = 2; // Representation of the resource. diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 4004fcf77f8..c8f25d5850d 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -220,25 +220,29 @@ class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an organization - * number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"). + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), a project number (such as "projects/12345"), or + * a folder number (such as "folders/123"). * @param {Object} request.outputConfig * Required. Output configuration indicating where the results will be output * to. All results will be in newline delimited JSON format. * * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp in - * the past or of the current time. If not specified, the current time will be - * used. Due to delays in resource data collection and indexing, there is a - * volatile window during which running the same query may get different - * results. + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {string[]} [request.assetTypes] * A list of asset types of which to take a snapshot for. For example: - * "google.compute.disk". If specified, only matching assets will be returned. + * "google.compute.Disk". If specified, only matching assets will be returned. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. * @param {number} [request.contentType] * Asset content type. If not specified, no content but the asset name will be * returned. @@ -355,9 +359,12 @@ class AssetServiceClient { * * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * @param {Object} request.readTimeWindow - * Required. The time window for the asset history. The start time is - * required. The returned results contain all temporal assets whose time - * window overlap with read_time_window. + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. * * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} * @param {string[]} [request.assetNames] diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js index b9d7246991e..61e2fd72af3 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,22 +19,26 @@ * Export asset request. * * @property {string} parent - * Required. The relative name of the root asset. This can only be an organization - * number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"). + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), a project number (such as "projects/12345"), or + * a folder number (such as "folders/123"). * * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp in - * the past or of the current time. If not specified, the current time will be - * used. Due to delays in resource data collection and indexing, there is a - * volatile window during which running the same query may get different - * results. + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {string[]} assetTypes * A list of asset types of which to take a snapshot for. For example: - * "google.compute.disk". If specified, only matching assets will be returned. + * "google.compute.Disk". If specified, only matching assets will be returned. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. * * @property {number} contentType * Asset content type. If not specified, no content but the asset name will be @@ -103,9 +107,12 @@ const ExportAssetsResponse = { * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * * @property {Object} readTimeWindow - * Required. The time window for the asset history. The start time is - * required. The returned results contain all temporal assets whose time - * window overlap with read_time_window. + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. * * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} * @@ -153,8 +160,10 @@ const OutputConfig = { * A Cloud Storage location. * * @property {string} uri - * The path of the Cloud Storage objects. It's the same path that is used by - * gsutil. For example: "gs://bucket_name/object_path". See [Viewing and Editing Object Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * The uri of the Cloud Storage object. It's the same uri that is used by + * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) * for more information. * * @typedef GcsDestination diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index a3fc72cae71..e8859163e7f 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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,15 +41,15 @@ const TemporalAsset = { }; /** - * A time window of [start_time, end_time). + * A time window of (start_time, end_time]. * * @property {Object} startTime - * Start time of the time window (inclusive). + * Start time of the time window (exclusive). * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {Object} endTime - * End time of the time window (exclusive). + * End time of the time window (inclusive). * Current timestamp if not specified. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} @@ -72,7 +72,7 @@ const TimeWindow = { * for more information. * * @property {string} assetType - * Type of the asset. Example: "google.compute.disk". + * Type of the asset. Example: "google.compute.Disk". * * @property {Object} resource * Representation of the resource. @@ -141,4 +141,4 @@ const Asset = { */ const Resource = { // This is for documentation. Actual contents will be loaded by gRPC. -}; +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 5e7237e0fa9..bcae4a7d873 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js index e6dd81d4eea..bd03cc3da0e 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js index 3accb1fc0d8..f3278b34e66 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js index ddf7e5c95dc..ae7e4ef1ff6 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 1cc64cbed80..b47f41c2b30 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js index 13cfcab1021..fc4b5be93f0 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/src/v1beta1/index.js b/packages/google-cloud-asset/src/v1beta1/index.js index e2d8ba4f042..11b31911e6a 100644 --- a/packages/google-cloud-asset/src/v1beta1/index.js +++ b/packages/google-cloud-asset/src/v1beta1/index.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 313e36e62ee..21ce7c0f3d3 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-01-16T12:23:48.319165Z", + "updateTime": "2019-01-22T12:19:14.185087Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.5", - "dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c" + "version": "0.16.7", + "dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7a81902f287a4ac2ac130994889c80f87f91d035", - "internalRef": "229452079" + "sha": "96adaf6de4fa2cabbdd5de560a367bb488e0639b", + "internalRef": "229998977" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2018.12.6" + "version": "2019.1.16" } } ], diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index 64614d4cbf6..6e3d7f9445a 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 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 67c8d3802143d47c3668fc40f022eec1e927b9ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 25 Jan 2019 09:53:55 -0800 Subject: [PATCH 063/429] fix(deps): update dependency google-gax to ^0.24.0 (#92) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index bdec4574825..d9c178dbb85 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -40,7 +40,7 @@ "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.23.0", + "google-gax": "^0.24.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From f982a9774958f5516f1713e902402679097e8609 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 26 Jan 2019 12:54:18 -0500 Subject: [PATCH 064/429] chore(deps): update dependency eslint-config-prettier to v4 (#93) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index d9c178dbb85..7dfc1ab19e1 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -48,7 +48,7 @@ "@google-cloud/nodejs-repo-tools": "^3.0.0", "codecov": "^3.0.4", "eslint": "^5.1.0", - "eslint-config-prettier": "^3.0.0", + "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", From 0ea999afe603972dde602ae7b8eccf5c02009844 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 30 Jan 2019 12:18:28 -0800 Subject: [PATCH 065/429] fix(deps): update dependency google-gax to ^0.25.0 (#94) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 7dfc1ab19e1..7ff42eb117d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -40,7 +40,7 @@ "fix": "eslint --fix '**/*.js'" }, "dependencies": { - "google-gax": "^0.24.0", + "google-gax": "^0.25.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 599ad226150a37b04ef7102fc2dca0aa046c9f45 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 31 Jan 2019 13:38:42 -0800 Subject: [PATCH 066/429] Release v0.2.0 (#95) --- packages/google-cloud-asset/CHANGELOG.md | 18 ++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 4e9adc2d5e8..017d2f8429f 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,24 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## v0.2.0 + +01-31-2019 10:32 PST + +### Implementation Changes +- refactor: remove unused IAM protobuf objects ([#83](https://github.com/googleapis/nodejs-asset/pull/83)) +- refactor: drop requirement of setting GCLOUD_PROJECT ([#81](https://github.com/googleapis/nodejs-asset/pull/81)) + +### New Features +- fix(proto): add support for folders ([#90](https://github.com/googleapis/nodejs-asset/pull/90)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#94](https://github.com/googleapis/nodejs-asset/pull/94)) + +### Documentation +- fix(docs): www discovery link ([#87](https://github.com/googleapis/nodejs-asset/pull/87)) +- fix(docs): broken links in README.md ([#84](https://github.com/googleapis/nodejs-asset/pull/84)) + ## v0.1.1 12-04-2018 14:41 PST diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 7ff42eb117d..3206cee752b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "0.1.1", + "version": "0.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 0b2d6e52c50..80c99afc7e9 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha system-test --timeout 20000" }, "dependencies": { - "@google-cloud/asset": "^0.1.1", + "@google-cloud/asset": "^0.2.0", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^12.0.0" From 66adc4634dc00c999652074b5af248193d320ec9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Sat, 2 Feb 2019 10:35:45 -0800 Subject: [PATCH 067/429] refactor: improve generated code style. (#96) --- .../src/v1beta1/asset_service_client.js | 11 ++--------- packages/google-cloud-asset/synth.metadata | 10 +++++----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index c8f25d5850d..0a6bb392452 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -277,20 +277,14 @@ class AssetServiceClient { * // Handle the operation using the promise pattern. * client.exportAssets(request) * .then(responses => { - * const operation = responses[0]; - * const initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. * const result = responses[0]; - * - * // The metadata value of the completed operation. * const metadata = responses[1]; - * - * // The response of the api call returning the complete operation. * const finalApiResponse = responses[2]; * }) * .catch(err => { @@ -307,8 +301,7 @@ class AssetServiceClient { * // Handle the operation using the event emitter pattern. * client.exportAssets(request) * .then(responses => { - * const operation = responses[0]; - * const initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 21ce7c0f3d3..18a010d8119 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-01-22T12:19:14.185087Z", + "updateTime": "2019-02-02T12:07:39.907100Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.7", - "dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80" + "version": "0.16.8", + "dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "96adaf6de4fa2cabbdd5de560a367bb488e0639b", - "internalRef": "229998977" + "sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a", + "internalRef": "231974277" } }, { From 82286c69ac0582bad61e0af916bb32445da0236a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 7 Feb 2019 15:30:12 -0800 Subject: [PATCH 068/429] chore: move CONTRIBUTING.md to root (#99) --- packages/google-cloud-asset/CONTRIBUTING.md | 57 ++++++++++++++++++ .../__pycache__/synth.cpython-36.pyc | Bin 0 -> 1153 bytes 2 files changed, 57 insertions(+) create mode 100644 packages/google-cloud-asset/CONTRIBUTING.md create mode 100644 packages/google-cloud-asset/__pycache__/synth.cpython-36.pyc diff --git a/packages/google-cloud-asset/CONTRIBUTING.md b/packages/google-cloud-asset/CONTRIBUTING.md new file mode 100644 index 00000000000..b958f235007 --- /dev/null +++ b/packages/google-cloud-asset/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# 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. 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: + + npm 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-asset/__pycache__/synth.cpython-36.pyc b/packages/google-cloud-asset/__pycache__/synth.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ec747931776f8e130c17e225beb5469298da9f1 GIT binary patch literal 1153 zcmY*XOK;pZ5Y}7Trytq0O_K%-UlJ`45k`Ay5EM-u!_6TN)bWLpA!|iimLiFQNZDRp zefBR1`~&)zbPW)oKrg-Klo5ArI1)IV`8Xfv!TEJG>VNtFFMnby%4g-)=YakvEdCz| zqF{xnM9WmH$z4wkY)H+-rra%TQ7g4!IYhryRfQU9??S4e-PKgU{kBVAhe$%9yz5wv~9{iS*F{v_d3 z9#u&xrl8fFlBr-*z9_^ADD%EKavGFB4_1uGA45$0KAN$iQM;X%ZT<0KBsP@Le+6^+%R ztVK|SIcHWR?{N?LiFDK2g45N=>OaW#Eq~g%?D60wO&9f6BO8yj~ zv$HcVW-QKVSSH+ySdK`-BX&xw1v=eE9f|;jV6?L<%0+`_GelT~mP8~=Kr&x&kyUob zfkb$hlXkS#Xj?~({s9zY>*(p9dBQO;XCV{r_T+QB^J zNwgzhu{B@rzBt&!6+E*Rb(Z;%?8t_|cr%eFs S>z&nCCz_>ds Date: Thu, 7 Feb 2019 18:45:56 -0800 Subject: [PATCH 069/429] docs: update contributing path in README (#100) --- packages/google-cloud-asset/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index d0427b812e2..8615ff730c9 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -80,7 +80,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/blob/master/.github/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/blob/master/CONTRIBUTING.md). ## License From 6ffd2f69a7f78d9c9a3c54f288748c13fd88e7aa Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 8 Feb 2019 07:03:07 -0800 Subject: [PATCH 070/429] chore: ignore cache directories (#102) --- packages/google-cloud-asset/.gitignore | 1 + .../__pycache__/synth.cpython-36.pyc | Bin 1153 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100644 packages/google-cloud-asset/__pycache__/synth.cpython-36.pyc diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index 95fcedf6538..97cdf45ca3b 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -9,3 +9,4 @@ system-test/*key.json *.lock **/package-lock.json .DS_Store +__pycache__ diff --git a/packages/google-cloud-asset/__pycache__/synth.cpython-36.pyc b/packages/google-cloud-asset/__pycache__/synth.cpython-36.pyc deleted file mode 100644 index 1ec747931776f8e130c17e225beb5469298da9f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1153 zcmY*XOK;pZ5Y}7Trytq0O_K%-UlJ`45k`Ay5EM-u!_6TN)bWLpA!|iimLiFQNZDRp zefBR1`~&)zbPW)oKrg-Klo5ArI1)IV`8Xfv!TEJG>VNtFFMnby%4g-)=YakvEdCz| zqF{xnM9WmH$z4wkY)H+-rra%TQ7g4!IYhryRfQU9??S4e-PKgU{kBVAhe$%9yz5wv~9{iS*F{v_d3 z9#u&xrl8fFlBr-*z9_^ADD%EKavGFB4_1uGA45$0KAN$iQM;X%ZT<0KBsP@Le+6^+%R ztVK|SIcHWR?{N?LiFDK2g45N=>OaW#Eq~g%?D60wO&9f6BO8yj~ zv$HcVW-QKVSSH+ySdK`-BX&xw1v=eE9f|;jV6?L<%0+`_GelT~mP8~=Kr&x&kyUob zfkb$hlXkS#Xj?~({s9zY>*(p9dBQO;XCV{r_T+QB^J zNwgzhu{B@rzBt&!6+E*Rb(Z;%?8t_|cr%eFs S>z&nCCz_>ds Date: Sun, 10 Feb 2019 20:52:43 -0800 Subject: [PATCH 071/429] build: create docs test npm scripts (#104) --- packages/google-cloud-asset/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 3206cee752b..f4a7e4dbbde 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -37,7 +37,9 @@ "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", "test": "npm run cover", - "fix": "eslint --fix '**/*.js'" + "fix": "eslint --fix '**/*.js'", + "docs-test": "blcl docs -r --exclude www.googleapis.com", + "predocs-test": "npm run docs" }, "dependencies": { "google-gax": "^0.25.0", @@ -57,6 +59,7 @@ "mocha": "^5.2.0", "nyc": "^13.0.0", "power-assert": "^1.6.0", - "prettier": "^1.13.7" + "prettier": "^1.13.7", + "broken-link-checker-local": "^0.2.0" } } From aa080e0ba4822a074d5fdaede7f8241702ccfa1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 12 Feb 2019 12:08:35 -0500 Subject: [PATCH 072/429] fix(deps): update dependency yargs to v13 (#105) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 80c99afc7e9..b6ac1d177b2 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -18,7 +18,7 @@ "@google-cloud/asset": "^0.2.0", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", - "yargs": "^12.0.0" + "yargs": "^13.0.0" }, "devDependencies": { "chai": "^4.2.0", From 974d9989de7334fd10db20646928060665fae79e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Feb 2019 08:47:53 -0800 Subject: [PATCH 073/429] docs: update links in contrib guide (#108) --- packages/google-cloud-asset/CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/CONTRIBUTING.md b/packages/google-cloud-asset/CONTRIBUTING.md index b958f235007..78aaa61b269 100644 --- a/packages/google-cloud-asset/CONTRIBUTING.md +++ b/packages/google-cloud-asset/CONTRIBUTING.md @@ -16,11 +16,9 @@ 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). + 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). + 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 From d2baa7a168c4114d54cf4cd2dc7b0da28d6e27bc Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Feb 2019 12:11:06 -0800 Subject: [PATCH 074/429] build: use linkinator for docs test (#107) --- packages/google-cloud-asset/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index f4a7e4dbbde..a3498cb7bba 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -38,7 +38,7 @@ "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "blcl docs -r --exclude www.googleapis.com", + "docs-test": "linkinator docs -r --skip www.googleapis.com", "predocs-test": "npm run docs" }, "dependencies": { @@ -60,6 +60,6 @@ "nyc": "^13.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7", - "broken-link-checker-local": "^0.2.0" + "linkinator": "^1.1.2" } } From 3e0210679f6dbcd4303802fb60e76c46626597e7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 14 Feb 2019 13:40:38 -0800 Subject: [PATCH 075/429] fix: throw on invalid credentials --- .../src/v1beta1/asset_service_client.js | 4 ++++ packages/google-cloud-asset/synth.metadata | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 0a6bb392452..6d20ed7812b 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -168,6 +168,10 @@ class AssetServiceClient { function() { const args = Array.prototype.slice.call(arguments, 0); return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; } ), defaults[methodName], diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 18a010d8119..6a4caa47364 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-02-02T12:07:39.907100Z", + "updateTime": "2019-02-13T12:07:57.024829Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.8", - "dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7" + "version": "0.16.13", + "dockerImage": "googleapis/artman@sha256:5fd9aee1d82a00cebf425c8fa431f5457539562f5867ad9c54370f0ec9a7ccaa" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a", - "internalRef": "231974277" + "sha": "ca61898878f0926dd9dcc68ba90764f17133efe4", + "internalRef": "233680013" } }, { From 89d99b4c0f3e30670b3b51e1e4cce96a38919bc1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 19 Feb 2019 10:04:07 -0800 Subject: [PATCH 076/429] chore(deps): update dependency mocha to v6 chore(deps): update dependency mocha to v6 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | mocha | devDependencies | major | `^5.2.0` -> `^6.0.0` | [homepage](https://mochajs.org/), [source](https://togithub.com/mochajs/mocha) | --- ### Release Notes

mochajs/mocha ### [`v6.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​600--2019-02-18) [Compare Source](https://togithub.com/mochajs/mocha/compare/v5.2.0...v6.0.0) #### :tada: Enhancements - [#​3726](https://togithub.com/mochajs/mocha/issues/3726): Add ability to unload files from `require` cache ([**@​plroebuck**](https://togithub.com/plroebuck)) #### :bug: Fixes - [#​3737](https://togithub.com/mochajs/mocha/issues/3737): Fix falsy values from options globals ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3707](https://togithub.com/mochajs/mocha/issues/3707): Fix encapsulation issues for `Suite#_onlyTests` and `Suite#_onlySuites` ([**@​vkarpov15**](https://togithub.com/vkarpov15)) - [#​3711](https://togithub.com/mochajs/mocha/issues/3711): Fix diagnostic messages dealing with plurality and markup of output ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3723](https://togithub.com/mochajs/mocha/issues/3723): Fix "reporter-option" to allow comma-separated options ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3722](https://togithub.com/mochajs/mocha/issues/3722): Fix code quality and performance of `lookupFiles` and `files` ([**@​plroebuck**](https://togithub.com/plroebuck)) - [#​3650](https://togithub.com/mochajs/mocha/issues/3650), [#​3654](https://togithub.com/mochajs/mocha/issues/3654): Fix noisy error message when no files found ([**@​craigtaub**](https://togithub.com/craigtaub)) - [#​3632](https://togithub.com/mochajs/mocha/issues/3632): Tests having an empty title are no longer confused with the "root" suite ([**@​juergba**](https://togithub.com/juergba)) - [#​3666](https://togithub.com/mochajs/mocha/issues/3666): Fix missing error codes ([**@​vkarpov15**](https://togithub.com/vkarpov15)) - [#​3684](https://togithub.com/mochajs/mocha/issues/3684): Fix exiting problem in Node.js v11.7.0+ ([**@​addaleax**](https://togithub.com/addaleax)) - [#​3691](https://togithub.com/mochajs/mocha/issues/3691): Fix `--delay` (and other boolean options) not working in all cases ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3692](https://togithub.com/mochajs/mocha/issues/3692): Fix invalid command-line argument usage not causing actual errors ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3698](https://togithub.com/mochajs/mocha/issues/3698), [#​3699](https://togithub.com/mochajs/mocha/issues/3699): Fix debug-related Node.js options not working in all cases ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3700](https://togithub.com/mochajs/mocha/issues/3700): Growl notifications now show the correct number of tests run ([**@​outsideris**](https://togithub.com/outsideris)) - [#​3686](https://togithub.com/mochajs/mocha/issues/3686): Avoid potential ReDoS when diffing large objects ([**@​cyjake**](https://togithub.com/cyjake)) - [#​3715](https://togithub.com/mochajs/mocha/issues/3715): Fix incorrect order of emitted events when used programmatically ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3706](https://togithub.com/mochajs/mocha/issues/3706): Fix regression wherein `--reporter-option`/`--reporter-options` did not support comma-separated key/value pairs ([**@​boneskull**](https://togithub.com/boneskull)) #### :book: Documentation - [#​3652](https://togithub.com/mochajs/mocha/issues/3652): Switch from Jekyll to Eleventy ([**@​Munter**](https://togithub.com/Munter)) #### :nut_and_bolt: Other - [#​3677](https://togithub.com/mochajs/mocha/issues/3677): Add error objects for createUnsupportedError and createInvalidExceptionError ([**@​boneskull**](https://togithub.com/boneskull)) - [#​3733](https://togithub.com/mochajs/mocha/issues/3733): Removed unnecessary processing in post-processing hook ([**@​wanseob**](https://togithub.com/wanseob)) - [#​3730](https://togithub.com/mochajs/mocha/issues/3730): Update nyc to latest version ([**@​coreyfarrell**](https://togithub.com/coreyfarrell)) - [#​3648](https://togithub.com/mochajs/mocha/issues/3648), [#​3680](https://togithub.com/mochajs/mocha/issues/3680): Fixes to support latest versions of [unexpected](https://npm.im/unexpected) and [unexpected-sinon](https://npm.im/unexpected-sinon) ([**@​sunesimonsen**](https://togithub.com/sunesimonsen)) - [#​3638](https://togithub.com/mochajs/mocha/issues/3638): Add meta tag to site ([**@​MartijnCuppens**](https://togithub.com/MartijnCuppens)) - [#​3653](https://togithub.com/mochajs/mocha/issues/3653): Fix parts of test suite failing to run on Windows ([**@​boneskull**](https://togithub.com/boneskull))
--- ### 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 stale, or if you modify the PR title to begin with "`rebase!`". :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 [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-asset). #109 automerged by dpebot --- packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index a3498cb7bba..b70be802776 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -56,7 +56,7 @@ "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", - "mocha": "^5.2.0", + "mocha": "^6.0.0", "nyc": "^13.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7", diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index b6ac1d177b2..5120cf38b94 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -23,6 +23,6 @@ "devDependencies": { "chai": "^4.2.0", "execa": "^1.0.0", - "mocha": "^5.2.0" + "mocha": "^6.0.0" } } From 21ee2ab55ffc23e74c8c7d863e410de4665081d0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 26 Feb 2019 05:54:45 -0800 Subject: [PATCH 077/429] chore: update proto formatting --- .../cloud/asset/v1beta1/asset_service.proto | 18 ++++++----- .../google/cloud/asset/v1beta1/assets.proto | 17 +++++----- .../src/v1beta1/asset_service_client.js | 8 +++-- .../cloud/asset/v1beta1/doc_asset_service.js | 9 ++++-- .../google/cloud/asset/v1beta1/doc_assets.js | 16 ++++++---- .../src/v1beta1/doc/google/rpc/doc_status.js | 31 ++++++++++--------- packages/google-cloud-asset/synth.metadata | 10 +++--- 7 files changed, 64 insertions(+), 45 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto index 16e0789ebc4..8e2d1b0a387 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -29,13 +29,13 @@ option java_outer_classname = "AssetServiceProto"; option java_package = "com.google.cloud.asset.v1beta1"; option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; - // Asset service definition. service AssetService { // Exports assets with time and resource types to a given Cloud Storage // location. The output format is newline-delimited JSON. - // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you - // to keep track of the export. + // This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API allowing + // you to keep track of the export. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*}:exportAssets" @@ -56,7 +56,8 @@ service AssetService { // non-delete or deleted status. // For IAM_POLICY content, this API outputs history when the asset and its // attached IAM POLICY both exist. This can create gaps in the output history. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) + returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*}:batchGetAssetsHistory" additional_bindings { @@ -98,8 +99,10 @@ message ExportAssetsRequest { } // The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. message ExportAssetsResponse { // Time the snapshot was taken. google.protobuf.Timestamp read_time = 1; @@ -118,7 +121,8 @@ message BatchGetAssetsHistoryRequest { // A list of the full names of the assets. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more info. // // The request becomes a no-op if the asset name list is empty, and the max diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto index cde70cddfc0..84db977b97d 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -30,7 +30,6 @@ option java_outer_classname = "AssetProto"; option java_package = "com.google.cloud.asset.v1beta1"; option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; - // Temporal asset. In addition to the asset, the temporal asset includes the // status of the asset and valid from and to time of it. message TemporalAsset { @@ -57,8 +56,10 @@ message TimeWindow { // Cloud asset. This includes all Google Cloud Platform resources, // Cloud IAM policies, and other non-GCP assets. message Asset { - // The full name of the asset. For example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // The full name of the asset. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. string name = 1; @@ -68,8 +69,8 @@ message Asset { // Representation of the resource. Resource resource = 3; - // Representation of the actual Cloud IAM policy set on a cloud resource. For each - // resource, there must be at most one Cloud IAM policy set on it. + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. google.iam.v1.Policy iam_policy = 4; } @@ -98,12 +99,14 @@ message Resource { string resource_url = 4; // The full name of the immediate parent of this resource. See - // [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. // // For GCP assets, it is the parent resource defined in the [Cloud IAM policy // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - // For example: `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + // For example: + // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. // // For third-party assets, it is up to the users to define. string parent = 5; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 6d20ed7812b..97d750ecc4e 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -218,8 +218,9 @@ class AssetServiceClient { /** * Exports assets with time and resource types to a given Cloud Storage * location. The output format is newline-delimited JSON. - * This API implements the google.longrunning.Operation API allowing you - * to keep track of the export. + * This API implements the + * google.longrunning.Operation API allowing + * you to keep track of the export. * * @param {Object} request * The request object that will be sent. @@ -367,7 +368,8 @@ class AssetServiceClient { * @param {string[]} [request.assetNames] * A list of the full names of the assets. For example: * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) * for more info. * * The request becomes a no-op if the asset name list is empty, and the max diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js index 61e2fd72af3..df4afe7bded 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -62,8 +62,10 @@ const ExportAssetsRequest = { /** * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation method in the returned - * google.longrunning.Operation.response field. + * google.longrunning.Operations.GetOperation + * method in the returned + * google.longrunning.Operation.response + * field. * * @property {Object} readTime * Time the snapshot was taken. @@ -95,7 +97,8 @@ const ExportAssetsResponse = { * @property {string[]} assetNames * A list of the full names of the assets. For example: * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) * for more info. * * The request becomes a no-op if the asset name list is empty, and the max diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index e8859163e7f..4b1911b8355 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -67,8 +67,10 @@ const TimeWindow = { * Cloud IAM policies, and other non-GCP assets. * * @property {string} name - * The full name of the asset. For example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * The full name of the asset. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) * for more information. * * @property {string} assetType @@ -80,8 +82,8 @@ const TimeWindow = { * This object should have the same structure as [Resource]{@link google.cloud.asset.v1beta1.Resource} * * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For each - * resource, there must be at most one Cloud IAM policy set on it. + * Representation of the actual Cloud IAM policy set on a cloud resource. For + * each resource, there must be at most one Cloud IAM policy set on it. * * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} * @@ -120,12 +122,14 @@ const Asset = { * * @property {string} parent * The full name of the immediate parent of this resource. See - * [Resource Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) * for more information. * * For GCP assets, it is the parent resource defined in the [Cloud IAM policy * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + * For example: + * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. * * For third-party assets, it is up to the users to define. * diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js index fc4b5be93f0..432ab6bb928 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js @@ -16,24 +16,25 @@ // to be loaded as the JS file. /** - * The `Status` type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * [gRPC](https://github.com/grpc). The error model is designed to be: + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: * * - Simple to use and understand for most users * - Flexible enough to meet unexpected needs * * # Overview * - * The `Status` message contains three pieces of data: error code, error message, - * and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers *understand* and *resolve* the error. If a localized user-facing - * error message is needed, put the localized message in the error details or - * localize it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package `google.rpc` that can be used for common error conditions. + * The `Status` message contains three pieces of data: error code, error + * message, and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes + * if needed. The error message should be a developer-facing English message + * that helps developers *understand* and *resolve* the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may contain + * arbitrary information about the error. There is a predefined set of error + * detail types in the package `google.rpc` that can be used for common error + * conditions. * * # Language mapping * @@ -70,12 +71,14 @@ * be used directly after any stripping needed for security/privacy reasons. * * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. + * The status code, which should be an enum value of + * google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * google.rpc.Status.details field, or localized + * by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 6a4caa47364..3aff8b9d1db 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-02-13T12:07:57.024829Z", + "updateTime": "2019-02-26T12:23:55.526504Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.13", - "dockerImage": "googleapis/artman@sha256:5fd9aee1d82a00cebf425c8fa431f5457539562f5867ad9c54370f0ec9a7ccaa" + "version": "0.16.14", + "dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ca61898878f0926dd9dcc68ba90764f17133efe4", - "internalRef": "233680013" + "sha": "29f098cb03a9983cc9cb15993de5da64419046f2", + "internalRef": "235621085" } }, { From ddeb566048d49fe213079bd8b1cf1c0b58d2b3e3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 5 Mar 2019 16:39:25 -0800 Subject: [PATCH 078/429] build: update release configuration --- packages/google-cloud-asset/synth.metadata | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 3aff8b9d1db..4afdc25e839 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-02-26T12:23:55.526504Z", + "updateTime": "2019-03-05T12:08:20.138727Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "29f098cb03a9983cc9cb15993de5da64419046f2", - "internalRef": "235621085" + "sha": "b4a22569c88f1f0444e889d8139ddacb799f287c", + "internalRef": "236712632" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.1.16" + "version": "2019.2.26" } } ], From cfcd906a24a5b6a248ffd97fbc6cfa0d63fba721 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 7 Mar 2019 18:03:50 -0800 Subject: [PATCH 079/429] build: Add docuploader credentials to node publish jobs (#113) --- packages/google-cloud-asset/synth.metadata | 33 ++-------------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 4afdc25e839..10c153f47a3 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,38 +1,11 @@ { - "updateTime": "2019-03-05T12:08:20.138727Z", + "updateTime": "2019-03-08T00:45:38.648657Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.14", - "dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b4a22569c88f1f0444e889d8139ddacb799f287c", - "internalRef": "236712632" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.2.26" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" + "version": "0.16.15", + "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" } } ] From 32b001942e10eccd7312c165b82e21036f9f6e76 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 12 Mar 2019 10:53:34 -0700 Subject: [PATCH 080/429] docs: update jsdoc samples and json import paths (#115) --- .../src/v1beta1/asset_service_client.js | 14 +++++++- packages/google-cloud-asset/synth.metadata | 33 +++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 97d750ecc4e..ca29ac8648c 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -14,7 +14,7 @@ 'use strict'; -const gapicConfig = require('./asset_service_client_config'); +const gapicConfig = require('./asset_service_client_config.json'); const gax = require('google-gax'); const merge = require('lodash.merge'); const path = require('path'); @@ -328,6 +328,18 @@ class AssetServiceClient { * .catch(err => { * console.error(err); * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * const outputConfig = {}; + * const request = { + * parent: formattedParent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.exportAssets(request); + * + * const [response] = await operation.promise(); */ exportAssets(request, options, callback) { if (options instanceof Function && callback === undefined) { diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 10c153f47a3..da34ff3a01b 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,11 +1,38 @@ { - "updateTime": "2019-03-08T00:45:38.648657Z", + "updateTime": "2019-03-12T11:07:21.227219Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.15", - "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" + "version": "0.16.16", + "dockerImage": "googleapis/artman@sha256:30babbfce7f05a62b1892c63c575aa2c8c502eb4bcc8f3bb90ec83e955d5d319" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "abd1c9a99c5cd7179d8e5e0c8d4c8e761054cc78", + "internalRef": "237945492" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.2.26" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" } } ] From b0ff8b9178be9034bb0c46e6b5e15effbe6d965b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Wed, 13 Mar 2019 11:28:17 -0700 Subject: [PATCH 081/429] docs: use backticks for JS values (#116) --- .../v1beta1/doc/google/longrunning/doc_operations.js | 2 +- packages/google-cloud-asset/synth.metadata | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js index bd03cc3da0e..4719aebdc91 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -34,7 +34,7 @@ * * @property {boolean} done * If the value is `false`, it means the operation is still in progress. - * If true, the operation is completed, and either `error` or `response` is + * If `true`, the operation is completed, and either `error` or `response` is * available. * * @property {Object} error diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index da34ff3a01b..8f317e18afb 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-12T11:07:21.227219Z", + "updateTime": "2019-03-13T11:07:41.841569Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.16", - "dockerImage": "googleapis/artman@sha256:30babbfce7f05a62b1892c63c575aa2c8c502eb4bcc8f3bb90ec83e955d5d319" + "version": "0.16.17", + "dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "abd1c9a99c5cd7179d8e5e0c8d4c8e761054cc78", - "internalRef": "237945492" + "sha": "e340f4a01ec287f7bb86e2331b5e98c473d10afd", + "internalRef": "238151361" } }, { From b74f2aeb956d597322068017a2644c378efb2b8f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 13 Mar 2019 22:51:30 -0700 Subject: [PATCH 082/429] Release v0.2.1 (#117) --- packages/google-cloud-asset/CHANGELOG.md | 28 +++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 017d2f8429f..10aaa1a839c 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,34 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## v0.2.1 + +03-13-2019 21:45 PDT + +### Bug Fixes +- fix: throw on invalid credentials + +### Documentation +- docs: use backticks for JS values ([#116](https://github.com/googleapis/nodejs-asset/pull/116)) +- docs: update jsdoc samples and json import paths ([#115](https://github.com/googleapis/nodejs-asset/pull/115)) +- docs: update links in contrib guide ([#108](https://github.com/googleapis/nodejs-asset/pull/108)) +- docs: update contributing path in README ([#100](https://github.com/googleapis/nodejs-asset/pull/100)) +- docs: move CONTRIBUTING.md to root ([#99](https://github.com/googleapis/nodejs-asset/pull/99)) +- docs: add lint/fix example to contributing guide ([#97](https://github.com/googleapis/nodejs-asset/pull/97)) + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#113](https://github.com/googleapis/nodejs-asset/pull/113)) +- build: use node10 to run samples-test, system-test etc ([#112](https://github.com/googleapis/nodejs-asset/pull/112)) +- build: update release configuration +- chore: update proto formatting +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#107](https://github.com/googleapis/nodejs-asset/pull/107)) +- fix(deps): update dependency yargs to v13 ([#105](https://github.com/googleapis/nodejs-asset/pull/105)) +- build: create docs test npm scripts ([#104](https://github.com/googleapis/nodejs-asset/pull/104)) +- build: test using @grpc/grpc-js in CI ([#103](https://github.com/googleapis/nodejs-asset/pull/103)) +- chore: ignore cache directories ([#102](https://github.com/googleapis/nodejs-asset/pull/102)) +- refactor: improve generated code style. ([#96](https://github.com/googleapis/nodejs-asset/pull/96)) + ## v0.2.0 01-31-2019 10:32 PST diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b70be802776..1c1efda867b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "0.2.0", + "version": "0.2.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 5120cf38b94..0dffd41a857 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha system-test --timeout 20000" }, "dependencies": { - "@google-cloud/asset": "^0.2.0", + "@google-cloud/asset": "^0.2.1", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From 07926c766adceb3d6dd995cececa37b957b94caf Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 18 Mar 2019 03:30:25 -0700 Subject: [PATCH 083/429] feat: add the v1 version of the API (#120) --- .../google/cloud/asset/v1/asset_service.proto | 171 +++++++ .../protos/google/cloud/asset/v1/assets.proto | 118 +++++ .../google-cloud-asset/samples/quickstart.js | 8 +- packages/google-cloud-asset/src/index.js | 13 +- .../src/v1/asset_service_client.js | 469 ++++++++++++++++++ .../src/v1/asset_service_client_config.json | 36 ++ .../cloud/asset/v1/doc_asset_service.js | 201 ++++++++ .../doc/google/cloud/asset/v1/doc_assets.js | 148 ++++++ .../src/v1/doc/google/iam/v1/doc_policy.js | 118 +++++ .../doc/google/longrunning/doc_operations.js | 63 +++ .../src/v1/doc/google/protobuf/doc_any.js | 136 +++++ .../src/v1/doc/google/protobuf/doc_struct.js | 112 +++++ .../v1/doc/google/protobuf/doc_timestamp.js | 113 +++++ .../src/v1/doc/google/rpc/doc_status.js | 95 ++++ packages/google-cloud-asset/src/v1/index.js | 19 + packages/google-cloud-asset/synth.metadata | 16 +- packages/google-cloud-asset/synth.py | 13 +- packages/google-cloud-asset/test/gapic-v1.js | 213 ++++++++ 18 files changed, 2049 insertions(+), 13 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto create mode 100644 packages/google-cloud-asset/src/v1/asset_service_client.js create mode 100644 packages/google-cloud-asset/src/v1/asset_service_client_config.json create mode 100644 packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js create mode 100644 packages/google-cloud-asset/src/v1/index.js create mode 100644 packages/google-cloud-asset/test/gapic-v1.js diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto new file mode 100644 index 00000000000..0dfc2898b13 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -0,0 +1,171 @@ +// Copyright 2019 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.asset.v1; + +import "google/api/annotations.proto"; +import "google/cloud/asset/v1/assets.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1"; +option php_namespace = "Google\\Cloud\\Asset\\V1"; + + +// Asset service definition. +service AssetService { + // Exports assets with time and resource types to a given Cloud Storage + // location. The output format is newline-delimited JSON. + // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you + // to keep track of the export. + rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=*/*}:exportAssets" + body: "*" + }; + } + + // Batch gets the update history of assets that overlap a time window. + // For RESOURCE content, this API outputs history with asset in both + // non-delete or deleted status. + // For IAM_POLICY content, this API outputs history when the asset and its + // attached IAM POLICY both exist. This can create gaps in the output history. + // If a specified asset does not exist, this API returns an INVALID_ARGUMENT + // error. + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}:batchGetAssetsHistory" + }; + } +} + +// Export asset request. +message ExportAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"), + // or a folder number (such as "folders/123"). + string parent = 1; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between 2018-10-02 UTC (inclusive) and the current time. If not specified, + // the current time will be used. Due to delays in resource data collection + // and indexing, there is a volatile window during which running the same + // query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types of which to take a snapshot for. For example: + // "compute.googleapis.com/Disk". If specified, only matching assets will be returned. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will be + // returned. + ContentType content_type = 4; + + // Required. Output configuration indicating where the results will be output + // to. All results will be in newline delimited JSON format. + OutputConfig output_config = 5; +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +message ExportAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Output configuration indicating where the results were output to. + // All results are in JSON format. + OutputConfig output_config = 2; +} + +// Batch get assets history request. +message BatchGetAssetsHistoryRequest { + // Required. The relative name of the root asset. It can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id")", or a project number (such as "projects/12345"). + string parent = 1; + + // A list of the full names of the assets. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + // for more info. + // + // The request becomes a no-op if the asset name list is empty, and the max + // size of the asset name list is 100 in one request. + repeated string asset_names = 2; + + // Required. The content type. + ContentType content_type = 3; + + // Optional. The time window for the asset history. Both start_time and + // end_time are optional and if set, it must be after 2018-10-02 UTC. If + // end_time is not set, it is default to current timestamp. If start_time is + // not set, the snapshot of the assets at end_time will be returned. The + // returned results contain all temporal assets whose time window overlap with + // read_time_window. + TimeWindow read_time_window = 4; +} + +// Batch get assets history response. +message BatchGetAssetsHistoryResponse { + // A list of assets with valid time windows. + repeated TemporalAsset assets = 1; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + } +} + +// A Cloud Storage location. +message GcsDestination { + // Required. + oneof object_uri { + // The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1; + } +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto new file mode 100644 index 00000000000..f6a8108c0bd --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -0,0 +1,118 @@ +// Copyright 2019 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.asset.v1; + +import "google/api/annotations.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1"; +option php_namespace = "Google\\Cloud\\Asset\\V1"; + + +// Temporal asset. In addition to the asset, the temporal asset includes the +// status of the asset and valid from and to time of it. +message TemporalAsset { + // The time window when the asset data and state was observed. + TimeWindow window = 1; + + // If the asset is deleted or not. + bool deleted = 2; + + // Asset. + Asset asset = 3; +} + +// A time window of (start_time, end_time]. +message TimeWindow { + // Start time of the time window (exclusive). + google.protobuf.Timestamp start_time = 1; + + // End time of the time window (inclusive). + // Current timestamp if not specified. + google.protobuf.Timestamp end_time = 2; +} + +// Cloud asset. This includes all Google Cloud Platform resources, +// Cloud IAM policies, and other non-GCP assets. +message Asset { + // The full name of the asset. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // Type of the asset. Example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // Representation of the resource. + Resource resource = 3; + + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. + google.iam.v1.Policy iam_policy = 4; +} + +// Representation of a cloud resource. +message Resource { + // The API version. Example: "v1". + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // For example: + // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. + // It will be left unspecified for resources without a discovery-based API, + // such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. + // Example: "Project". It will be left unspecified for resources (such as + // Cloud Bigtable) without a discovery-based API. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP GET operation using this + // URL returns the resource itself. + // Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + // It will be left unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For GCP assets, it is the parent resource defined in the [Cloud IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // For example: + // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + // + // For third-party assets, it is up to the users to define. + string parent = 5; + + // The content of the resource, in which some sensitive fields are scrubbed + // away and may not be present. + google.protobuf.Struct data = 6; +} diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 682cc327ef0..8bb9c04d439 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -17,8 +17,8 @@ async function exportAssets(dumpFilePath) { // [START asset_quickstart_export_assets] - const asset = require('@google-cloud/asset'); - const client = new asset.v1beta1.AssetServiceClient({ + const {AssetServiceClient} = require('@google-cloud/asset'); + const client = new AssetServiceClient({ // optional auth parameters. }); @@ -49,8 +49,8 @@ async function exportAssets(dumpFilePath) { async function batchGetAssetsHistory(assetNames) { // [START asset_quickstart_batch_get_assets_history] const util = require('util'); - const asset = require('@google-cloud/asset'); - const client = new asset.v1beta1.AssetServiceClient({ + const {AssetServiceClient} = require('@google-cloud/asset'); + const client = new AssetServiceClient({ // optional auth parameters. }); diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js index 7496f49cd6e..249e2ea3d2a 100644 --- a/packages/google-cloud-asset/src/index.js +++ b/packages/google-cloud-asset/src/index.js @@ -24,6 +24,9 @@ /** * @namespace google.cloud.asset.v1beta1 */ +/** + * @namespace google.cloud.asset.v1 + */ /** * @namespace google.protobuf */ @@ -45,6 +48,7 @@ // Import the clients for each version supported by this package. const gapic = Object.freeze({ v1beta1: require('./v1beta1'), + v1: require('./v1'), }); /** @@ -81,7 +85,7 @@ const gapic = Object.freeze({ * @property {constructor} AssetServiceClient * Reference to {@link v1beta1.AssetServiceClient} */ -module.exports = gapic.v1beta1; +module.exports = gapic.v1; /** * @type {object} @@ -90,5 +94,12 @@ module.exports = gapic.v1beta1; */ module.exports.v1beta1 = gapic.v1beta1; +/** + * @type {object} + * @property {constructor} AssetServiceClient + * Reference to {@link v1.AssetServiceClient} + */ +module.exports.v1 = gapic.v1; + // Alias `module.exports` as `module.exports.default`, for future-proofing. module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js new file mode 100644 index 00000000000..25302c5832c --- /dev/null +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -0,0 +1,469 @@ +// Copyright 2019 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. + +'use strict'; + +const gapicConfig = require('./asset_service_client_config.json'); +const gax = require('google-gax'); +const merge = require('lodash.merge'); +const path = require('path'); +const protobuf = require('protobufjs'); + +const VERSION = require('../../package.json').version; + +/** + * Asset service definition. + * + * @class + * @memberof v1 + */ +class AssetServiceClient { + /** + * Construct an instance of AssetServiceClient. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(opts) { + this._descriptors = {}; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath: this.constructor.servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}`, + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + const protos = merge( + {}, + gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + 'google/cloud/asset/v1/asset_service.proto' + ) + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + projectPathTemplate: new gax.PathTemplate('projects/{project}'), + }; + let protoFilesRoot = new gax.GoogleProtoFilesRoot(); + protoFilesRoot = protobuf.loadSync( + path.join( + __dirname, + '..', + '..', + 'protos', + 'google/cloud/asset/v1/asset_service.proto' + ), + protoFilesRoot + ); + + // 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 = new gax.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc, + }).operationsClient(opts); + + const exportAssetsResponse = protoFilesRoot.lookup( + 'google.cloud.asset.v1.ExportAssetsResponse' + ); + const exportAssetsMetadata = protoFilesRoot.lookup( + 'google.cloud.asset.v1.ExportAssetsRequest' + ); + + this._descriptors.longrunning = { + exportAssets: new gax.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1.AssetService', + gapicConfig, + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1.AssetService. + const assetServiceStub = gaxGrpc.createStub( + protos.google.cloud.asset.v1.AssetService, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; + for (const methodName of assetServiceStubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + assetServiceStub.then( + stub => + function() { + const args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; + } + ), + defaults[methodName], + this._descriptors.longrunning[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.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']; + } + + /** + * 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) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Exports assets with time and resource types to a given Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the google.longrunning.Operation API allowing you + * to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * @param {Object} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} + * @param {Object} [request.readTime] + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {string[]} [request.assetTypes] + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be returned. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {number} [request.contentType] + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} + * @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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * const outputConfig = {}; + * const request = { + * parent: parent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the promise pattern. + * client.exportAssets(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const parent = ''; + * const outputConfig = {}; + * const request = { + * parent: parent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.exportAssets(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const parent = ''; + * const outputConfig = {}; + * const request = { + * parent: parent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.exportAssets(request); + * + * const [response] = await operation.promise(); + */ + exportAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.exportAssets(request, options, callback); + } + + /** + * Batch gets the update history of assets that overlap a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * @param {number} request.contentType + * Required. The content type. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} + * @param {Object} request.readTimeWindow + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} + * @param {string[]} [request.assetNames] + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + * for more info. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + * const readTimeWindow = {}; + * const request = { + * parent: parent, + * contentType: contentType, + * readTimeWindow: readTimeWindow, + * }; + * client.batchGetAssetsHistory(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + batchGetAssetsHistory(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + options = options || {}; + + return this._innerApiCalls.batchGetAssetsHistory( + request, + options, + callback + ); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {String} project + * @returns {String} + */ + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the projectName from a project resource. + * + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } +} + +module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json new file mode 100644 index 00000000000..e1004902b79 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.asset.v1.AssetService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExportAssets": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchGetAssetsHistory": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js new file mode 100644 index 00000000000..68ce8edc2e2 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js @@ -0,0 +1,201 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Export asset request. + * + * @property {string} parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * + * @property {Object} readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string[]} assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be returned. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * + * @property {number} contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} + * + * @property {Object} outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} + * + * @typedef ExportAssetsRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const ExportAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The export asset response. This message is returned by the + * google.longrunning.Operations.GetOperation method in the returned + * google.longrunning.Operation.response field. + * + * @property {Object} readTime + * Time the snapshot was taken. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} outputConfig + * Output configuration indicating where the results were output to. + * All results are in JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} + * + * @typedef ExportAssetsResponse + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const ExportAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Batch get assets history request. + * + * @property {string} parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * + * @property {string[]} assetNames + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + * for more info. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * + * @property {number} contentType + * Required. The content type. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} + * + * @property {Object} readTimeWindow + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} + * + * @typedef BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const BatchGetAssetsHistoryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Batch get assets history response. + * + * @property {Object[]} assets + * A list of assets with valid time windows. + * + * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1.TemporalAsset} + * + * @typedef BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const BatchGetAssetsHistoryResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for export assets destination. + * + * @property {Object} gcsDestination + * Destination on Cloud Storage. + * + * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1.GcsDestination} + * + * @typedef OutputConfig + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const OutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A Cloud Storage location. + * + * @property {string} uri + * The uri of the Cloud Storage object. It's the same uri that is used by + * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * + * @typedef GcsDestination + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const GcsDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Asset content type. + * + * @enum {number} + * @memberof google.cloud.asset.v1 + */ +const ContentType = { + + /** + * Unspecified content type. + */ + CONTENT_TYPE_UNSPECIFIED: 0, + + /** + * Resource metadata. + */ + RESOURCE: 1, + + /** + * The actual IAM policy set on a resource. + */ + IAM_POLICY: 2 +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js new file mode 100644 index 00000000000..2c21347d37b --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js @@ -0,0 +1,148 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Temporal asset. In addition to the asset, the temporal asset includes the + * status of the asset and valid from and to time of it. + * + * @property {Object} window + * The time window when the asset data and state was observed. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} + * + * @property {boolean} deleted + * If the asset is deleted or not. + * + * @property {Object} asset + * Asset. + * + * This object should have the same structure as [Asset]{@link google.cloud.asset.v1.Asset} + * + * @typedef TemporalAsset + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} + */ +const TemporalAsset = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A time window of (start_time, end_time]. + * + * @property {Object} startTime + * Start time of the time window (exclusive). + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} endTime + * End time of the time window (inclusive). + * Current timestamp if not specified. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef TimeWindow + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} + */ +const TimeWindow = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Cloud asset. This includes all Google Cloud Platform resources, + * Cloud IAM policies, and other non-GCP assets. + * + * @property {string} name + * The full name of the asset. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * @property {string} assetType + * Type of the asset. Example: "compute.googleapis.com/Disk". + * + * @property {Object} resource + * Representation of the resource. + * + * This object should have the same structure as [Resource]{@link google.cloud.asset.v1.Resource} + * + * @property {Object} iamPolicy + * Representation of the actual Cloud IAM policy set on a cloud resource. For + * each resource, there must be at most one Cloud IAM policy set on it. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * + * @typedef Asset + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} + */ +const Asset = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Representation of a cloud resource. + * + * @property {string} version + * The API version. Example: "v1". + * + * @property {string} discoveryDocumentUri + * The URL of the discovery document containing the resource's JSON schema. + * For example: + * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + * + * @property {string} discoveryName + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + * + * @property {string} resourceUrl + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + * + * @property {string} parent + * The full name of the immediate parent of this resource. See + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * For GCP assets, it is the parent resource defined in the [Cloud IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * For example: + * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + * + * For third-party assets, it is up to the users to define. + * + * @property {Object} data + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @typedef Resource + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} + */ +const Resource = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js new file mode 100644 index 00000000000..bcae4a7d873 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -0,0 +1,118 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. + * + * + * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * `members` to a `role`, where the members can be user accounts, Google groups, + * Google domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. + * + * **Example** + * + * { + * "bindings": [ + * { + * "role": "roles/owner", + * "members": [ + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * ] + * }, + * { + * "role": "roles/viewer", + * "members": ["user:sean@example.com"] + * } + * ] + * } + * + * For a description of IAM and its features, see the + * [IAM developer's guide](https://cloud.google.com/iam). + * + * @property {number} version + * Version of the `Policy`. The default version is 0. + * + * @property {Object[]} bindings + * Associates a list of `members` to a `role`. + * Multiple `bindings` must not be specified for the same `role`. + * `bindings` with no members will result in an error. + * + * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} + * + * @property {string} etag + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + * + * @typedef Policy + * @memberof google.iam.v1 + * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Policy = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Associates `members` with a `role`. + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + * + * @property {string[]} members + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * @typedef Binding + * @memberof google.iam.v1 + * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Binding = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js new file mode 100644 index 00000000000..4719aebdc91 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js @@ -0,0 +1,63 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js new file mode 100644 index 00000000000..f3278b34e66 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js @@ -0,0 +1,136 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * # JSON + * + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message google.protobuf.Duration): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * @property {string} typeUrl + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a google.protobuf.Type + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * @property {string} value + * Must be a valid serialized protocol buffer of the above specified type. + * + * @typedef Any + * @memberof google.protobuf + * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} + */ +const Any = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js new file mode 100644 index 00000000000..ae7e4ef1ff6 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js @@ -0,0 +1,112 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @property {Object.} fields + * Unordered map of dynamically typed values. + * + * @typedef Struct + * @memberof google.protobuf + * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Struct = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @property {number} nullValue + * Represents a null value. + * + * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} + * + * @property {number} numberValue + * Represents a double value. + * + * @property {string} stringValue + * Represents a string value. + * + * @property {boolean} boolValue + * Represents a boolean value. + * + * @property {Object} structValue + * Represents a structured value. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @property {Object} listValue + * Represents a repeated `Value`. + * + * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} + * + * @typedef Value + * @memberof google.protobuf + * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Value = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @property {Object[]} values + * Repeated field of dynamically typed values. + * + * This object should have the same structure as [Value]{@link google.protobuf.Value} + * + * @typedef ListValue + * @memberof google.protobuf + * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const ListValue = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @enum {number} + * @memberof google.protobuf + */ +const NullValue = { + + /** + * Null value. + */ + NULL_VALUE: 0 +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..b47f41c2b30 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,113 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +const Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js new file mode 100644 index 00000000000..432ab6bb928 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js @@ -0,0 +1,95 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * + * - Simple to use and understand for most users + * - Flexible enough to meet unexpected needs + * + * # Overview + * + * The `Status` message contains three pieces of data: error code, error + * message, and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes + * if needed. The error message should be a developer-facing English message + * that helps developers *understand* and *resolve* the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may contain + * arbitrary information about the error. There is a predefined set of error + * detail types in the package `google.rpc` that can be used for common error + * conditions. + * + * # Language mapping + * + * The `Status` message is the logical representation of the error model, but it + * is not necessarily the actual wire format. When the `Status` message is + * exposed in different client libraries and different wire protocols, it can be + * mapped differently. For example, it will likely be mapped to some exceptions + * in Java, but more likely mapped to some error codes in C. + * + * # Other uses + * + * The error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a + * consistent developer experience across different environments. + * + * Example uses of this error model include: + * + * - Partial errors. If a service needs to return partial errors to the client, + * it may embed the `Status` in the normal response to indicate the partial + * errors. + * + * - Workflow errors. A typical workflow has multiple steps. Each step may + * have a `Status` message for error reporting. + * + * - Batch operations. If a client uses batch request and batch response, the + * `Status` message should be used directly inside batch response, one for + * each error sub-response. + * + * - Asynchronous operations. If an API call embeds asynchronous operation + * results in its response, the status of those operations should be + * represented directly using the `Status` message. + * + * - Logging. If some API errors are stored in logs, the message `Status` could + * be used directly after any stripping needed for security/privacy reasons. + * + * @property {number} code + * The status code, which should be an enum value of + * google.rpc.Code. + * + * @property {string} message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized + * by the client. + * + * @property {Object[]} details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Status + * @memberof google.rpc + * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} + */ +const Status = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/index.js b/packages/google-cloud-asset/src/v1/index.js new file mode 100644 index 00000000000..11b31911e6a --- /dev/null +++ b/packages/google-cloud-asset/src/v1/index.js @@ -0,0 +1,19 @@ +// Copyright 2019 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. + +'use strict'; + +const AssetServiceClient = require('./asset_service_client'); + +module.exports.AssetServiceClient = AssetServiceClient; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 8f317e18afb..ff41a4c736e 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-13T11:07:41.841569Z", + "updateTime": "2019-03-16T02:43:47.980703Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e340f4a01ec287f7bb86e2331b5e98c473d10afd", - "internalRef": "238151361" + "sha": "dab002e28c81adcc5601278c36d4302c2624c8e2", + "internalRef": "238726437" } }, { @@ -34,6 +34,16 @@ "generator": "gapic", "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1.yaml" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 13bf4b38f86..21173ab05f1 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -22,20 +22,23 @@ # run the gapic generator gapic = gcp.GAPICGenerator() -version = 'v1beta1' -library = gapic.node_library( - 'asset', version, config_path="artman_cloudasset_v1beta1.yaml", +versions = ['v1beta1', 'v1'] +for version in versions: + library = gapic.node_library( + 'asset', + version, + config_path=f"artman_cloudasset_{version}.yaml", artman_output_name=f"asset-{version}") + s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) # Copy common templates common_templates = gcp.CommonTemplates() -s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) templates = common_templates.node_library() s.copy(templates) # [START fix-dead-link] discovery_url = 'https://www.googleapis.com/discovery/v1/apis/compute/v1/rest' -s.replace('**/doc/google/cloud/asset/v1beta1/doc_assets.js', +s.replace('**/doc/google/cloud/asset/*/doc_assets.js', f'`"{discovery_url}"`', f'[`"{discovery_url}"`]({discovery_url})') diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js new file mode 100644 index 00000000000..3645085a6c4 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-v1.js @@ -0,0 +1,213 @@ +// Copyright 2019 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. + +'use strict'; + +const assert = require('assert'); + +const assetModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +const error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe('AssetServiceClient', () => { + describe('exportAssets', function() { + it('invokes exportAssets without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const outputConfig = {}; + const request = { + parent: parent, + outputConfig: outputConfig, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .exportAssets(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes exportAssets with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const outputConfig = {}; + const request = { + parent: parent, + outputConfig: outputConfig, + }; + + // Mock Grpc layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .exportAssets(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.exportAssets.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.exportAssets.metadataDecoder instanceof + Function + ); + }); + }); + + describe('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + const readTimeWindow = {}; + const request = { + parent: parent, + contentType: contentType, + readTimeWindow: readTimeWindow, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.batchGetAssetsHistory(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes batchGetAssetsHistory with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + const readTimeWindow = {}; + const request = { + parent: parent, + contentType: contentType, + readTimeWindow: readTimeWindow, + }; + + // Mock Grpc layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.batchGetAssetsHistory(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} + +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} From 57b6047c700a4391c4662e03b8c7c2cfb28e694c Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Wed, 20 Mar 2019 15:46:47 -0700 Subject: [PATCH 084/429] Release @google-cloud/asset v0.3.0 (#121) * Release v0.3.0 * Update CHANGELOG.md --- packages/google-cloud-asset/CHANGELOG.md | 19 +++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 10aaa1a839c..249b0772778 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,25 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## v0.3.0 + +03-19-2019 11:42 PDT + +This release ships the v1 version of the backend API. + +Create the v1 client: + +```javascript +const asset = require('@google-cloud/asset'); +const client = new asset.v1.AssetServiceClient(); +``` + +### New Features +- feat: add the v1 version of the API ([#120](https://github.com/googleapis/nodejs-asset/pull/120)) + +### Internal / Testing Changes +- build: use per-repo publish token ([#119](https://github.com/googleapis/nodejs-asset/pull/119)) + ## v0.2.1 03-13-2019 21:45 PDT diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1c1efda867b..c46af49939b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "0.2.1", + "version": "0.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 0dffd41a857..38c6c9eea34 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha system-test --timeout 20000" }, "dependencies": { - "@google-cloud/asset": "^0.2.1", + "@google-cloud/asset": "^0.3.0", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From bb7b0e7f3f46393570c3e7d0ae400a9931cb917e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 28 Mar 2019 15:23:39 -0700 Subject: [PATCH 085/429] fix: include 'x-goog-request-params' header in requests (#126) --- .../src/v1/asset_service_client.js | 14 ++++++++++++++ .../src/v1beta1/asset_service_client.js | 14 ++++++++++++++ packages/google-cloud-asset/synth.metadata | 10 +++++----- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index 25302c5832c..7e515879563 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -346,6 +346,13 @@ class AssetServiceClient { options = {}; } 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, + }); return this._innerApiCalls.exportAssets(request, options, callback); } @@ -430,6 +437,13 @@ class AssetServiceClient { options = {}; } 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, + }); return this._innerApiCalls.batchGetAssetsHistory( request, diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index ca29ac8648c..fb62e57bcdb 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -347,6 +347,13 @@ class AssetServiceClient { options = {}; } 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, + }); return this._innerApiCalls.exportAssets(request, options, callback); } @@ -428,6 +435,13 @@ class AssetServiceClient { options = {}; } 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, + }); return this._innerApiCalls.batchGetAssetsHistory( request, diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index ff41a4c736e..38b61fd611b 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-16T02:43:47.980703Z", + "updateTime": "2019-03-28T11:24:52.255771Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.17", - "dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b" + "version": "0.16.20", + "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dab002e28c81adcc5601278c36d4302c2624c8e2", - "internalRef": "238726437" + "sha": "6a84b3267b0a95e922608b9891219075047eee29", + "internalRef": "240640999" } }, { From b4c3d0aacabe783566d1489c8d14f33a24281f65 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 4 Apr 2019 21:15:11 -0700 Subject: [PATCH 086/429] refactor: use execSync for tests (#127) --- .../google-cloud-asset/samples/package.json | 3 +- .../samples/test/quickstart.test.js | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-asset/samples/test/quickstart.test.js diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 38c6c9eea34..527c478b300 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -12,7 +12,7 @@ "repository": "googleapis/nodejs-asset", "private": true, "scripts": { - "test": "mocha system-test --timeout 20000" + "test": "mocha --timeout 20000" }, "dependencies": { "@google-cloud/asset": "^0.3.0", @@ -22,7 +22,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "mocha": "^6.0.0" } } diff --git a/packages/google-cloud-asset/samples/test/quickstart.test.js b/packages/google-cloud-asset/samples/test/quickstart.test.js new file mode 100644 index 00000000000..688490a1cb5 --- /dev/null +++ b/packages/google-cloud-asset/samples/test/quickstart.test.js @@ -0,0 +1,53 @@ +/** + * Copyright 2018, 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'; + +const {assert} = require('chai'); +const uuid = require('uuid'); +const cp = require('child_process'); +const {Storage} = require('@google-cloud/storage'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cmd = 'node quickstart.js'; +const storage = new Storage(); +const bucketName = `asset-nodejs-${uuid.v4()}`; +const bucket = storage.bucket(bucketName); + +describe('quickstart sample tests', () => { + before(async () => { + await bucket.create(); + }); + + after(async () => { + await bucket.delete(); + }); + + it('should export assets to specified path', async () => { + const dumpFilePath = `gs://${bucketName}/my-assets.txt`; + execSync(`${cmd} export-assets ${dumpFilePath}`); + const file = await bucket.file('my-assets.txt'); + const exists = await file.exists(); + assert.ok(exists); + await file.delete(); + }); + + it('should get assets history successfully', async () => { + const assetName = `//storage.googleapis.com/${bucketName}`; + const stdout = execSync(`${cmd} batch-get-history ${assetName}`); + assert.match(stdout, new RegExp(assetName)); + }); +}); From 21a118acef34a37d0f8d2d7dda704177690a5fc7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 22 Apr 2019 08:59:21 -0700 Subject: [PATCH 087/429] chore(docs): formatting updates (#129) --- .../src/v1/doc/google/protobuf/doc_any.js | 3 ++- .../v1/doc/google/protobuf/doc_timestamp.js | 26 ++++++++++--------- .../v1beta1/doc/google/protobuf/doc_any.js | 3 ++- .../doc/google/protobuf/doc_timestamp.js | 26 ++++++++++--------- packages/google-cloud-asset/synth.metadata | 12 ++++----- 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js index f3278b34e66..9ff5d007807 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js @@ -98,7 +98,8 @@ * * @property {string} typeUrl * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js index b47f41c2b30..98c19dbf0d3 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js @@ -16,17 +16,19 @@ // to be loaded as the JS file. /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -91,7 +93,7 @@ * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js index f3278b34e66..9ff5d007807 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -98,7 +98,8 @@ * * @property {string} typeUrl * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must represent + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent * the fully qualified name of the type (as in * `path/google.protobuf.Duration`). The name should be in a canonical form * (e.g., leading "." is not accepted). diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index b47f41c2b30..98c19dbf0d3 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -16,17 +16,19 @@ // to be loaded as the JS file. /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -91,7 +93,7 @@ * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 38b61fd611b..424f3f8773f 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-03-28T11:24:52.255771Z", + "updateTime": "2019-04-21T11:38:37.642404Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.20", - "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" + "version": "0.16.26", + "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6a84b3267b0a95e922608b9891219075047eee29", - "internalRef": "240640999" + "sha": "3369c803f56d52662ea3792076deb8545183bdb0", + "internalRef": "244282812" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.2.26" + "version": "2019.4.10" } } ], From 6f80536a34e0914c83860f2b336303bb4dbd9d45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 22 Apr 2019 09:26:26 -0700 Subject: [PATCH 088/429] chore(deps): update dependency nyc to v14 chore(deps): update dependency nyc to v14 This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---| | nyc | devDependencies | major | [`^13.0.0` -> `^14.0.0`](https://diff.intrinsic.com/nyc/13.3.0/14.0.0) | [source](https://togithub.com/istanbuljs/nyc) | --- ### Release Notes
istanbuljs/nyc ### [`v14.0.0`](https://togithub.com/istanbuljs/nyc/blob/master/CHANGELOG.md#​1400httpsgithubcomistanbuljsnyccomparev1330v1400-2019-04-15) [Compare Source](https://togithub.com/istanbuljs/nyc/compare/v13.3.0...v14.0.0) ##### Bug Fixes - Add `cwd` option to instrument command ([#​1024](https://togithub.com/istanbuljs/nyc/issues/1024)) ([051d95a](https://togithub.com/istanbuljs/nyc/commit/051d95a)) - Add config values to hash salt ([#​988](https://togithub.com/istanbuljs/nyc/issues/988)) ([7ac325d](https://togithub.com/istanbuljs/nyc/commit/7ac325d)), closes [#​522](https://togithub.com/istanbuljs/nyc/issues/522) - Exclude negated not working with '--all' switch ([#​977](https://togithub.com/istanbuljs/nyc/issues/977)) ([91de23c](https://togithub.com/istanbuljs/nyc/commit/91de23c)) - Make --all work for transpiled code ([#​1047](https://togithub.com/istanbuljs/nyc/issues/1047)) ([18e04ba](https://togithub.com/istanbuljs/nyc/commit/18e04ba)) - Resolve absolute paths in nyc instrument ([#​1012](https://togithub.com/istanbuljs/nyc/issues/1012)) ([3cb1861](https://togithub.com/istanbuljs/nyc/commit/3cb1861)), closes [#​1014](https://togithub.com/istanbuljs/nyc/issues/1014) - Set processinfo pid/ppid to actual numbers ([#​1057](https://togithub.com/istanbuljs/nyc/issues/1057)) ([32f75b0](https://togithub.com/istanbuljs/nyc/commit/32f75b0)) - Use a single instance of nyc for all actions of main command. ([#​1059](https://togithub.com/istanbuljs/nyc/issues/1059)) ([b909575](https://togithub.com/istanbuljs/nyc/commit/b909575)) ##### Features - Add `delete` option to instrument command ([#​1005](https://togithub.com/istanbuljs/nyc/issues/1005)) ([d6db551](https://togithub.com/istanbuljs/nyc/commit/d6db551)) - Add `include` and `exclude` options to instrument command ([#​1007](https://togithub.com/istanbuljs/nyc/issues/1007)) ([8da097e](https://togithub.com/istanbuljs/nyc/commit/8da097e)) - Add processinfo index, add externalId ([#​1055](https://togithub.com/istanbuljs/nyc/issues/1055)) ([8dcf180](https://togithub.com/istanbuljs/nyc/commit/8dcf180)) - Add support for nyc.config.js ([#​1019](https://togithub.com/istanbuljs/nyc/issues/1019)) ([3b203c7](https://togithub.com/istanbuljs/nyc/commit/3b203c7)) - Add support to exclude files on coverage report generation ([#​982](https://togithub.com/istanbuljs/nyc/issues/982)) ([509c6aa](https://togithub.com/istanbuljs/nyc/commit/509c6aa)) - Add test-exclude args to check-coverage and report subcommands. ([0fc217e](https://togithub.com/istanbuljs/nyc/commit/0fc217e)) - Always build the processinfo temp dir ([#​1061](https://togithub.com/istanbuljs/nyc/issues/1061)) ([c213469](https://togithub.com/istanbuljs/nyc/commit/c213469)) - Enable `es-modules` option for nyc instrument command ([#​1006](https://togithub.com/istanbuljs/nyc/issues/1006)) ([596b120](https://togithub.com/istanbuljs/nyc/commit/596b120)) - Fix excludeAfterRemap functionality. ([36bcc0b](https://togithub.com/istanbuljs/nyc/commit/36bcc0b)) - Implement `nyc instrument --complete-copy` ([#​1056](https://togithub.com/istanbuljs/nyc/issues/1056)) ([2eb13c6](https://togithub.com/istanbuljs/nyc/commit/2eb13c6)) - Remove bundling ([#​1017](https://togithub.com/istanbuljs/nyc/issues/1017)) ([b25492a](https://togithub.com/istanbuljs/nyc/commit/b25492a)) - Support turning off node_modules default exclude via `exclude-node-modules` option ([#​912](https://togithub.com/istanbuljs/nyc/issues/912)) ([b7e16cd](https://togithub.com/istanbuljs/nyc/commit/b7e16cd)) - Add support for `--exclude-node-modules` to subcommands. ([#​1053](https://togithub.com/istanbuljs/nyc/issues/1053)) ([e597c46](https://togithub.com/istanbuljs/nyc/commit/e597c46)) ##### BREAKING CHANGES - The `--exclude-after-remap` option is now functional and enabled by default. This causes the `include` and `exclude` lists to be processed after using source maps to determine the original filename of sources. - Add a file named 'index.json' to the .nyc_output/processinfo directory, which has a different format from the other files in this dir. - Change the data type of the pid/ppid fields in processinfo files - `nyc instrument` now honors `include` and `exclude` settings, potentially resulting in some files that were previously instrumented being ignored. - The `plugins` option has been renamed to `parser-plugins`. - The logic involving include/exclude processing has changed. Results should be verified to ensure all desired sources have coverage data. - `nyc instrument` now enables the `--es-module` option by default. This can cause failures to instrument scripts which violate `'use strict'` rules.
--- ### 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 stale, or if you modify the PR title to begin with "`rebase!`". :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 [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-asset). #128 automerged by dpebot --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c46af49939b..83148f3e259 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -57,7 +57,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^6.0.0", - "nyc": "^13.0.0", + "nyc": "^14.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7", "linkinator": "^1.1.2" From b250b120589757374cb5cb0290a354aaf0ea6976 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 29 Apr 2019 15:02:16 -0700 Subject: [PATCH 089/429] update to .nycrc with --all enabled (#131) --- packages/google-cloud-asset/.nycrc | 40 +++++++++++++----------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index 88b001cb587..bfe4073a6ab 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -1,28 +1,22 @@ { "report-dir": "./.coverage", - "reporter": "lcov", + "reporter": ["text", "lcov"], "exclude": [ - "src/*{/*,/**/*}.js", - "src/*/v*/*.js", - "test/**/*.js", - "build/test" + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/docs", + "**/samples", + "**/scripts", + "**/src/**/v*/**/*.js", + "**/test", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" ], - "watermarks": { - "branches": [ - 95, - 100 - ], - "functions": [ - 95, - 100 - ], - "lines": [ - 95, - 100 - ], - "statements": [ - 95, - 100 - ] - } + "exclude-after-remap": false, + "all": true } From 99d845e5bde6c851b00c62fd0361c07bb5ea0b2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 2 May 2019 09:13:59 -0700 Subject: [PATCH 090/429] fix(deps): update dependency google-gax to ^0.26.0 (#132) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 83148f3e259..126956fb397 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -42,7 +42,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^0.25.0", + "google-gax": "^0.26.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 4be67a2323b69f51b8db98e9df3357afec0dbfb7 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 2 May 2019 11:28:04 -0700 Subject: [PATCH 091/429] build!: upgrade engines field to >=8.10.0 (#134) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 126956fb397..1e4377cffde 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=6.0.0" + "node": ">=8.10.0" }, "repository": "googleapis/nodejs-asset", "main": "src/index.js", From c072ab45dc6318362b0b140c9df65e1954ebcc88 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 3 May 2019 08:19:03 -0700 Subject: [PATCH 092/429] chore(deps): update dependency eslint-plugin-node to v9 (#136) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1e4377cffde..b8dd134c512 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -51,7 +51,7 @@ "codecov": "^3.0.4", "eslint": "^5.1.0", "eslint-config-prettier": "^4.0.0", - "eslint-plugin-node": "^8.0.0", + "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", From 7674e552bccfa32cd7f938e20cb5b53583f96f21 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 7 May 2019 09:57:44 -0700 Subject: [PATCH 093/429] build: only pipe to codecov if tests run in Node 10 (#137) --- packages/google-cloud-asset/synth.metadata | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 424f3f8773f..b93d3eb2256 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-04-21T11:38:37.642404Z", + "updateTime": "2019-05-04T11:08:40.331631Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.26", - "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" + "version": "0.18.0", + "dockerImage": "googleapis/artman@sha256:29bd82cc42c43825fde408e63fc955f3f9d07ff9989243d7aa0f91a35c7884dc" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3369c803f56d52662ea3792076deb8545183bdb0", - "internalRef": "244282812" + "sha": "39c876cca5403e7e8282ce2229033cc3cc02962c", + "internalRef": "246561601" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From 52d00c86c986c5c6dc1786f77e508b058107dcdc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 10 May 2019 11:42:39 -0700 Subject: [PATCH 094/429] fix(deps): update dependency google-gax to v1 (#142) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b8dd134c512..186654be15d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -42,7 +42,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^0.26.0", + "google-gax": "^1.0.0", "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, From 9eebed1956083b6b0ba5d23952575614ce700cac Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Fri, 10 May 2019 16:51:55 -0700 Subject: [PATCH 095/429] feat: introduces 'expression text', deprecates version field (#143) --- .../google-cloud-asset/samples/package.json | 2 +- .../src/v1/doc/google/iam/v1/doc_policy.js | 39 ++++++++++---- .../src/v1/doc/google/type/doc_expr.js | 51 +++++++++++++++++++ .../v1beta1/doc/google/iam/v1/doc_policy.js | 39 ++++++++++---- .../src/v1beta1/doc/google/type/doc_expr.js | 51 +++++++++++++++++++ packages/google-cloud-asset/synth.metadata | 10 ++-- 6 files changed, 168 insertions(+), 24 deletions(-) create mode 100644 packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js create mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 527c478b300..24919a5c5a5 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -12,7 +12,7 @@ "repository": "googleapis/nodejs-asset", "private": true, "scripts": { - "test": "mocha --timeout 20000" + "test": "mocha --timeout 40000" }, "dependencies": { "@google-cloud/asset": "^0.3.0", diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index bcae4a7d873..09c3a5bdc56 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -20,12 +20,12 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * A `Policy` consists of a list of `bindings`. A `binding` binds a list of * `members` to a `role`, where the members can be user accounts, Google groups, * Google domains, and service accounts. A `role` is a named list of permissions * defined by IAM. * - * **Example** + * **JSON Example** * * { * "bindings": [ @@ -35,7 +35,7 @@ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" * ] * }, * { @@ -45,15 +45,28 @@ * ] * } * + * **YAML Example** + * + * bindings: + * - members: + * - user:mike@example.com + * - group:admins@example.com + * - domain:google.com + * - serviceAccount:my-other-app@appspot.gserviceaccount.com + * role: roles/owner + * - members: + * - user:sean@example.com + * role: roles/viewer + * + * * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam). + * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Version of the `Policy`. The default version is 0. + * Deprecated. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. - * Multiple `bindings` must not be specified for the same `role`. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -84,7 +97,6 @@ const Policy = { * @property {string} role * Role that is assigned to `members`. * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required * * @property {string[]} members * Specifies the identities requesting access for a Cloud Platform resource. @@ -97,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` or `joe@example.com`. + * account. For example, `alice@gmail.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service @@ -106,9 +118,18 @@ const Policy = { * * `group:{emailid}`: An email address that represents a Google group. * For example, `admins@example.com`. * - * * `domain:{domain}`: A Google Apps domain name that represents all the + * + * * `domain:{domain}`: The G Suite domain (primary) that represents all the * users of that domain. For example, `google.com` or `example.com`. * + * @property {Object} condition + * The condition that is associated with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * + * This object should have the same structure as [Expr]{@link google.type.Expr} + * * @typedef Binding * @memberof google.iam.v1 * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} diff --git a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js new file mode 100644 index 00000000000..421a7ee9e6a --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js @@ -0,0 +1,51 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Represents an expression text. Example: + * + * title: "User account presence" + * description: "Determines whether the request has a user account" + * expression: "size(request.user) > 0" + * + * @property {string} expression + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + * + * @property {string} title + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * @property {string} description + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * @property {string} location + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * @typedef Expr + * @memberof google.type + * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} + */ +const Expr = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index bcae4a7d873..09c3a5bdc56 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -20,12 +20,12 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * A `Policy` consists of a list of `bindings`. A `binding` binds a list of * `members` to a `role`, where the members can be user accounts, Google groups, * Google domains, and service accounts. A `role` is a named list of permissions * defined by IAM. * - * **Example** + * **JSON Example** * * { * "bindings": [ @@ -35,7 +35,7 @@ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" * ] * }, * { @@ -45,15 +45,28 @@ * ] * } * + * **YAML Example** + * + * bindings: + * - members: + * - user:mike@example.com + * - group:admins@example.com + * - domain:google.com + * - serviceAccount:my-other-app@appspot.gserviceaccount.com + * role: roles/owner + * - members: + * - user:sean@example.com + * role: roles/viewer + * + * * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam). + * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Version of the `Policy`. The default version is 0. + * Deprecated. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. - * Multiple `bindings` must not be specified for the same `role`. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -84,7 +97,6 @@ const Policy = { * @property {string} role * Role that is assigned to `members`. * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required * * @property {string[]} members * Specifies the identities requesting access for a Cloud Platform resource. @@ -97,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` or `joe@example.com`. + * account. For example, `alice@gmail.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service @@ -106,9 +118,18 @@ const Policy = { * * `group:{emailid}`: An email address that represents a Google group. * For example, `admins@example.com`. * - * * `domain:{domain}`: A Google Apps domain name that represents all the + * + * * `domain:{domain}`: The G Suite domain (primary) that represents all the * users of that domain. For example, `google.com` or `example.com`. * + * @property {Object} condition + * The condition that is associated with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * + * This object should have the same structure as [Expr]{@link google.type.Expr} + * * @typedef Binding * @memberof google.iam.v1 * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js new file mode 100644 index 00000000000..421a7ee9e6a --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js @@ -0,0 +1,51 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Represents an expression text. Example: + * + * title: "User account presence" + * description: "Determines whether the request has a user account" + * expression: "size(request.user) > 0" + * + * @property {string} expression + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + * + * @property {string} title + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * @property {string} description + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * @property {string} location + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * @typedef Expr + * @memberof google.type + * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} + */ +const Expr = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index b93d3eb2256..4aa916dc3aa 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-04T11:08:40.331631Z", + "updateTime": "2019-05-10T11:55:39.589987Z", "sources": [ { "generator": { "name": "artman", - "version": "0.18.0", - "dockerImage": "googleapis/artman@sha256:29bd82cc42c43825fde408e63fc955f3f9d07ff9989243d7aa0f91a35c7884dc" + "version": "0.19.0", + "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "39c876cca5403e7e8282ce2229033cc3cc02962c", - "internalRef": "246561601" + "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", + "internalRef": "247530843" } }, { From 9b3be1b4335cf80c75ce12fb260dbe85858b6708 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 May 2019 17:36:43 +0000 Subject: [PATCH 096/429] docs: use repo-meta to generate README (#130) --- .../google-cloud-asset/.cloud-repo-tools.json | 8 -- .../google-cloud-asset/.repo-metadata.json | 13 ++ packages/google-cloud-asset/README.md | 134 +++++++++++------- packages/google-cloud-asset/package.json | 12 +- packages/google-cloud-asset/samples/README.md | 86 +++++++++++ .../google-cloud-asset/samples/quickstart.js | 129 +++++------------ .../{quickstart.test.js => sample.test.js} | 13 +- packages/google-cloud-asset/synth.metadata | 2 +- 8 files changed, 229 insertions(+), 168 deletions(-) delete mode 100644 packages/google-cloud-asset/.cloud-repo-tools.json create mode 100644 packages/google-cloud-asset/.repo-metadata.json create mode 100644 packages/google-cloud-asset/samples/README.md rename packages/google-cloud-asset/samples/test/{quickstart.test.js => sample.test.js} (79%) diff --git a/packages/google-cloud-asset/.cloud-repo-tools.json b/packages/google-cloud-asset/.cloud-repo-tools.json deleted file mode 100644 index 29239a36b73..00000000000 --- a/packages/google-cloud-asset/.cloud-repo-tools.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "requiresKeyFile": true, - "requiresProjectId": true, - "product": "asset", - "client_reference_url": "https://cloud.google.com/nodejs/docs/reference/asset/latest/", - "release_quality": "alpha", - "samples": [] -} diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json new file mode 100644 index 00000000000..2458047ddb4 --- /dev/null +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "asset", + "name_pretty": "Cloud Asset Inventory", + "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/asset/latest/", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", + "release_level": "alpha", + "language": "nodejs", + "repo": "googleapis/nodejs-asset", + "distribution_name": "@google-cloud/asset", + "api_id": "cloudasset.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 8615ff730c9..e1cbf67468d 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -1,79 +1,120 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `npm run generate-scaffolding`." +[//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) +# [Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) -[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) -[Cloud Asset Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) is a storage service that keeps a five week history of Google Cloud Platform (GCP) asset metadata. It allows you to export all asset metadata at a certain timestamp or timeframe. -* [Using the client library](#using-the-client-library) + +Cloud Asset API client for Node.js + + +* [Cloud Asset Inventory Node.js Client API Reference][client-docs] +* [Cloud Asset Inventory Documentation][product-docs] +* [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) -## Using the client library +## Quickstart -1. [Select or create a Cloud Platform project][projects]. +### Before you begin +1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. - -1. [Enable the Google Cloud Asset Inventory API][enable_api]. - +1. [Enable the Cloud Asset Inventory API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. -1. Install the client library: +### Installing the client library + +```bash +npm install @google-cloud/asset +``` - npm install --save @google-cloud/asset -1. Try an example: +### Using the client library ```javascript - const asset = require('@google-cloud/asset'); - const client = new asset.v1beta1.AssetServiceClient({ - // optional auth parameters. - }); - - // Your Google Cloud Platform project ID - const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); - - // var dumpFilePath = 'Dump file path, e.g.: gs:///' - const outputConfig = { - gcsDestination: { - uri: dumpFilePath, - }, - }; - const request = { - parent: projectResource, - outputConfig: outputConfig, - }; - - // Handle the operation using the promise pattern. - const [operation] = await client.exportAssets(request); - // Operation#promise starts polling for the completion of the operation. - const [result] = await operation.promise(); - // Do things with with the response. - console.log(result); + const util = require('util'); + const {AssetServiceClient} = require('@google-cloud/asset'); + + const client = new AssetServiceClient(); + + async function quickstart() { + const projectId = await client.getProjectId(); + const projectResource = client.projectPath(projectId); + // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. + // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; + + const request = { + parent: projectResource, + assetNames: assetNames, + contentType: 'RESOURCE', + readTimeWindow: { + startTime: { + seconds: Math.floor(new Date().getTime() / 1000), + }, + }, + }; + + // Handle the operation using the promise pattern. + const result = await client.batchGetAssetsHistory(request); + // Do things with with the response. + console.log(util.inspect(result, {depth: null})); + ``` -The [Cloud Asset Node.js Client API Reference][client-docs] documentation + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | +| Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | +| Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Cloud Asset Inventory Node.js Client API Reference][client-docs] documentation also contains samples. ## Versioning This library follows [Semantic Versioning](http://semver.org/). + + + This library is considered to be in **alpha**. 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] [launch_stages]: https://cloud.google.com/terms/launch-stages @@ -88,21 +129,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) -## What's Next - -* [Cloud Asset Documentation][product-docs] -* [Cloud Asset Node.js Client API Reference][client-docs] -* [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset) - -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 - [client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/ [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [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=cloudasset.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 186654be15d..90daf696965 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -31,14 +31,13 @@ "scripts": { "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", - "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs -r --skip www.googleapis.com", + "docs-test": "linkinator docs -r --skip 'www.googleapis.com|github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js|github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js'", "predocs-test": "npm run docs" }, "dependencies": { @@ -47,19 +46,18 @@ "protobufjs": "^6.8.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "^3.0.0", "codecov": "^3.0.4", "eslint": "^5.1.0", "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", - "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", - "jsdoc": "^3.5.5", + "jsdoc": "^3.6.2", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "linkinator": "^1.1.2", "mocha": "^6.0.0", "nyc": "^14.0.0", "power-assert": "^1.6.0", - "prettier": "^1.13.7", - "linkinator": "^1.1.2" + "prettier": "^1.13.7" } } diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md new file mode 100644 index 00000000000..de14938efb3 --- /dev/null +++ b/packages/google-cloud-asset/samples/README.md @@ -0,0 +1,86 @@ +[//]: # "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 + +# [Cloud Asset Inventory: Node.js Samples](https://github.com/googleapis/nodejs-asset) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Export Assets](#export-assets) + * [Get Batch Asset History](#get-batch-asset-history) + * [Asset History Quickstart](#asset-history-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-asset#using-the-client-library). + +## Samples + + + +### Export Assets + +Export asserts to specified dump file path. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) + +__Usage:__ + + +`node exportAssets.js ` + + +----- + + + + +### Get Batch Asset History + +Batch get history of assets. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) + +__Usage:__ + + +`node getBatchAssetHistory "storage.googleapis.com/"` + + +----- + + + + +### Asset History Quickstart + +Batch get history of assets. + +View the [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node getBatchAssetHistory "storage.googleapis.com/"` + + + + + + +[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-asset&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview \ No newline at end of file diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 8bb9c04d439..c13fb2b9912 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -15,105 +15,42 @@ 'use strict'; -async function exportAssets(dumpFilePath) { - // [START asset_quickstart_export_assets] - const {AssetServiceClient} = require('@google-cloud/asset'); - const client = new AssetServiceClient({ - // optional auth parameters. - }); - - // Your Google Cloud Platform project ID - const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); - - // var dumpFilePath = 'Dump file path, e.g.: gs:///' - const outputConfig = { - gcsDestination: { - uri: dumpFilePath, - }, - }; - const request = { - parent: projectResource, - outputConfig: outputConfig, - }; - - // Handle the operation using the promise pattern. - const [operation] = await client.exportAssets(request); - // Operation#promise starts polling for the completion of the operation. - const [result] = await operation.promise(); - // Do things with with the response. - console.log(result); - // [END asset_quickstart_export_assets] -} +// sample-metadata: +// title: Asset History Quickstart +// description: Batch get history of assets. +// usage: node getBatchAssetHistory "//storage.googleapis.com/" -async function batchGetAssetsHistory(assetNames) { - // [START asset_quickstart_batch_get_assets_history] +async function main(assetNames) { + // [START asset_quickstart] const util = require('util'); const {AssetServiceClient} = require('@google-cloud/asset'); - const client = new AssetServiceClient({ - // optional auth parameters. - }); - // Your Google Cloud Platform project ID - const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); - // Your asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. - // var assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; - - const contentType = 'RESOURCE'; - const readTimeWindow = { - startTime: { - seconds: Math.floor(new Date().getTime() / 1000), - }, - }; - - const request = { - parent: projectResource, - assetNames: assetNames, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Handle the operation using the promise pattern. - const result = await client.batchGetAssetsHistory(request); - // Do things with with the response. - console.log(util.inspect(result, {depth: null})); - // [END asset_quickstart_batch_get_assets_history] + const client = new AssetServiceClient(); + + async function quickstart() { + const projectId = await client.getProjectId(); + const projectResource = client.projectPath(projectId); + // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. + // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; + + const request = { + parent: projectResource, + assetNames: assetNames.split(','), + contentType: 'RESOURCE', + readTimeWindow: { + startTime: { + seconds: Math.floor(new Date().getTime() / 1000), + }, + }, + }; + + // Handle the operation using the promise pattern. + const result = await client.batchGetAssetsHistory(request); + // Do things with with the response. + console.log(util.inspect(result, {depth: null})); + // [END asset_quickstart] + } + quickstart(); } -const cli = require('yargs') - .demand(1) - .command( - 'export-assets ', - 'Export asserts to specified dump file path.', - {}, - opts => exportAssets(opts.dumpFilePath) - ) - .command( - 'batch-get-history ', - 'Batch get history of assets.', - {}, - opts => { - const assetNameList = opts.assetNames.split(','); - batchGetAssetsHistory(assetNameList); - } - ) - .example( - 'node $0 export-assets gs://my-bucket/my-assets.txt', - 'Export assets to gs://my-bucket/my-assets.txt.' - ) - .example( - 'node $0 batch-get-history "//storage.googleapis.com/,"', - 'Batch get history of assets //storage.googleapis.com/ etc.' - ) - .wrap(10) - .recommendCommands() - .epilogue( - 'https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview' - ) - .help() - .strict(); - -if (module === require.main) { - cli.parse(process.argv.slice(2)); -} +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/test/quickstart.test.js b/packages/google-cloud-asset/samples/test/sample.test.js similarity index 79% rename from packages/google-cloud-asset/samples/test/quickstart.test.js rename to packages/google-cloud-asset/samples/test/sample.test.js index 688490a1cb5..7253495cbd1 100644 --- a/packages/google-cloud-asset/samples/test/quickstart.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -22,7 +22,6 @@ const {Storage} = require('@google-cloud/storage'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -const cmd = 'node quickstart.js'; const storage = new Storage(); const bucketName = `asset-nodejs-${uuid.v4()}`; const bucket = storage.bucket(bucketName); @@ -38,7 +37,7 @@ describe('quickstart sample tests', () => { it('should export assets to specified path', async () => { const dumpFilePath = `gs://${bucketName}/my-assets.txt`; - execSync(`${cmd} export-assets ${dumpFilePath}`); + execSync(`node exportAssets ${dumpFilePath}`); const file = await bucket.file('my-assets.txt'); const exists = await file.exists(); assert.ok(exists); @@ -47,7 +46,13 @@ describe('quickstart sample tests', () => { it('should get assets history successfully', async () => { const assetName = `//storage.googleapis.com/${bucketName}`; - const stdout = execSync(`${cmd} batch-get-history ${assetName}`); - assert.match(stdout, new RegExp(assetName)); + const stdout = execSync(`node getBatchAssetHistory ${assetName}`); + assert.include(stdout, assetName); + }); + + it('should run the quickstart', async () => { + const assetName = `//storage.googleapis.com/${bucketName}`; + const stdout = execSync(`node quickstart ${assetName}`); + assert.include(stdout, assetName); }); }); diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 4aa916dc3aa..e43e475c29f 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -46,4 +46,4 @@ } } ] -} \ No newline at end of file +} From 80997b87de1e583780571bc85c3fce25c81e639d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 13 May 2019 11:02:13 -0700 Subject: [PATCH 097/429] docs(test): removed exception for docs now on master (#147) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 90daf696965..f74ad6e4fae 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -37,7 +37,7 @@ "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs -r --skip 'www.googleapis.com|github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js|github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js'", + "docs-test": "linkinator docs -r --skip www.googleapis.com", "predocs-test": "npm run docs" }, "dependencies": { From 88c43eb68014f00b0ff9c1285e889036a78400fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 May 2019 12:45:16 -0700 Subject: [PATCH 098/429] chore: release 1.0.0 (#146) --- packages/google-cloud-asset/CHANGELOG.md | 25 ++++++++++++++++++- packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 249b0772778..8d3de078a26 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,30 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.0.0](https://www.github.com/googleapis/nodejs-asset/compare/v0.3.0...v1.0.0) (2019-05-11) + + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#132](https://www.github.com/googleapis/nodejs-asset/issues/132)) ([29dec78](https://www.github.com/googleapis/nodejs-asset/commit/29dec78)) +* **deps:** update dependency google-gax to v1 ([#142](https://www.github.com/googleapis/nodejs-asset/issues/142)) ([c5d4508](https://www.github.com/googleapis/nodejs-asset/commit/c5d4508)) +* include 'x-goog-request-params' header in requests ([#126](https://www.github.com/googleapis/nodejs-asset/issues/126)) ([ff57600](https://www.github.com/googleapis/nodejs-asset/commit/ff57600)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#134](https://www.github.com/googleapis/nodejs-asset/issues/134)) ([ad7814c](https://www.github.com/googleapis/nodejs-asset/commit/ad7814c)) + + +### Features + +* introduces 'expression text', deprecates version field ([#143](https://www.github.com/googleapis/nodejs-asset/issues/143)) ([4c35683](https://www.github.com/googleapis/nodejs-asset/commit/4c35683)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#134) + ## v0.3.0 03-19-2019 11:42 PDT @@ -115,4 +139,3 @@ const client = new asset.v1.AssetServiceClient(); ## v0.1.0 Initial release of the Cloud Asset API. - diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index f74ad6e4fae..45daba1f08c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "0.3.0", + "version": "1.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 24919a5c5a5..778de7d29e3 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 40000" }, "dependencies": { - "@google-cloud/asset": "^0.3.0", + "@google-cloud/asset": "^1.0.0", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From 03aa6fbe922d946377d7c48f52272405da2ad6a0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 14 May 2019 08:49:55 -0700 Subject: [PATCH 099/429] docs: update quickstart sample in README (#148) --- packages/google-cloud-asset/README.md | 2 +- packages/google-cloud-asset/synth.metadata | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index e1cbf67468d..794cbd87aed 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -68,7 +68,7 @@ npm install @google-cloud/asset const request = { parent: projectResource, - assetNames: assetNames, + assetNames: assetNames.split(','), contentType: 'RESOURCE', readTimeWindow: { startTime: { diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e43e475c29f..25bc4ca5cca 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-10T11:55:39.589987Z", + "updateTime": "2019-05-14T11:07:52.148324Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", - "internalRef": "247530843" + "sha": "ffa256646fb15c4a6c720f0ed8f984a0ea513416", + "internalRef": "248066377" } }, { @@ -46,4 +46,4 @@ } } ] -} +} \ No newline at end of file From b567b066c20c83a42a237e9ec26000d400332069 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 08:20:58 -0700 Subject: [PATCH 100/429] build: add new kokoro config for coverage and release-please (#149) --- packages/google-cloud-asset/synth.metadata | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 25bc4ca5cca..0b08ad7ec60 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-14T11:07:52.148324Z", + "updateTime": "2019-05-17T01:01:41.048253Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ffa256646fb15c4a6c720f0ed8f984a0ea513416", - "internalRef": "248066377" + "sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69", + "internalRef": "248524261" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.4.10" } } ], From 920c2deb91bf1540d538fd942d2c09bd424a6f2a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 16:47:58 -0700 Subject: [PATCH 101/429] build: updated kokoro config for coverage and release-please (#150) --- packages/google-cloud-asset/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0b08ad7ec60..6a279aaf612 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-17T01:01:41.048253Z", + "updateTime": "2019-05-17T19:41:10.239395Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69", - "internalRef": "248524261" + "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", + "internalRef": "248724297" } }, { From 9f13ac0416c4d5cb14c1fbe19046c0177aec0ef9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 May 2019 13:03:30 -0700 Subject: [PATCH 102/429] refactor: drop dependency on lodash.merge and update links (#151) --- packages/google-cloud-asset/package.json | 1 - .../src/v1/asset_service_client.js | 18 +++++++----------- .../src/v1beta1/asset_service_client.js | 18 +++++++----------- packages/google-cloud-asset/synth.metadata | 12 ++++++------ 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 45daba1f08c..173680037d8 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -42,7 +42,6 @@ }, "dependencies": { "google-gax": "^1.0.0", - "lodash.merge": "^4.6.0", "protobufjs": "^6.8.0" }, "devDependencies": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index 7e515879563..52226896693 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -16,7 +16,6 @@ const gapicConfig = require('./asset_service_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -89,12 +88,9 @@ class AssetServiceClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/cloud/asset/v1/asset_service.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/asset/v1/asset_service.proto'] ); // This API contains "path templates"; forward-slash-separated @@ -254,13 +250,13 @@ class AssetServiceClient { * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} * @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. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example @@ -397,7 +393,7 @@ class AssetServiceClient { * size of the asset name list is 100 in one request. * @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. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index fb62e57bcdb..3a6efbb71f7 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -16,7 +16,6 @@ const gapicConfig = require('./asset_service_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -89,12 +88,9 @@ class AssetServiceClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/cloud/asset/v1beta1/asset_service.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/asset/v1beta1/asset_service.proto'] ); // This API contains "path templates"; forward-slash-separated @@ -255,13 +251,13 @@ class AssetServiceClient { * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} * @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. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example @@ -395,7 +391,7 @@ class AssetServiceClient { * size of the asset name list is 100 in one request. * @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. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 6a279aaf612..f0fbec7d7df 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-05-17T19:41:10.239395Z", + "updateTime": "2019-05-21T11:07:32.789700Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.20.0", + "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", - "internalRef": "248724297" + "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160", + "internalRef": "249058354" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From f8912928a1a0dd435891d9af1c157a9b85995603 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 May 2019 02:37:41 +0000 Subject: [PATCH 103/429] chore: use published jsdoc-baseline package (#152) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 173680037d8..cb07a8bc11d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -52,7 +52,7 @@ "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", - "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "jsdoc-baseline": "^0.1.0", "linkinator": "^1.1.2", "mocha": "^6.0.0", "nyc": "^14.0.0", From a7ecbbe24080e64abdeb18d540942e9526ad38b5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 28 May 2019 20:37:29 +0000 Subject: [PATCH 104/429] build: ignore proto files in test coverage (#154) --- packages/google-cloud-asset/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index bfe4073a6ab..83a421a0628 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -10,6 +10,7 @@ "**/samples", "**/scripts", "**/src/**/v*/**/*.js", + "**/protos", "**/test", ".jsdoc.js", "**/.jsdoc.js", From ffccd5f94dab16315d4bbf49e6f8c893585509f2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 10:01:30 -0700 Subject: [PATCH 105/429] feat: support apiEndpoint override in client constructor (#157) --- .../src/v1/asset_service_client.js | 14 ++++++++++++- .../src/v1beta1/asset_service_client.js | 14 ++++++++++++- packages/google-cloud-asset/synth.metadata | 10 ++++----- packages/google-cloud-asset/test/gapic-v1.js | 21 +++++++++++++++++++ .../google-cloud-asset/test/gapic-v1beta1.js | 21 +++++++++++++++++++ 5 files changed, 73 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index 52226896693..a2beffdc213 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -56,14 +56,18 @@ class AssetServiceClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -183,6 +187,14 @@ class AssetServiceClient { return 'cloudasset.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 3a6efbb71f7..e849eee7cbd 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -56,14 +56,18 @@ class AssetServiceClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -183,6 +187,14 @@ class AssetServiceClient { return 'cloudasset.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f0fbec7d7df..9acb54cf53a 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-21T11:07:32.789700Z", + "updateTime": "2019-06-05T14:12:31.290419Z", "sources": [ { "generator": { "name": "artman", - "version": "0.20.0", - "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" + "version": "0.23.1", + "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160", - "internalRef": "249058354" + "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", + "internalRef": "251635729" } }, { diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js index 3645085a6c4..1fe67016ecb 100644 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ b/packages/google-cloud-asset/test/gapic-v1.js @@ -23,6 +23,27 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = assetModule.v1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = assetModule.v1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetModule.v1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new assetModule.v1.AssetServiceClient(); + assert(client); + }); + describe('exportAssets', function() { it('invokes exportAssets without error', done => { const client = new assetModule.v1.AssetServiceClient({ diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index 6e3d7f9445a..c3a67c17c66 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -23,6 +23,27 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = assetModule.v1beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = assetModule.v1beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetModule.v1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new assetModule.v1beta1.AssetServiceClient(); + assert(client); + }); + describe('exportAssets', function() { it('invokes exportAssets without error', done => { const client = new assetModule.v1beta1.AssetServiceClient({ From f8e99215a0dc673b509eebf03ab28d53324e113b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 10:14:52 -0700 Subject: [PATCH 106/429] chore: release 1.1.0 (#158) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 8d3de078a26..12c61b9e69b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.1.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.0.0...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override in client constructor ([#157](https://www.github.com/googleapis/nodejs-asset/issues/157)) ([0da529e](https://www.github.com/googleapis/nodejs-asset/commit/0da529e)) + ## [1.0.0](https://www.github.com/googleapis/nodejs-asset/compare/v0.3.0...v1.0.0) (2019-05-11) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index cb07a8bc11d..6fd8208109a 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.0.0", + "version": "1.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 778de7d29e3..fb57b54d42f 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 40000" }, "dependencies": { - "@google-cloud/asset": "^1.0.0", + "@google-cloud/asset": "^1.1.0", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From b781c7fb8586200063577ac46e4a76cd46001fee Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Jun 2019 08:13:09 -0700 Subject: [PATCH 107/429] docs: update return type in jsdoc for Buffers (#159) --- .../src/v1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1/doc/google/protobuf/doc_any.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_any.js | 2 +- packages/google-cloud-asset/synth.metadata | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index 09c3a5bdc56..e58c2122510 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -71,7 +71,7 @@ * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} * - * @property {string} etag + * @property {Buffer} etag * `etag` is used for optimistic concurrency control as a way to help * prevent simultaneous updates of a policy from overwriting each other. * It is strongly suggested that systems make use of the `etag` in the diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js index 9ff5d007807..cdd2fc80e49 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js @@ -125,7 +125,7 @@ * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * - * @property {string} value + * @property {Buffer} value * Must be a valid serialized protocol buffer of the above specified type. * * @typedef Any diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 09c3a5bdc56..e58c2122510 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -71,7 +71,7 @@ * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} * - * @property {string} etag + * @property {Buffer} etag * `etag` is used for optimistic concurrency control as a way to help * prevent simultaneous updates of a policy from overwriting each other. * It is strongly suggested that systems make use of the `etag` in the diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js index 9ff5d007807..cdd2fc80e49 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -125,7 +125,7 @@ * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * - * @property {string} value + * @property {Buffer} value * Must be a valid serialized protocol buffer of the above specified type. * * @typedef Any diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 9acb54cf53a..1b7b343beb9 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-05T14:12:31.290419Z", + "updateTime": "2019-06-12T11:09:03.735749Z", "sources": [ { "generator": { "name": "artman", - "version": "0.23.1", - "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" + "version": "0.24.1", + "dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", - "internalRef": "251635729" + "sha": "f117dac435e96ebe58d85280a3faf2350c4d4219", + "internalRef": "252714985" } }, { From 3bc744b0095fde5751f6ad273befbdda742e770b Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 12 Jun 2019 22:10:13 -0700 Subject: [PATCH 108/429] fix(docs): move to new client docs URL (#160) --- packages/google-cloud-asset/.repo-metadata.json | 4 ++-- packages/google-cloud-asset/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index 2458047ddb4..6af8ba7644a 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "asset", "name_pretty": "Cloud Asset Inventory", "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/asset/latest/", + "client_documentation": "https://googleapis.dev/nodejs/asset/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", "release_level": "alpha", "language": "nodejs", @@ -10,4 +10,4 @@ "distribution_name": "@google-cloud/asset", "api_id": "cloudasset.googleapis.com", "requires_billing": true -} +} \ No newline at end of file diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 794cbd87aed..6a4da737fee 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -129,7 +129,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) -[client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest/ +[client-docs]: https://googleapis.dev/nodejs/asset/latest [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From a4f1fc335b69e6b7d3e6fc5470f5a8a6fb754fae Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Jun 2019 08:39:09 -0700 Subject: [PATCH 109/429] chore: release 1.1.1 (#161) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 12c61b9e69b..646b2d480e7 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.1.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.0...v1.1.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#160](https://www.github.com/googleapis/nodejs-asset/issues/160)) ([d28147c](https://www.github.com/googleapis/nodejs-asset/commit/d28147c)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.0.0...v1.1.0) (2019-06-05) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 6fd8208109a..5107ae8122e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.1.0", + "version": "1.1.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index fb57b54d42f..9977e0625e1 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 40000" }, "dependencies": { - "@google-cloud/asset": "^1.1.0", + "@google-cloud/asset": "^1.1.1", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From d71194064ea0082996bcc83d940dce3c009971a3 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 18 Jun 2019 10:07:36 -0700 Subject: [PATCH 110/429] build: switch to GitHub magic proxy (#162) --- packages/google-cloud-asset/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 1b7b343beb9..001f66b77e2 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-12T11:09:03.735749Z", + "updateTime": "2019-06-18T00:57:22.750044Z", "sources": [ { "generator": { "name": "artman", - "version": "0.24.1", - "dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19" + "version": "0.26.0", + "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f117dac435e96ebe58d85280a3faf2350c4d4219", - "internalRef": "252714985" + "sha": "384aa843867c4d17756d14a01f047b6368494d32", + "internalRef": "253675319" } }, { From a5e2dd2e7c860123c157a398acbd360e5c511366 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 25 Jun 2019 16:42:21 -0700 Subject: [PATCH 111/429] fix(docs): link to reference docs section on googleapis.dev (#163) * fix(docs): reference docs should link to section of googleapis.dev with API reference * fix(docs): make anchors work in jsdoc --- packages/google-cloud-asset/.jsdoc.js | 3 +++ packages/google-cloud-asset/README.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 8a3eef2f267..f5870020e56 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -41,5 +41,8 @@ module.exports = { sourceFiles: false, systemName: '@google-cloud/asset', theme: 'lumen' + }, + markdown: { + idInHeadings: true } }; diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 6a4da737fee..5517dd1af39 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -129,10 +129,12 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/asset/latest +[client-docs]: https://googleapis.dev/nodejs/asset/latest#reference [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [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=cloudasset.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file +[auth]: https://cloud.google.com/docs/authentication/getting-started + + From 97e851df32ae9073b20916d7f0664d5889dabd55 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 26 Jun 2019 15:24:49 -0700 Subject: [PATCH 112/429] chore: release 1.1.2 (#164) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 646b2d480e7..908daaaab74 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.1.2](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#163](https://www.github.com/googleapis/nodejs-asset/issues/163)) ([290862a](https://www.github.com/googleapis/nodejs-asset/commit/290862a)) + ### [1.1.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.0...v1.1.1) (2019-06-14) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 5107ae8122e..9861da4e234 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.1.1", + "version": "1.1.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 9977e0625e1..c656ace1055 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 40000" }, "dependencies": { - "@google-cloud/asset": "^1.1.1", + "@google-cloud/asset": "^1.1.2", "@google-cloud/storage": "^2.3.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From 25dc0a4a7bf25a2c68b3edf5ddfcf41f23a88d09 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 28 Jun 2019 10:05:07 -0700 Subject: [PATCH 113/429] build: use config file for linkinator (#165) --- packages/google-cloud-asset/linkinator.config.json | 7 +++++++ packages/google-cloud-asset/package.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-asset/linkinator.config.json diff --git a/packages/google-cloud-asset/linkinator.config.json b/packages/google-cloud-asset/linkinator.config.json new file mode 100644 index 00000000000..d780d6bfff5 --- /dev/null +++ b/packages/google-cloud-asset/linkinator.config.json @@ -0,0 +1,7 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com" + ] +} diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 9861da4e234..38046c2d433 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -37,7 +37,7 @@ "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs -r --skip www.googleapis.com", + "docs-test": "linkinator docs", "predocs-test": "npm run docs" }, "dependencies": { @@ -53,7 +53,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-baseline": "^0.1.0", - "linkinator": "^1.1.2", + "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.0.0", "power-assert": "^1.6.0", From f05f638bc9a9e8204d7a380210ef74d23017b0a1 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 26 Jul 2019 18:58:22 +0300 Subject: [PATCH 114/429] chore(deps): update linters (#167) --- packages/google-cloud-asset/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 38046c2d433..5eebbd40d8e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -46,8 +46,8 @@ }, "devDependencies": { "codecov": "^3.0.4", - "eslint": "^5.1.0", - "eslint-config-prettier": "^4.0.0", + "eslint": "^6.0.0", + "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", From 71437cf849f8a1e0bad94f44977a7f197d3da63c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 26 Jul 2019 20:42:18 +0300 Subject: [PATCH 115/429] fix(deps): update dependency @google-cloud/storage to v3 (#168) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index c656ace1055..35067960cb7 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/asset": "^1.1.2", - "@google-cloud/storage": "^2.3.0", + "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^13.0.0" }, From 4d76336fd739710f2a23cfef60d6d30e5b9e42bc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 29 Jul 2019 08:45:01 -0700 Subject: [PATCH 116/429] chore: release 1.1.3 (#169) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 908daaaab74..e6ab1a19954 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.1.3](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.2...v1.1.3) (2019-07-29) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/storage to v3 ([#168](https://www.github.com/googleapis/nodejs-asset/issues/168)) ([6ba18e7](https://www.github.com/googleapis/nodejs-asset/commit/6ba18e7)) + ### [1.1.2](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.1...v1.1.2) (2019-06-26) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 5eebbd40d8e..0f73e75175a 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.1.2", + "version": "1.1.3", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 35067960cb7..03aa5cdf126 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 40000" }, "dependencies": { - "@google-cloud/asset": "^1.1.2", + "@google-cloud/asset": "^1.1.3", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From 32b9e116bf340b476dad8916ddc5b447d737f257 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 08:33:00 -0700 Subject: [PATCH 117/429] docs: use the jsdoc-fresh theme (#171) --- packages/google-cloud-asset/.jsdoc.js | 2 +- packages/google-cloud-asset/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index f5870020e56..d44d529b125 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/jsdoc-baseline', + template: './node_modules/jsdoc-fresh', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 0f73e75175a..37076070366 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -52,7 +52,7 @@ "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", - "jsdoc-baseline": "^0.1.0", + "jsdoc-fresh": "^1.0.1", "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.0.0", From f823a0f1b311a75433a9de5df0744ad6d6f01761 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 16:07:06 -0700 Subject: [PATCH 118/429] docs: document apiEndpoint over servicePath (#172) --- packages/google-cloud-asset/src/v1/asset_service_client.js | 2 +- packages/google-cloud-asset/src/v1beta1/asset_service_client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index a2beffdc213..eb7d5884b33 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -52,7 +52,7 @@ class AssetServiceClient { * your project ID will be detected automatically. * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @param {string} [options.servicePath] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts) { diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index e849eee7cbd..70db90403bd 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -52,7 +52,7 @@ class AssetServiceClient { * your project ID will be detected automatically. * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @param {string} [options.servicePath] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts) { From 4561cf81996023f16e066cb6e94e8ec53401d9da Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 2 Aug 2019 10:52:55 -0700 Subject: [PATCH 119/429] fix: allow calls with no request, add JSON proto --- .../google-cloud-asset/protos/protos.json | 1671 +++++++++++++++++ .../src/service_proto_list.json | 1 + .../src/v1/asset_service_client.js | 2 + .../src/v1beta1/asset_service_client.js | 2 + packages/google-cloud-asset/synth.metadata | 10 +- 5 files changed, 1681 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-asset/protos/protos.json create mode 100644 packages/google-cloud-asset/src/service_proto_list.json diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json new file mode 100644 index 00000000000..51e74a384e3 --- /dev/null +++ b/packages/google-cloud-asset/protos/protos.json @@ -0,0 +1,1671 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "asset": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1", + "php_namespace": "Google\\Cloud\\Asset\\V1" + }, + "nested": { + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + }, + "AssetService": { + "methods": { + "ExportAssets": { + "requestType": "ExportAssetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}:exportAssets", + "(google.api.http).body": "*" + } + }, + "BatchGetAssetsHistory": { + "requestType": "BatchGetAssetsHistoryRequest", + "responseType": "BatchGetAssetsHistoryResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}:batchGetAssetsHistory" + } + } + } + }, + "ExportAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 5 + } + } + }, + "ExportAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + } + } + }, + "BatchGetAssetsHistoryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "contentType": { + "type": "ContentType", + "id": 3 + }, + "readTimeWindow": { + "type": "TimeWindow", + "id": 4 + } + } + }, + "BatchGetAssetsHistoryResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "TemporalAsset", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "GcsDestination": { + "oneofs": { + "objectUri": { + "oneof": [ + "uri" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "HttpProto", + "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 + } + } + } + } + }, + "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 + } + }, + "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": false + } + }, + "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 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "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": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "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": { + "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-asset/src/service_proto_list.json b/packages/google-cloud-asset/src/service_proto_list.json new file mode 100644 index 00000000000..63a83f138b3 --- /dev/null +++ b/packages/google-cloud-asset/src/service_proto_list.json @@ -0,0 +1 @@ +["../protos/google/cloud/asset/v1/assets.proto", "../protos/google/cloud/asset/v1/asset_service.proto"] \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index eb7d5884b33..f921bd00f03 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -353,6 +353,7 @@ class AssetServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -444,6 +445,7 @@ class AssetServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 70db90403bd..102ecd33788 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -354,6 +354,7 @@ class AssetServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -442,6 +443,7 @@ class AssetServiceClient { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 001f66b77e2..8d956abcc19 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-18T00:57:22.750044Z", + "updateTime": "2019-08-02T11:07:34.519924Z", "sources": [ { "generator": { "name": "artman", - "version": "0.26.0", - "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" + "version": "0.32.0", + "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "384aa843867c4d17756d14a01f047b6368494d32", - "internalRef": "253675319" + "sha": "b92472ba0d253f2099e9977c2a5749ecd9ef1a77", + "internalRef": "261295907" } }, { From e07bbd66b8ac978eeed29063a808239fa29ae5d3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Aug 2019 10:04:00 -0700 Subject: [PATCH 120/429] chore: release 1.1.4 (#176) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index e6ab1a19954..d38fe6bb12c 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.1.4](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.3...v1.1.4) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([0015fbe](https://www.github.com/googleapis/nodejs-asset/commit/0015fbe)) + ### [1.1.3](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.2...v1.1.3) (2019-07-29) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 37076070366..f04943dba18 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.1.3", + "version": "1.1.4", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 03aa5cdf126..ac71436ef24 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 40000" }, "dependencies": { - "@google-cloud/asset": "^1.1.3", + "@google-cloud/asset": "^1.1.4", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^13.0.0" From e686d12a3c5ebb230ca9d0475e3c91ee12117ecd Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 20 Aug 2019 20:23:24 +0300 Subject: [PATCH 121/429] fix(deps): update dependency yargs to v14 --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ac71436ef24..88446e8ce27 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -18,7 +18,7 @@ "@google-cloud/asset": "^1.1.4", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", - "yargs": "^13.0.0" + "yargs": "^14.0.0" }, "devDependencies": { "chai": "^4.2.0", From 2a6b32f57bb362f688e8b82c40f5fcb630c573cd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 20 Aug 2019 14:35:59 -0700 Subject: [PATCH 122/429] docs: change example email address (#177) --- .../src/v1/doc/google/iam/v1/doc_policy.js | 4 ++-- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 4 ++-- packages/google-cloud-asset/synth.metadata | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index e58c2122510..e1607b08a11 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -81,7 +81,7 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * policy is overwritten. * * @typedef Policy * @memberof google.iam.v1 @@ -109,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` . + * account. For example, `alice@example.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index e58c2122510..e1607b08a11 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -81,7 +81,7 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * policy is overwritten. * * @typedef Policy * @memberof google.iam.v1 @@ -109,7 +109,7 @@ const Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` . + * account. For example, `alice@example.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 8d956abcc19..270b39060b9 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-02T11:07:34.519924Z", + "updateTime": "2019-08-08T11:07:23.760764Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.0", - "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" + "version": "0.33.0", + "dockerImage": "googleapis/artman@sha256:c6231efb525569736226b1f7af7565dbc84248efafb3692a5bb1d2d8a7975d53" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b92472ba0d253f2099e9977c2a5749ecd9ef1a77", - "internalRef": "261295907" + "sha": "7e56e8d4fec63bb04ab4f79a98f65b29f235a0a0", + "internalRef": "262242585" } }, { From 244c2e5f9566a92ab8a3e8e8fa8f606032ba8a7a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 20 Aug 2019 16:07:48 -0700 Subject: [PATCH 123/429] feat: introduce v1p2beta1 client (#181) --- .../cloud/asset/v1p2beta1/asset_service.proto | 384 ++++++++ .../google/cloud/asset/v1p2beta1/assets.proto | 135 +++ .../google-cloud-asset/protos/protos.json | 395 +++++++-- .../google-cloud-asset/samples/package.json | 2 +- packages/google-cloud-asset/src/index.js | 11 + .../src/service_proto_list.json | 2 +- .../src/v1p2beta1/asset_service_client.js | 822 ++++++++++++++++++ .../asset_service_client_config.json | 61 ++ .../asset/v1p2beta1/doc_asset_service.js | 469 ++++++++++ .../cloud/asset/v1p2beta1/doc_assets.js | 167 ++++ .../v1p2beta1/doc/google/iam/v1/doc_policy.js | 139 +++ .../doc/google/longrunning/doc_operations.js | 63 ++ .../v1p2beta1/doc/google/protobuf/doc_any.js | 137 +++ .../doc/google/protobuf/doc_empty.js | 34 + .../doc/google/protobuf/doc_field_mask.js | 228 +++++ .../doc/google/protobuf/doc_struct.js | 112 +++ .../doc/google/protobuf/doc_timestamp.js | 115 +++ .../v1p2beta1/doc/google/rpc/doc_status.js | 95 ++ .../src/v1p2beta1/doc/google/type/doc_expr.js | 51 ++ .../google-cloud-asset/src/v1p2beta1/index.js | 19 + packages/google-cloud-asset/synth.metadata | 12 +- packages/google-cloud-asset/synth.py | 2 +- .../test/gapic-v1p2beta1.js | 532 ++++++++++++ 23 files changed, 3895 insertions(+), 92 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto create mode 100644 packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/index.js create mode 100644 packages/google-cloud-asset/test/gapic-v1p2beta1.js diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto new file mode 100644 index 00000000000..0d461d0fa81 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -0,0 +1,384 @@ +// Copyright 2019 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.asset.v1p2beta1; + +import "google/api/annotations.proto"; +import "google/cloud/asset/v1p2beta1/assets.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1p2Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p2beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p2Beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Exports assets with time and resource types to a given Cloud Storage + // location. The output format is newline-delimited JSON. + // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you + // to keep track of the export. + rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p2beta1/{parent=*/*}:exportAssets" + body: "*" + }; + } + + // Batch gets the update history of assets that overlap a time window. + // For RESOURCE content, this API outputs history with asset in both + // non-delete or deleted status. + // For IAM_POLICY content, this API outputs history when the asset and its + // attached IAM POLICY both exist. This can create gaps in the output history. + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { + option (google.api.http) = { + get: "/v1p2beta1/{parent=*/*}:batchGetAssetsHistory" + }; + } + + // Creates a feed in a parent project/folder/organization to listen to its + // asset updates. + rpc CreateFeed(CreateFeedRequest) returns (Feed) { + option (google.api.http) = { + post: "/v1p2beta1/{parent=*/*}/feeds" + body: "*" + }; + } + + // Gets details about an asset feed. + rpc GetFeed(GetFeedRequest) returns (Feed) { + option (google.api.http) = { + get: "/v1p2beta1/{name=*/*/feeds/*}" + }; + } + + // Lists all asset feeds in a parent project/folder/organization. + rpc ListFeeds(ListFeedsRequest) returns (ListFeedsResponse) { + option (google.api.http) = { + get: "/v1p2beta1/{parent=*/*}/feeds" + }; + } + + // Updates an asset feed configuration. + rpc UpdateFeed(UpdateFeedRequest) returns (Feed) { + option (google.api.http) = { + patch: "/v1p2beta1/{feed.name=*/*/feeds/*}" + body: "*" + }; + } + + // Deletes an asset feed. + rpc DeleteFeed(DeleteFeedRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p2beta1/{name=*/*/feeds/*}" + }; + } +} + +// Export asset request. +message ExportAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + string parent = 1; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between 2018-10-02 UTC (inclusive) and the current time. If not specified, + // the current time will be used. Due to delays in resource data collection + // and indexing, there is a volatile window during which running the same + // query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types of which to take a snapshot for. For example: + // "compute.googleapis.com/Disk". If specified, only matching assets will be + // returned. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will be + // returned. + ContentType content_type = 4; + + // Required. Output configuration indicating where the results will be output + // to. All results will be in newline delimited JSON format. + OutputConfig output_config = 5; +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +message ExportAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Output configuration indicating where the results were output to. + // All results are in JSON format. + OutputConfig output_config = 2; +} + +// Batch get assets history request. +message BatchGetAssetsHistoryRequest { + // Required. The relative name of the root asset. It can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id")", or a project number (such as "projects/12345"). + string parent = 1; + + // A list of the full names of the assets. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // and [Resource Name + // Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + // for more info. + // + // The request becomes a no-op if the asset name list is empty, and the max + // size of the asset name list is 100 in one request. + repeated string asset_names = 2; + + // Required. The content type. + ContentType content_type = 3; + + // Optional. The time window for the asset history. Both start_time and + // end_time are optional and if set, it must be after 2018-10-02 UTC. If + // end_time is not set, it is default to current timestamp. If start_time is + // not set, the snapshot of the assets at end_time will be returned. The + // returned results contain all temporal assets whose time window overlap with + // read_time_window. + TimeWindow read_time_window = 4; +} + +// Batch get assets history response. +message BatchGetAssetsHistoryResponse { + // A list of assets with valid time windows. + repeated TemporalAsset assets = 1; +} + +// Create asset feed request. +message CreateFeedRequest { + // Required. The name of the project/folder/organization where this feed + // should be created in. It can only be an organization number (such as + // "organizations/123"), a folder number (such as "folders/123"), a project ID + // (such as "projects/my-project-id")", or a project number (such as + // "projects/12345"). + string parent = 1; + + // Required. This is the client-assigned asset feed identifier and it needs to + // be unique under a specific parent project/folder/organization. + string feed_id = 2; + + // The feed details. The field `name` must be empty and it will be generated + // in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + Feed feed = 3; +} + +// Get asset feed request. +message GetFeedRequest { + // The name of the Feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1; +} + +// List asset feeds request. +message ListFeedsRequest { + // Required. The parent project/folder/organization whose feeds are to be + // listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1; +} + +// List asset feeds response. +message ListFeedsResponse { + // A list of feeds. + repeated Feed feeds = 1; +} + +// Update asset feed request. +message UpdateFeedRequest { + // The new values of feed details. It must match an existing feed and the + // field `name` must be in the format of: + // projects/project_number/feeds/feed_id or + // folders/folder_number/feeds/feed_id or + // organizations/organization_number/feeds/feed_id. + Feed feed = 1; + + // Only updates the `feed` fields indicated by this mask. + // The field mask must not be empty, and it must not contain fields that + // are immutable or only set by the server. + google.protobuf.FieldMask update_mask = 2; +} + +// Delete asset feed request. +message DeleteFeedRequest { + // The name of the feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on Bigquery. The output table stores the fields in asset + // proto as columns in BigQuery. The resource/iam_policy field is converted + // to a record with each field to a column, except metadata to a single JSON + // string. + BigQueryDestination bigquery_destination = 2; + } +} + +// A Cloud Storage location. +message GcsDestination { + // Required. + oneof object_uri { + // The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1; + + // The uri prefix of all generated Cloud Storage objects. For example: + // "gs://bucket_name/object_name_prefix". Each object uri is in format: + // "gs://bucket_name/object_name_prefix// and only + // contains assets for that type. starts from 0. For example: + // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + // the first shard of output objects containing all + // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + // returned if file with the same name "gs://bucket_name/object_name_prefix" + // already exists. + string uri_prefix = 2; + } +} + +// A Bigquery destination. +message BigQueryDestination { + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the snapshot result + // should be exported. If this dataset does not exist, the export call returns + // an error. + string dataset = 1; + + // Required. The BigQuery table to which the snapshot result should be + // written. If this table does not exist, a new table with the given name + // will be created. + string table = 2; + + // If the destination table already exists and this flag is `TRUE`, the + // table will be overwritten by the contents of assets snapshot. If the flag + // is not set and the destination table already exists, the export call + // returns an error. + bool force = 3; +} + +// A Cloud Pubsub destination. +message PubsubDestination { + // The name of the Cloud Pub/Sub topic to publish to. + // For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + string topic = 1; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The IAM policy name for the IAM policy set on a resource. + IAM_POLICY_NAME = 3; + + ORG_POLICY = 4; + + // The Cloud Access context mananger Policy set on an asset. + ACCESS_POLICY = 5; +} + +// Output configuration for asset feed destination. +message FeedOutputConfig { + // Asset feed destination. + oneof destination { + // Destination on Cloud Pubsub. + PubsubDestination pubsub_destination = 1; + } +} + +// An asset feed used to export asset updates to a destinations. +// An asset feed filter controls what updates are exported. +// The asset feed must be created within a project, organization, or +// folder. Supported destinations are: +// Cloud Pub/Sub topics. +message Feed { + // Required. The format will be + // projects/{project_number}/feeds/{client-assigned_feed_identifier} or + // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + // organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + // + // The client-assigned feed identifier must be unique within the parent + // project/folder/organization. + string name = 1; + + // A list of the full names of the assets to receive updates. You must specify + // either or both of asset_names and asset_types. Only asset updates matching + // specified asset_names and asset_types are exported to the feed. For + // example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more info. + repeated string asset_names = 2; + + // A list of types of the assets to receive updates. You must specify either + // or both of asset_names and asset_types. Only asset updates matching + // specified asset_names and asset_types are exported to the feed. + // For example: + // "compute.googleapis.com/Disk" See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name and + // type will be returned. + ContentType content_type = 4; + + // Required. Feed output configuration defining where the asset updates are + // published to. + FeedOutputConfig feed_output_config = 5; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto new file mode 100644 index 00000000000..a9cda898a35 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -0,0 +1,135 @@ +// Copyright 2019 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.asset.v1p2beta1; + +import "google/api/annotations.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.v1p2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p2beta1"; +option php_namespace = "Google\\Cloud\\Asset\\v1p2beta1"; + +// Temporal asset. In addition to the asset, the temporal asset includes the +// status of the asset and valid from and to time of it. +message TemporalAsset { + // The time window when the asset data and state was observed. + TimeWindow window = 1; + + // If the asset is deleted or not. + bool deleted = 2; + + // Asset. + Asset asset = 3; +} + +// A time window of (start_time, end_time]. +message TimeWindow { + // Start time of the time window (exclusive). + google.protobuf.Timestamp start_time = 1; + + // End time of the time window (inclusive). + // Current timestamp if not specified. + google.protobuf.Timestamp end_time = 2; +} + +// Cloud asset. This includes all Google Cloud Platform resources, +// Cloud IAM policies, and other non-GCP assets. +message Asset { + // The full name of the asset. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // Type of the asset. Example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // Representation of the resource. + Resource resource = 3; + + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. + google.iam.v1.Policy iam_policy = 4; + + // Cloud IAM policy name of the Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy name associated + // with it. + bytes iam_policy_name = 5; + + // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, + // represented as a list of relative resource names. Ancestry path starts with + // the closest CRM ancestor and ending at a visible root. If the asset is a + // CRM project/ folder/organization, this starts from the asset itself. + // + // Example: ["projects/123456789", "folders/5432", "organizations/1234"] + repeated string ancestors = 6; +} + +// Representation of a cloud resource. +message Resource { + // The API version. Example: "v1". + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // For example: + // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. + // It will be left unspecified for resources without a discovery-based API, + // such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. + // Example: "Project". It will be left unspecified for resources (such as + // Cloud Bigtable) without a discovery-based API. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP GET operation using this + // URL returns the resource itself. + // Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + // It will be left unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For GCP assets, it is the parent resource defined in the [Cloud IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // For example: + // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + // + // For third-party assets, it is up to the users to define. + string parent = 5; + + // The content of the resource, in which some sensitive fields are scrubbed + // away and may not be present. + google.protobuf.Struct data = 6; + + // The actual metadata content for the resource, only visible for internal + // users. + google.protobuf.Any internal_data = 7; +} diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 51e74a384e3..07cd75789c6 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -6,99 +6,28 @@ "nested": { "asset": { "nested": { - "v1": { + "v1p2beta1": { "options": { - "csharp_namespace": "Google.Cloud.Asset.V1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1;asset", + "csharp_namespace": "Google.Cloud.Asset.v1p2beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", "java_multiple_files": true, - "java_outer_classname": "AssetServiceProto", - "java_package": "com.google.cloud.asset.v1", - "php_namespace": "Google\\Cloud\\Asset\\V1" + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", + "cc_enable_arenas": true }, "nested": { - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "assetType": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - }, - "iamPolicy": { - "type": "google.iam.v1.Policy", - "id": 4 - } - } - }, - "Resource": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { - "type": "string", - "id": 3 - }, - "resourceUrl": { - "type": "string", - "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 - } - } - }, "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, "methods": { "ExportAssets": { "requestType": "ExportAssetsRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1/{parent=*/*}:exportAssets", + "(google.api.http).post": "/v1p2beta1/{parent=*/*}:exportAssets", "(google.api.http).body": "*" } }, @@ -106,7 +35,44 @@ "requestType": "BatchGetAssetsHistoryRequest", "responseType": "BatchGetAssetsHistoryResponse", "options": { - "(google.api.http).get": "/v1/{parent=*/*}:batchGetAssetsHistory" + "(google.api.http).get": "/v1p2beta1/{parent=*/*}:batchGetAssetsHistory" + } + }, + "CreateFeed": { + "requestType": "CreateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.http).body": "*" + } + }, + "GetFeed": { + "requestType": "GetFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}" + } + }, + "ListFeeds": { + "requestType": "ListFeedsRequest", + "responseType": "ListFeedsResponse", + "options": { + "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds" + } + }, + "UpdateFeed": { + "requestType": "UpdateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", + "(google.api.http).body": "*" + } + }, + "DeleteFeed": { + "requestType": "DeleteFeedRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}" } } } @@ -178,11 +144,73 @@ } } }, + "CreateFeedRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "feedId": { + "type": "string", + "id": 2 + }, + "feed": { + "type": "Feed", + "id": 3 + } + } + }, + "GetFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListFeedsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + } + } + }, + "ListFeedsResponse": { + "fields": { + "feeds": { + "rule": "repeated", + "type": "Feed", + "id": 1 + } + } + }, + "UpdateFeedRequest": { + "fields": { + "feed": { + "type": "Feed", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, "OutputConfig": { "oneofs": { "destination": { "oneof": [ - "gcsDestination" + "gcsDestination", + "bigqueryDestination" ] } }, @@ -190,6 +218,10 @@ "gcsDestination": { "type": "GcsDestination", "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 } } }, @@ -197,7 +229,8 @@ "oneofs": { "objectUri": { "oneof": [ - "uri" + "uri", + "uriPrefix" ] } }, @@ -205,6 +238,34 @@ "uri": { "type": "string", "id": 1 + }, + "uriPrefix": { + "type": "string", + "id": 2 + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1 + }, + "table": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "PubsubDestination": { + "fields": { + "topic": { + "type": "string", + "id": 1 } } }, @@ -212,7 +273,140 @@ "values": { "CONTENT_TYPE_UNSPECIFIED": 0, "RESOURCE": 1, - "IAM_POLICY": 2 + "IAM_POLICY": 2, + "IAM_POLICY_NAME": 3, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5 + } + }, + "FeedOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "pubsubDestination" + ] + } + }, + "fields": { + "pubsubDestination": { + "type": "PubsubDestination", + "id": 1 + } + } + }, + "Feed": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "feedOutputConfig": { + "type": "FeedOutputConfig", + "id": 5 + } + } + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "iamPolicyName": { + "type": "bytes", + "id": 5 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "internalData": { + "type": "google.protobuf.Any", + "id": 7 + } } } } @@ -225,7 +419,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "HttpProto", + "java_outer_classname": "ClientProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -317,6 +511,22 @@ "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" } } }, @@ -1312,6 +1522,15 @@ }, "Empty": { "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } }, diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 88446e8ce27..c123f9f0de1 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -12,7 +12,7 @@ "repository": "googleapis/nodejs-asset", "private": true, "scripts": { - "test": "mocha --timeout 40000" + "test": "mocha --timeout 180000" }, "dependencies": { "@google-cloud/asset": "^1.1.4", diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js index 249e2ea3d2a..d9d674733a4 100644 --- a/packages/google-cloud-asset/src/index.js +++ b/packages/google-cloud-asset/src/index.js @@ -42,6 +42,9 @@ /** * @namespace google.longrunning */ +/** + * @namespace google.cloud.asset.v1p2beta1 + */ 'use strict'; @@ -49,6 +52,7 @@ const gapic = Object.freeze({ v1beta1: require('./v1beta1'), v1: require('./v1'), + v1p2beta1: require('./v1p2beta1'), }); /** @@ -87,6 +91,13 @@ const gapic = Object.freeze({ */ module.exports = gapic.v1; +/** + * @type {object} + * @property {constructor} AssetServiceClient + * Reference to {@link v1beta1.AssetServiceClient} + */ +module.exports.v1p2beta1 = gapic.v1p2beta1; + /** * @type {object} * @property {constructor} AssetServiceClient diff --git a/packages/google-cloud-asset/src/service_proto_list.json b/packages/google-cloud-asset/src/service_proto_list.json index 63a83f138b3..90f925c8b18 100644 --- a/packages/google-cloud-asset/src/service_proto_list.json +++ b/packages/google-cloud-asset/src/service_proto_list.json @@ -1 +1 @@ -["../protos/google/cloud/asset/v1/assets.proto", "../protos/google/cloud/asset/v1/asset_service.proto"] \ No newline at end of file +["../protos/google/cloud/asset/v1p2beta1/asset_service.proto", "../protos/google/cloud/asset/v1p2beta1/assets.proto"] \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js new file mode 100644 index 00000000000..49e5be04143 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js @@ -0,0 +1,822 @@ +// Copyright 2019 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. + +'use strict'; + +const gapicConfig = require('./asset_service_client_config.json'); +const gax = require('google-gax'); +const path = require('path'); +const protobuf = require('protobufjs'); + +const VERSION = require('../../package.json').version; + +/** + * Asset service definition. + * + * @class + * @memberof v1p2beta1 + */ +class AssetServiceClient { + /** + * Construct an instance of AssetServiceClient. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + constructor(opts) { + opts = opts || {}; + this._descriptors = {}; + + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}`, + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/asset/v1p2beta1/asset_service.proto'] + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + feedPathTemplate: new gax.PathTemplate('projects/{project}/feeds/{feed}'), + }; + let protoFilesRoot = new gax.GoogleProtoFilesRoot(); + protoFilesRoot = protobuf.loadSync( + path.join( + __dirname, + '..', + '..', + 'protos', + 'google/cloud/asset/v1p2beta1/asset_service.proto' + ), + protoFilesRoot + ); + + // 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 = new gax.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc, + }).operationsClient(opts); + + const exportAssetsResponse = protoFilesRoot.lookup( + 'google.cloud.asset.v1p2beta1.ExportAssetsResponse' + ); + const exportAssetsMetadata = protoFilesRoot.lookup( + 'google.cloud.asset.v1p2beta1.ExportAssetsRequest' + ); + + this._descriptors.longrunning = { + exportAssets: new gax.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1p2beta1.AssetService', + gapicConfig, + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1p2beta1.AssetService. + const assetServiceStub = gaxGrpc.createStub( + protos.google.cloud.asset.v1p2beta1.AssetService, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assetServiceStubMethods = [ + 'exportAssets', + 'batchGetAssetsHistory', + 'createFeed', + 'getFeed', + 'listFeeds', + 'updateFeed', + 'deleteFeed', + ]; + for (const methodName of assetServiceStubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + assetServiceStub.then( + stub => + function() { + const args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; + } + ), + defaults[methodName], + this._descriptors.longrunning[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.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']; + } + + /** + * 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) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Exports assets with time and resource types to a given Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the google.longrunning.Operation API allowing you + * to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * @param {Object} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} + * @param {Object} [request.readTime] + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * @param {string[]} [request.assetTypes] + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {number} [request.contentType] + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} + * @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/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * const outputConfig = {}; + * const request = { + * parent: parent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the promise pattern. + * client.exportAssets(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const parent = ''; + * const outputConfig = {}; + * const request = { + * parent: parent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.exportAssets(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const parent = ''; + * const outputConfig = {}; + * const request = { + * parent: parent, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.exportAssets(request); + * + * const [response] = await operation.promise(); + */ + exportAssets(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.exportAssets(request, options, callback); + } + + /** + * Batch gets the update history of assets that overlap a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * @param {string[]} request.assetNames + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * and [Resource Name + * Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + * for more info. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * @param {number} request.contentType + * Required. The content type. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} + * @param {Object} [request.readTimeWindow] + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} + * @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/interfaces/CallOptions.html} 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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * const assetNames = []; + * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + * const request = { + * parent: parent, + * assetNames: assetNames, + * contentType: contentType, + * }; + * client.batchGetAssetsHistory(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + batchGetAssetsHistory(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.batchGetAssetsHistory( + request, + options, + callback + ); + } + + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {Object} request.feed + * The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} + * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * const feedId = ''; + * const feed = {}; + * const request = { + * parent: parent, + * feedId: feedId, + * feed: feed, + * }; + * client.createFeed(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.createFeed(request, options, callback); + } + + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + * client.getFeed({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + 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, + }); + + return this._innerApiCalls.getFeed(request, options, callback); + } + + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @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/interfaces/CallOptions.html} 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 [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * client.listFeeds({parent: parent}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + listFeeds(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.listFeeds(request, options, callback); + } + + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.feed + * The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} + * @param {Object} request.updateMask + * Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const feed = {}; + * const updateMask = {}; + * const request = { + * feed: feed, + * updateMask: updateMask, + * }; + * client.updateFeed(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'feed.name': request.feed.name, + }); + + return this._innerApiCalls.updateFeed(request, options, callback); + } + + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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/interfaces/CallOptions.html} for the details. + * @param {function(?Error)} [callback] + * The function which will be called with the result of the API call. + * @returns {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1p2beta1'); + * + * const client = new asset.v1p2beta1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + * client.deleteFeed({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + 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, + }); + + return this._innerApiCalls.deleteFeed(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified feed resource name string. + * + * @param {String} project + * @param {String} feed + * @returns {String} + */ + feedPath(project, feed) { + return this._pathTemplates.feedPathTemplate.render({ + project: project, + feed: feed, + }); + } + + /** + * Parse the feedName from a feed resource. + * + * @param {String} feedName + * A fully-qualified path representing a feed resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromFeedName(feedName) { + return this._pathTemplates.feedPathTemplate.match(feedName).project; + } + + /** + * Parse the feedName from a feed resource. + * + * @param {String} feedName + * A fully-qualified path representing a feed resources. + * @returns {String} - A string representing the feed. + */ + matchFeedFromFeedName(feedName) { + return this._pathTemplates.feedPathTemplate.match(feedName).feed; + } +} + +module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json new file mode 100644 index 00000000000..11133174190 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.asset.v1p2beta1.AssetService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExportAssets": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchGetAssetsHistory": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateFeed": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeed": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFeeds": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFeed": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeed": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js new file mode 100644 index 00000000000..7782d3b831d --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js @@ -0,0 +1,469 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Export asset request. + * + * @property {string} parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * + * @property {Object} readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string[]} assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * + * @property {number} contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} + * + * @property {Object} outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} + * + * @typedef ExportAssetsRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const ExportAssetsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The export asset response. This message is returned by the + * google.longrunning.Operations.GetOperation method in the returned + * google.longrunning.Operation.response field. + * + * @property {Object} readTime + * Time the snapshot was taken. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} outputConfig + * Output configuration indicating where the results were output to. + * All results are in JSON format. + * + * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} + * + * @typedef ExportAssetsResponse + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const ExportAssetsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Batch get assets history request. + * + * @property {string} parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * + * @property {string[]} assetNames + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * and [Resource Name + * Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + * for more info. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * + * @property {number} contentType + * Required. The content type. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} + * + * @property {Object} readTimeWindow + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} + * + * @typedef BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const BatchGetAssetsHistoryRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Batch get assets history response. + * + * @property {Object[]} assets + * A list of assets with valid time windows. + * + * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1p2beta1.TemporalAsset} + * + * @typedef BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const BatchGetAssetsHistoryResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Create asset feed request. + * + * @property {string} parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * + * @property {string} feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * + * @property {Object} feed + * The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} + * + * @typedef CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.CreateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const CreateFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Get asset feed request. + * + * @property {string} name + * The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * @typedef GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.GetFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const GetFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * List asset feeds request. + * + * @property {string} parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * @typedef ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.ListFeedsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const ListFeedsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * List asset feeds response. + * + * @property {Object[]} feeds + * A list of feeds. + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} + * + * @typedef ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.ListFeedsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const ListFeedsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Update asset feed request. + * + * @property {Object} feed + * The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} + * + * @property {Object} updateMask + * Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.UpdateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const UpdateFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Delete asset feed request. + * + * @property {string} name + * The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * @typedef DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.DeleteFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const DeleteFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for export assets destination. + * + * @property {Object} gcsDestination + * Destination on Cloud Storage. + * + * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1p2beta1.GcsDestination} + * + * @property {Object} bigqueryDestination + * Destination on Bigquery. The output table stores the fields in asset + * proto as columns in BigQuery. The resource/iam_policy field is converted + * to a record with each field to a column, except metadata to a single JSON + * string. + * + * This object should have the same structure as [BigQueryDestination]{@link google.cloud.asset.v1p2beta1.BigQueryDestination} + * + * @typedef OutputConfig + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const OutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A Cloud Storage location. + * + * @property {string} uri + * The uri of the Cloud Storage object. It's the same uri that is used by + * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + * Editing Object + * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + * for more information. + * + * @property {string} uriPrefix + * The uri prefix of all generated Cloud Storage objects. For example: + * "gs://bucket_name/object_name_prefix". Each object uri is in format: + * "gs://bucket_name/object_name_prefix// and only + * contains assets for that type. starts from 0. For example: + * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + * the first shard of output objects containing all + * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + * returned if file with the same name "gs://bucket_name/object_name_prefix" + * already exists. + * + * @typedef GcsDestination + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const GcsDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A Bigquery destination. + * + * @property {string} dataset + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the snapshot result + * should be exported. If this dataset does not exist, the export call returns + * an error. + * + * @property {string} table + * Required. The BigQuery table to which the snapshot result should be + * written. If this table does not exist, a new table with the given name + * will be created. + * + * @property {boolean} force + * If the destination table already exists and this flag is `TRUE`, the + * table will be overwritten by the contents of assets snapshot. If the flag + * is not set and the destination table already exists, the export call + * returns an error. + * + * @typedef BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.BigQueryDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const BigQueryDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A Cloud Pubsub destination. + * + * @property {string} topic + * The name of the Cloud Pub/Sub topic to publish to. + * For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + * + * @typedef PubsubDestination + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.PubsubDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const PubsubDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for asset feed destination. + * + * @property {Object} pubsubDestination + * Destination on Cloud Pubsub. + * + * This object should have the same structure as [PubsubDestination]{@link google.cloud.asset.v1p2beta1.PubsubDestination} + * + * @typedef FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.FeedOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const FeedOutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * An asset feed used to export asset updates to a destinations. + * An asset feed filter controls what updates are exported. + * The asset feed must be created within a project, organization, or + * folder. Supported destinations are: + * Cloud Pub/Sub topics. + * + * @property {string} name + * Required. The format will be + * projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * + * The client-assigned feed identifier must be unique within the parent + * project/folder/organization. + * + * @property {string[]} assetNames + * A list of the full names of the assets to receive updates. You must specify + * either or both of asset_names and asset_types. Only asset updates matching + * specified asset_names and asset_types are exported to the feed. For + * example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more info. + * + * @property {string[]} assetTypes + * A list of types of the assets to receive updates. You must specify either + * or both of asset_names and asset_types. Only asset updates matching + * specified asset_names and asset_types are exported to the feed. + * For example: + * "compute.googleapis.com/Disk" See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * + * @property {number} contentType + * Asset content type. If not specified, no content but the asset name and + * type will be returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} + * + * @property {Object} feedOutputConfig + * Required. Feed output configuration defining where the asset updates are + * published to. + * + * This object should have the same structure as [FeedOutputConfig]{@link google.cloud.asset.v1p2beta1.FeedOutputConfig} + * + * @typedef Feed + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.Feed definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} + */ +const Feed = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Asset content type. + * + * @enum {number} + * @memberof google.cloud.asset.v1p2beta1 + */ +const ContentType = { + + /** + * Unspecified content type. + */ + CONTENT_TYPE_UNSPECIFIED: 0, + + /** + * Resource metadata. + */ + RESOURCE: 1, + + /** + * The actual IAM policy set on a resource. + */ + IAM_POLICY: 2, + + /** + * The IAM policy name for the IAM policy set on a resource. + */ + IAM_POLICY_NAME: 3, + ORG_POLICY: 4, + + /** + * The Cloud Access context mananger Policy set on an asset. + */ + ACCESS_POLICY: 5 +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js new file mode 100644 index 00000000000..39fddb4ad45 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js @@ -0,0 +1,167 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Temporal asset. In addition to the asset, the temporal asset includes the + * status of the asset and valid from and to time of it. + * + * @property {Object} window + * The time window when the asset data and state was observed. + * + * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} + * + * @property {boolean} deleted + * If the asset is deleted or not. + * + * @property {Object} asset + * Asset. + * + * This object should have the same structure as [Asset]{@link google.cloud.asset.v1p2beta1.Asset} + * + * @typedef TemporalAsset + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} + */ +const TemporalAsset = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A time window of (start_time, end_time]. + * + * @property {Object} startTime + * Start time of the time window (exclusive). + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {Object} endTime + * End time of the time window (inclusive). + * Current timestamp if not specified. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @typedef TimeWindow + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} + */ +const TimeWindow = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Cloud asset. This includes all Google Cloud Platform resources, + * Cloud IAM policies, and other non-GCP assets. + * + * @property {string} name + * The full name of the asset. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * @property {string} assetType + * Type of the asset. Example: "compute.googleapis.com/Disk". + * + * @property {Object} resource + * Representation of the resource. + * + * This object should have the same structure as [Resource]{@link google.cloud.asset.v1p2beta1.Resource} + * + * @property {Object} iamPolicy + * Representation of the actual Cloud IAM policy set on a cloud resource. For + * each resource, there must be at most one Cloud IAM policy set on it. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * + * @property {Buffer} iamPolicyName + * Cloud IAM policy name of the Cloud IAM policy set on a cloud resource. For + * each resource, there must be at most one Cloud IAM policy name associated + * with it. + * + * @property {string[]} ancestors + * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, + * represented as a list of relative resource names. Ancestry path starts with + * the closest CRM ancestor and ending at a visible root. If the asset is a + * CRM project/ folder/organization, this starts from the asset itself. + * + * Example: ["projects/123456789", "folders/5432", "organizations/1234"] + * + * @typedef Asset + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} + */ +const Asset = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Representation of a cloud resource. + * + * @property {string} version + * The API version. Example: "v1". + * + * @property {string} discoveryDocumentUri + * The URL of the discovery document containing the resource's JSON schema. + * For example: + * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + * + * @property {string} discoveryName + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + * + * @property {string} resourceUrl + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + * + * @property {string} parent + * The full name of the immediate parent of this resource. See + * [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more information. + * + * For GCP assets, it is the parent resource defined in the [Cloud IAM policy + * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + * For example: + * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + * + * For third-party assets, it is up to the users to define. + * + * @property {Object} data + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @property {Object} internalData + * The actual metadata content for the resource, only visible for internal + * users. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Resource + * @memberof google.cloud.asset.v1p2beta1 + * @see [google.cloud.asset.v1p2beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} + */ +const Resource = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js new file mode 100644 index 00000000000..e1607b08a11 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js @@ -0,0 +1,139 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. + * + * + * A `Policy` consists of a list of `bindings`. A `binding` binds a list of + * `members` to a `role`, where the members can be user accounts, Google groups, + * Google domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. + * + * **JSON Example** + * + * { + * "bindings": [ + * { + * "role": "roles/owner", + * "members": [ + * "user:mike@example.com", + * "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" + * ] + * }, + * { + * "role": "roles/viewer", + * "members": ["user:sean@example.com"] + * } + * ] + * } + * + * **YAML Example** + * + * bindings: + * - members: + * - user:mike@example.com + * - group:admins@example.com + * - domain:google.com + * - serviceAccount:my-other-app@appspot.gserviceaccount.com + * role: roles/owner + * - members: + * - user:sean@example.com + * role: roles/viewer + * + * + * For a description of IAM and its features, see the + * [IAM developer's guide](https://cloud.google.com/iam/docs). + * + * @property {number} version + * Deprecated. + * + * @property {Object[]} bindings + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + * + * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} + * + * @property {Buffer} etag + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten. + * + * @typedef Policy + * @memberof google.iam.v1 + * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Policy = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Associates `members` with a `role`. + * + * @property {string} role + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * + * @property {string[]} members + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@example.com` . + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: The G Suite domain (primary) that represents all the + * users of that domain. For example, `google.com` or `example.com`. + * + * @property {Object} condition + * The condition that is associated with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * + * This object should have the same structure as [Expr]{@link google.type.Expr} + * + * @typedef Binding + * @memberof google.iam.v1 + * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + */ +const Binding = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js new file mode 100644 index 00000000000..4719aebdc91 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js @@ -0,0 +1,63 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js new file mode 100644 index 00000000000..cdd2fc80e49 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js @@ -0,0 +1,137 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * # JSON + * + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message google.protobuf.Duration): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * @property {string} typeUrl + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a google.protobuf.Type + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * @property {Buffer} value + * Must be a valid serialized protocol buffer of the above specified type. + * + * @typedef Any + * @memberof google.protobuf + * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} + */ +const Any = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js new file mode 100644 index 00000000000..0b446dd9ce4 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js @@ -0,0 +1,34 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + * @typedef Empty + * @memberof google.protobuf + * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} + */ +const Empty = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js new file mode 100644 index 00000000000..011207b8626 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js @@ -0,0 +1,228 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * + * @property {string[]} paths + * The set of field mask paths. + * + * @typedef FieldMask + * @memberof google.protobuf + * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} + */ +const FieldMask = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js new file mode 100644 index 00000000000..ae7e4ef1ff6 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js @@ -0,0 +1,112 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @property {Object.} fields + * Unordered map of dynamically typed values. + * + * @typedef Struct + * @memberof google.protobuf + * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Struct = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @property {number} nullValue + * Represents a null value. + * + * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} + * + * @property {number} numberValue + * Represents a double value. + * + * @property {string} stringValue + * Represents a string value. + * + * @property {boolean} boolValue + * Represents a boolean value. + * + * @property {Object} structValue + * Represents a structured value. + * + * This object should have the same structure as [Struct]{@link google.protobuf.Struct} + * + * @property {Object} listValue + * Represents a repeated `Value`. + * + * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} + * + * @typedef Value + * @memberof google.protobuf + * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const Value = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @property {Object[]} values + * Repeated field of dynamically typed values. + * + * This object should have the same structure as [Value]{@link google.protobuf.Value} + * + * @typedef ListValue + * @memberof google.protobuf + * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} + */ +const ListValue = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @enum {number} + * @memberof google.protobuf + */ +const NullValue = { + + /** + * Null value. + */ + NULL_VALUE: 0 +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..98c19dbf0d3 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,115 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +const Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js new file mode 100644 index 00000000000..432ab6bb928 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js @@ -0,0 +1,95 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * + * - Simple to use and understand for most users + * - Flexible enough to meet unexpected needs + * + * # Overview + * + * The `Status` message contains three pieces of data: error code, error + * message, and error details. The error code should be an enum value of + * google.rpc.Code, but it may accept additional error codes + * if needed. The error message should be a developer-facing English message + * that helps developers *understand* and *resolve* the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may contain + * arbitrary information about the error. There is a predefined set of error + * detail types in the package `google.rpc` that can be used for common error + * conditions. + * + * # Language mapping + * + * The `Status` message is the logical representation of the error model, but it + * is not necessarily the actual wire format. When the `Status` message is + * exposed in different client libraries and different wire protocols, it can be + * mapped differently. For example, it will likely be mapped to some exceptions + * in Java, but more likely mapped to some error codes in C. + * + * # Other uses + * + * The error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a + * consistent developer experience across different environments. + * + * Example uses of this error model include: + * + * - Partial errors. If a service needs to return partial errors to the client, + * it may embed the `Status` in the normal response to indicate the partial + * errors. + * + * - Workflow errors. A typical workflow has multiple steps. Each step may + * have a `Status` message for error reporting. + * + * - Batch operations. If a client uses batch request and batch response, the + * `Status` message should be used directly inside batch response, one for + * each error sub-response. + * + * - Asynchronous operations. If an API call embeds asynchronous operation + * results in its response, the status of those operations should be + * represented directly using the `Status` message. + * + * - Logging. If some API errors are stored in logs, the message `Status` could + * be used directly after any stripping needed for security/privacy reasons. + * + * @property {number} code + * The status code, which should be an enum value of + * google.rpc.Code. + * + * @property {string} message + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized + * by the client. + * + * @property {Object[]} details + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Status + * @memberof google.rpc + * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} + */ +const Status = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js new file mode 100644 index 00000000000..421a7ee9e6a --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js @@ -0,0 +1,51 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Represents an expression text. Example: + * + * title: "User account presence" + * description: "Determines whether the request has a user account" + * expression: "size(request.user) > 0" + * + * @property {string} expression + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + * + * @property {string} title + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * @property {string} description + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * @property {string} location + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * @typedef Expr + * @memberof google.type + * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} + */ +const Expr = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/index.js b/packages/google-cloud-asset/src/v1p2beta1/index.js new file mode 100644 index 00000000000..11b31911e6a --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/index.js @@ -0,0 +1,19 @@ +// Copyright 2019 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. + +'use strict'; + +const AssetServiceClient = require('./asset_service_client'); + +module.exports.AssetServiceClient = AssetServiceClient; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 270b39060b9..e10a12a2465 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-08-08T11:07:23.760764Z", + "updateTime": "2019-08-20T18:29:33.688849Z", "sources": [ { "generator": { @@ -44,6 +44,16 @@ "generator": "gapic", "config": "google/cloud/asset/artman_cloudasset_v1.yaml" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p2beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 21173ab05f1..7058295330a 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -22,7 +22,7 @@ # run the gapic generator gapic = gcp.GAPICGenerator() -versions = ['v1beta1', 'v1'] +versions = ['v1beta1', 'v1', 'v1p2beta1'] for version in versions: library = gapic.node_library( 'asset', diff --git a/packages/google-cloud-asset/test/gapic-v1p2beta1.js b/packages/google-cloud-asset/test/gapic-v1p2beta1.js new file mode 100644 index 00000000000..25e297cd4b6 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-v1p2beta1.js @@ -0,0 +1,532 @@ +// Copyright 2019 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. + +'use strict'; + +const assert = require('assert'); + +const assetModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +const error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe('AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = assetModule.v1p2beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = assetModule.v1p2beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetModule.v1p2beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new assetModule.v1p2beta1.AssetServiceClient(); + assert(client); + }); + + describe('exportAssets', function() { + it('invokes exportAssets without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const outputConfig = {}; + const request = { + parent: parent, + outputConfig: outputConfig, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .exportAssets(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes exportAssets with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const outputConfig = {}; + const request = { + parent: parent, + outputConfig: outputConfig, + }; + + // Mock Grpc layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .exportAssets(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.exportAssets.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.exportAssets.metadataDecoder instanceof + Function + ); + }); + }); + + describe('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const assetNames = []; + const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + const request = { + parent: parent, + assetNames: assetNames, + contentType: contentType, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.batchGetAssetsHistory(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes batchGetAssetsHistory with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const assetNames = []; + const contentType = 'CONTENT_TYPE_UNSPECIFIED'; + const request = { + parent: parent, + assetNames: assetNames, + contentType: contentType, + }; + + // Mock Grpc layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.batchGetAssetsHistory(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('createFeed', () => { + it('invokes createFeed without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const feedId = 'feedId-976011428'; + const feed = {}; + const request = { + parent: parent, + feedId: feedId, + feed: feed, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createFeed(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFeed with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const feedId = 'feedId-976011428'; + const feed = {}; + const request = { + parent: parent, + feedId: feedId, + feed: feed, + }; + + // Mock Grpc layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createFeed(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getFeed', () => { + it('invokes getFeed without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const expectedResponse = { + name: name2, + }; + + // Mock Grpc layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getFeed(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getFeed with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getFeed(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listFeeds', () => { + it('invokes listFeeds without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const request = { + parent: parent, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.listFeeds(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listFeeds with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const request = { + parent: parent, + }; + + // Mock Grpc layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listFeeds(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateFeed', () => { + it('invokes updateFeed without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const feed = {}; + const updateMask = {}; + const request = { + feed: feed, + updateMask: updateMask, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateFeed(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFeed with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const feed = {}; + const updateMask = {}; + const request = { + feed: feed, + updateMask: updateMask, + }; + + // Mock Grpc layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateFeed(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteFeed', () => { + it('invokes deleteFeed without error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(request); + + client.deleteFeed(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteFeed with error', done => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteFeed(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} + +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} From f82935cf3a159d29834748d33d4ac24db78b11d2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 20 Aug 2019 16:23:12 -0700 Subject: [PATCH 124/429] chore: release 1.2.0 (#182) --- packages/google-cloud-asset/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index d38fe6bb12c..4df537ae0aa 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.4...v1.2.0) (2019-08-20) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([e3e5872](https://www.github.com/googleapis/nodejs-asset/commit/e3e5872)) + + +### Features + +* introduce v1p2beta1 client ([#181](https://www.github.com/googleapis/nodejs-asset/issues/181)) ([675ae04](https://www.github.com/googleapis/nodejs-asset/commit/675ae04)) + ### [1.1.4](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.3...v1.1.4) (2019-08-05) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index f04943dba18..d12337760b2 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.1.4", + "version": "1.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index c123f9f0de1..1d551e7ad51 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.1.4", + "@google-cloud/asset": "^1.2.0", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^14.0.0" From e4fb4029c7a421889c7b95d1b71fcad218907329 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 26 Aug 2019 13:23:53 -0700 Subject: [PATCH 125/429] fix(docs): update READMEs with new samples (#185) --- packages/google-cloud-asset/README.md | 5 + packages/google-cloud-asset/samples/README.md | 100 ++++++++++++++++++ .../src/v1/asset_service_client.js | 2 +- .../src/v1beta1/asset_service_client.js | 2 +- .../src/v1p2beta1/asset_service_client.js | 2 +- packages/google-cloud-asset/synth.metadata | 10 +- 6 files changed, 113 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 5517dd1af39..c0c86a0ff87 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -93,9 +93,14 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Create Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/createFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) | +| Delete Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/deleteFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) | | Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | | Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | +| Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | +| List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | | Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Update Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/updateFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index de14938efb3..09eb533231f 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -12,9 +12,14 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Create Feed](#create-feed) + * [Delete Feed](#delete-feed) * [Export Assets](#export-assets) * [Get Batch Asset History](#get-batch-asset-history) + * [Get Feed](#get-feed) + * [List Feeds](#list-feeds) * [Asset History Quickstart](#asset-history-quickstart) + * [Update Feed](#update-feed) ## Before you begin @@ -25,6 +30,44 @@ Before running the samples, make sure you've followed the steps outlined in +### Create Feed + +Create Feed. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/createFeed.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) + +__Usage:__ + + +`node createFeed "storage.googleapis.com/", projects//topics/` + + +----- + + + + +### Delete Feed + +Delete Feed. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/deleteFeed.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) + +__Usage:__ + + +`node deleteFeed "project//feeds/"` + + +----- + + + + ### Export Assets Export asserts to specified dump file path. @@ -63,6 +106,44 @@ __Usage:__ +### Get Feed + +Get Feed. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getFeed.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) + +__Usage:__ + + +`node getFeed "project//feeds/"` + + +----- + + + + +### List Feeds + +List Feeds. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listFeeds.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) + +__Usage:__ + + +`node listFeeds` + + +----- + + + + ### Asset History Quickstart Batch get history of assets. @@ -77,6 +158,25 @@ __Usage:__ `node getBatchAssetHistory "storage.googleapis.com/"` +----- + + + + +### Update Feed + +Update Feed. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/updateFeed.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) + +__Usage:__ + + +`node updateFeed "project//feeds/" projects//topics/` + + diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index f921bd00f03..f35ddd1ea1b 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -82,7 +82,7 @@ class AssetServiceClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 102ecd33788..a767eaab383 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -82,7 +82,7 @@ class AssetServiceClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js index 49e5be04143..4c538083e40 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js @@ -82,7 +82,7 @@ class AssetServiceClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e10a12a2465..131bc86caa2 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-20T18:29:33.688849Z", + "updateTime": "2019-08-26T19:46:41.469341Z", "sources": [ { "generator": { "name": "artman", - "version": "0.33.0", - "dockerImage": "googleapis/artman@sha256:c6231efb525569736226b1f7af7565dbc84248efafb3692a5bb1d2d8a7975d53" + "version": "0.35.0", + "dockerImage": "googleapis/artman@sha256:97ef134b6b1cc2c21868960d3b4352524023fb25b61fc137ca0783ce3c08c2cd" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7e56e8d4fec63bb04ab4f79a98f65b29f235a0a0", - "internalRef": "262242585" + "sha": "37c923effe8b002884466074f84bc4e78e6ade62", + "internalRef": "265474131" } }, { From 7d33d79365a7ae2682b12445bfb54b1ec48b7f26 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 26 Aug 2019 13:31:56 -0700 Subject: [PATCH 126/429] chore: release 1.2.1 (#186) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 4df537ae0aa..c398da86b0e 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.2.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.2.0...v1.2.1) (2019-08-26) + + +### Bug Fixes + +* **docs:** update READMEs with new samples ([#185](https://www.github.com/googleapis/nodejs-asset/issues/185)) ([775a5a0](https://www.github.com/googleapis/nodejs-asset/commit/775a5a0)) + ## [1.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.1.4...v1.2.0) (2019-08-20) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index d12337760b2..e5f8719590e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.2.0", + "version": "1.2.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 1d551e7ad51..2fbea87b674 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.2.0", + "@google-cloud/asset": "^1.2.1", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^14.0.0" From df25cf1517dfedc2f20c90a72f2476d062f421b9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Aug 2019 07:53:14 -0700 Subject: [PATCH 127/429] refactor(protos): update documentation refactor protos --- .../google-cloud-asset/protos/protos.json | 186 +++++++++--------- .../src/service_proto_list.json | 2 +- .../src/v1/doc/google/iam/v1/doc_policy.js | 9 +- .../v1/doc/google/protobuf/doc_timestamp.js | 10 +- .../v1beta1/doc/google/iam/v1/doc_policy.js | 9 +- .../doc/google/protobuf/doc_timestamp.js | 10 +- .../v1p2beta1/doc/google/iam/v1/doc_policy.js | 9 +- .../doc/google/protobuf/doc_timestamp.js | 10 +- packages/google-cloud-asset/synth.metadata | 10 +- 9 files changed, 141 insertions(+), 114 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 07cd75789c6..a5c387ffe3d 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -8,15 +8,104 @@ "nested": { "v1p2beta1": { "options": { - "csharp_namespace": "Google.Cloud.Asset.v1p2beta1", + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1p2Beta1", "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", "java_multiple_files": true, - "java_outer_classname": "AssetProto", + "java_outer_classname": "AssetServiceProto", "java_package": "com.google.cloud.asset.v1p2beta1", - "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", - "cc_enable_arenas": true + "php_namespace": "Google\\Cloud\\Asset\\V1p2Beta1" }, "nested": { + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "iamPolicyName": { + "type": "bytes", + "id": 5 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "internalData": { + "type": "google.protobuf.Any", + "id": 7 + } + } + }, "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -319,95 +408,6 @@ "id": 5 } } - }, - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "assetType": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - }, - "iamPolicy": { - "type": "google.iam.v1.Policy", - "id": 4 - }, - "iamPolicyName": { - "type": "bytes", - "id": 5 - }, - "ancestors": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "Resource": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { - "type": "string", - "id": 3 - }, - "resourceUrl": { - "type": "string", - "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 - }, - "internalData": { - "type": "google.protobuf.Any", - "id": 7 - } - } } } } diff --git a/packages/google-cloud-asset/src/service_proto_list.json b/packages/google-cloud-asset/src/service_proto_list.json index 90f925c8b18..797307b2f66 100644 --- a/packages/google-cloud-asset/src/service_proto_list.json +++ b/packages/google-cloud-asset/src/service_proto_list.json @@ -1 +1 @@ -["../protos/google/cloud/asset/v1p2beta1/asset_service.proto", "../protos/google/cloud/asset/v1p2beta1/assets.proto"] \ No newline at end of file +["../protos/google/cloud/asset/v1p2beta1/assets.proto", "../protos/google/cloud/asset/v1p2beta1/asset_service.proto"] \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index e1607b08a11..2dbe3faa3a6 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -63,7 +63,14 @@ * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Deprecated. + * Specifies the format of the policy. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Policies with any conditional bindings must specify version 3. Policies + * without any conditional bindings may specify any valid value or leave the + * field unset. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js index 98c19dbf0d3..c457acc0c7d 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index e1607b08a11..2dbe3faa3a6 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -63,7 +63,14 @@ * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Deprecated. + * Specifies the format of the policy. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Policies with any conditional bindings must specify version 3. Policies + * without any conditional bindings may specify any valid value or leave the + * field unset. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 98c19dbf0d3..c457acc0c7d 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js index e1607b08a11..2dbe3faa3a6 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js @@ -63,7 +63,14 @@ * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Deprecated. + * Specifies the format of the policy. + * + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * rejected. + * + * Policies with any conditional bindings must specify version 3. Policies + * without any conditional bindings may specify any valid value or leave the + * field unset. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js index 98c19dbf0d3..c457acc0c7d 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 131bc86caa2..142bcb3a66b 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-26T19:46:41.469341Z", + "updateTime": "2019-08-27T11:07:27.248735Z", "sources": [ { "generator": { "name": "artman", - "version": "0.35.0", - "dockerImage": "googleapis/artman@sha256:97ef134b6b1cc2c21868960d3b4352524023fb25b61fc137ca0783ce3c08c2cd" + "version": "0.35.1", + "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "37c923effe8b002884466074f84bc4e78e6ade62", - "internalRef": "265474131" + "sha": "650caad718bb063f189405c23972dc9818886358", + "internalRef": "265565344" } }, { From 03cf01d675a4b8ce47ceafa213dca60f748494cb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 28 Aug 2019 10:30:02 -0700 Subject: [PATCH 128/429] fix(docs): remove reference-docs anchor --- packages/google-cloud-asset/README.md | 4 +--- packages/google-cloud-asset/synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index c0c86a0ff87..b6dbc7488fc 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -134,12 +134,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/asset/latest#reference +[client-docs]: https://googleapis.dev/nodejs/asset/latest [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [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=cloudasset.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started - - diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 142bcb3a66b..86f396990a2 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-08-27T11:07:27.248735Z", + "updateTime": "2019-08-28T11:07:54.519824Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "650caad718bb063f189405c23972dc9818886358", - "internalRef": "265565344" + "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", + "internalRef": "265796259" } }, { From 86a0ce26935b7cb0272e46af79772816d0a883dd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 3 Sep 2019 14:05:29 -0700 Subject: [PATCH 129/429] feat: load protos from JSON, grpc-fallback support * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * fixes * fix webpack.config.js --- .../google-cloud-asset/protos/protos.json | 457 +++++++++++++++++- packages/google-cloud-asset/src/browser.js | 21 + .../src/service_proto_list.json | 1 - .../src/v1/asset_service_client.js | 91 ++-- .../src/v1/asset_service_proto_list.json | 3 + .../src/v1beta1/asset_service_client.js | 91 ++-- .../src/v1beta1/asset_service_proto_list.json | 3 + .../src/v1p2beta1/asset_service_client.js | 93 ++-- .../v1p2beta1/asset_service_proto_list.json | 3 + packages/google-cloud-asset/synth.metadata | 10 +- packages/google-cloud-asset/synth.py | 1 + packages/google-cloud-asset/test/gapic-v1.js | 5 + .../google-cloud-asset/test/gapic-v1beta1.js | 5 + .../test/gapic-v1p2beta1.js | 7 + packages/google-cloud-asset/webpack.config.js | 46 ++ 15 files changed, 704 insertions(+), 133 deletions(-) create mode 100644 packages/google-cloud-asset/src/browser.js delete mode 100644 packages/google-cloud-asset/src/service_proto_list.json create mode 100644 packages/google-cloud-asset/src/v1/asset_service_proto_list.json create mode 100644 packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json create mode 100644 packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json create mode 100644 packages/google-cloud-asset/webpack.config.js diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index a5c387ffe3d..4244094a8a8 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -6,17 +6,139 @@ "nested": { "asset": { "nested": { - "v1p2beta1": { + "v1": { "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Asset.V1p2Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", + "csharp_namespace": "Google.Cloud.Asset.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1;asset", "java_multiple_files": true, - "java_outer_classname": "AssetServiceProto", - "java_package": "com.google.cloud.asset.v1p2beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1p2Beta1" + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1", + "php_namespace": "Google\\Cloud\\Asset\\V1" }, "nested": { + "AssetService": { + "methods": { + "ExportAssets": { + "requestType": "ExportAssetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}:exportAssets", + "(google.api.http).body": "*" + } + }, + "BatchGetAssetsHistory": { + "requestType": "BatchGetAssetsHistoryRequest", + "responseType": "BatchGetAssetsHistoryResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}:batchGetAssetsHistory" + } + } + } + }, + "ExportAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 5 + } + } + }, + "ExportAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + } + } + }, + "BatchGetAssetsHistoryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "contentType": { + "type": "ContentType", + "id": 3 + }, + "readTimeWindow": { + "type": "TimeWindow", + "id": 4 + } + } + }, + "BatchGetAssetsHistoryResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "TemporalAsset", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "GcsDestination": { + "oneofs": { + "objectUri": { + "oneof": [ + "uri" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2 + } + }, "TemporalAsset": { "fields": { "window": { @@ -62,15 +184,220 @@ "iamPolicy": { "type": "google.iam.v1.Policy", "id": 4 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 }, - "iamPolicyName": { - "type": "bytes", + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", "id": 5 }, - "ancestors": { + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + } + } + }, + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1beta1" + }, + "nested": { + "AssetService": { + "methods": { + "ExportAssets": { + "requestType": "ExportAssetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}:exportAssets", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{parent=organizations/*}:exportAssets", + "(google.api.http).additional_bindings.body": "*" + } + }, + "BatchGetAssetsHistory": { + "requestType": "BatchGetAssetsHistoryRequest", + "responseType": "BatchGetAssetsHistoryResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}:batchGetAssetsHistory", + "(google.api.http).additional_bindings.get": "/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" + } + } + } + }, + "ExportAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { "rule": "repeated", "type": "string", - "id": 6 + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 5 + } + } + }, + "ExportAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + } + } + }, + "BatchGetAssetsHistoryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "contentType": { + "type": "ContentType", + "id": 3 + }, + "readTimeWindow": { + "type": "TimeWindow", + "id": 4 + } + } + }, + "BatchGetAssetsHistoryResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "TemporalAsset", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "GcsDestination": { + "oneofs": { + "objectUri": { + "oneof": [ + "uri" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2 + } + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 } } }, @@ -99,13 +426,22 @@ "data": { "type": "google.protobuf.Struct", "id": 6 - }, - "internalData": { - "type": "google.protobuf.Any", - "id": 7 } } - }, + } + } + }, + "v1p2beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.v1p2beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", + "cc_enable_arenas": true + }, + "nested": { "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -408,6 +744,95 @@ "id": 5 } } + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "iamPolicyName": { + "type": "bytes", + "id": 5 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "internalData": { + "type": "google.protobuf.Any", + "id": 7 + } + } } } } diff --git a/packages/google-cloud-asset/src/browser.js b/packages/google-cloud-asset/src/browser.js new file mode 100644 index 00000000000..ddbcd7ecb9a --- /dev/null +++ b/packages/google-cloud-asset/src/browser.js @@ -0,0 +1,21 @@ +// Copyright 2019 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. + +'use strict'; + +// Set a flag that we are running in a browser bundle. +global.isBrowser = true; + +// Re-export all exports from ./index.js. +module.exports = require('./index'); diff --git a/packages/google-cloud-asset/src/service_proto_list.json b/packages/google-cloud-asset/src/service_proto_list.json deleted file mode 100644 index 797307b2f66..00000000000 --- a/packages/google-cloud-asset/src/service_proto_list.json +++ /dev/null @@ -1 +0,0 @@ -["../protos/google/cloud/asset/v1p2beta1/assets.proto", "../protos/google/cloud/asset/v1p2beta1/asset_service.proto"] \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index f35ddd1ea1b..552ea2f983a 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./asset_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class AssetServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,50 +84,58 @@ class AssetServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); 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' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/asset/v1/asset_service.proto'] + opts.fallback ? 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 = { - projectPathTemplate: new gax.PathTemplate('projects/{project}'), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/asset/v1/asset_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // 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 = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -131,7 +148,7 @@ class AssetServiceClient { ); this._descriptors.longrunning = { - exportAssets: new gax.LongrunningDescriptor( + exportAssets: new gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) @@ -154,7 +171,9 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1.AssetService. const assetServiceStub = gaxGrpc.createStub( - protos.google.cloud.asset.v1.AssetService, + opts.fallback + ? protos.lookupService('google.cloud.asset.v1.AssetService') + : protos.google.cloud.asset.v1.AssetService, opts ); @@ -162,18 +181,16 @@ class AssetServiceClient { // and create an API call method for each. const assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; for (const methodName of assetServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - assetServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = assetServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json new file mode 100644 index 00000000000..53ef75b9756 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/asset/v1/asset_service.proto" +] diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index a767eaab383..41da17c3fdb 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./asset_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class AssetServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,50 +84,58 @@ class AssetServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); 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' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/asset/v1beta1/asset_service.proto'] + opts.fallback ? 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 = { - projectPathTemplate: new gax.PathTemplate('projects/{project}'), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/asset/v1beta1/asset_service.proto' - ), - protoFilesRoot - ); + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // 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 = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -131,7 +148,7 @@ class AssetServiceClient { ); this._descriptors.longrunning = { - exportAssets: new gax.LongrunningDescriptor( + exportAssets: new gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) @@ -154,7 +171,9 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1beta1.AssetService. const assetServiceStub = gaxGrpc.createStub( - protos.google.cloud.asset.v1beta1.AssetService, + opts.fallback + ? protos.lookupService('google.cloud.asset.v1beta1.AssetService') + : protos.google.cloud.asset.v1beta1.AssetService, opts ); @@ -162,18 +181,16 @@ class AssetServiceClient { // and create an API call method for each. const assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; for (const methodName of assetServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - assetServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = assetServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..499bd902e39 --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/asset/v1beta1/asset_service.proto" +] diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js index 4c538083e40..1830f9aabe7 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./asset_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class AssetServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,50 +84,60 @@ class AssetServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); 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' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/asset/v1p2beta1/asset_service.proto'] + opts.fallback ? 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 = { - feedPathTemplate: new gax.PathTemplate('projects/{project}/feeds/{feed}'), - }; - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/asset/v1p2beta1/asset_service.proto' + feedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' ), - protoFilesRoot - ); + }; + + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); // 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 = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -131,7 +150,7 @@ class AssetServiceClient { ); this._descriptors.longrunning = { - exportAssets: new gax.LongrunningDescriptor( + exportAssets: new gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) @@ -154,7 +173,9 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1p2beta1.AssetService. const assetServiceStub = gaxGrpc.createStub( - protos.google.cloud.asset.v1p2beta1.AssetService, + opts.fallback + ? protos.lookupService('google.cloud.asset.v1p2beta1.AssetService') + : protos.google.cloud.asset.v1p2beta1.AssetService, opts ); @@ -170,18 +191,16 @@ class AssetServiceClient { 'deleteFeed', ]; for (const methodName of assetServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - assetServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = assetServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..ac74955ea29 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto" +] diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 86f396990a2..f259606460d 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-28T11:07:54.519824Z", + "updateTime": "2019-08-31T11:07:20.415455Z", "sources": [ { "generator": { "name": "artman", - "version": "0.35.1", - "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" + "version": "0.36.1", + "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", - "internalRef": "265796259" + "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", + "internalRef": "266247326" } }, { diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 7058295330a..6f78852b9c7 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -55,3 +55,4 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js index 1fe67016ecb..7e8e6d0dd8c 100644 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ b/packages/google-cloud-asset/test/gapic-v1.js @@ -44,6 +44,11 @@ describe('AssetServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new assetModule.v1.AssetServiceClient({fallback: true}); + assert(client); + }); + describe('exportAssets', function() { it('invokes exportAssets without error', done => { const client = new assetModule.v1.AssetServiceClient({ diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index c3a67c17c66..c30f666dcef 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -44,6 +44,11 @@ describe('AssetServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new assetModule.v1beta1.AssetServiceClient({fallback: true}); + assert(client); + }); + describe('exportAssets', function() { it('invokes exportAssets without error', done => { const client = new assetModule.v1beta1.AssetServiceClient({ diff --git a/packages/google-cloud-asset/test/gapic-v1p2beta1.js b/packages/google-cloud-asset/test/gapic-v1p2beta1.js index 25e297cd4b6..c82d95e591c 100644 --- a/packages/google-cloud-asset/test/gapic-v1p2beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1p2beta1.js @@ -44,6 +44,13 @@ describe('AssetServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new assetModule.v1p2beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('exportAssets', function() { it('invokes exportAssets without error', done => { const client = new assetModule.v1p2beta1.AssetServiceClient({ diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js new file mode 100644 index 00000000000..12c1d1b4116 --- /dev/null +++ b/packages/google-cloud-asset/webpack.config.js @@ -0,0 +1,46 @@ +// Copyright 2019 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 = { + entry: './src/browser.js', + output: { + library: 'asset', + filename: './asset.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + extensions: ['.js', '.json'], + }, + module: { + rules: [ + { + 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 e937de4a31c8eaa05bc3f955d260fb28bf74ed95 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 5 Sep 2019 22:26:40 +0300 Subject: [PATCH 130/429] chore(deps): update dependency eslint-plugin-node to v10 (#192) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index e5f8719590e..62e268f2087 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -48,7 +48,7 @@ "codecov": "^3.0.4", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^9.0.0", + "eslint-plugin-node": "^10.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", From 73337675d9098cabcb97efba74030d23b36f42ab Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Sep 2019 18:11:36 -0400 Subject: [PATCH 131/429] update .nycrc ignore rules (#193) --- packages/google-cloud-asset/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index 83a421a0628..23e322204ec 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -6,6 +6,7 @@ "**/.coverage", "**/apis", "**/benchmark", + "**/conformance", "**/docs", "**/samples", "**/scripts", From 12e6661bd868043dfdb2d861a3f2378082b9da66 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 16 Sep 2019 09:19:38 -0700 Subject: [PATCH 132/429] chore: release 1.3.0 (#191) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index c398da86b0e..a987552c3ff 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.3.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.2.1...v1.3.0) (2019-09-16) + + +### Bug Fixes + +* **docs:** remove reference-docs anchor ([812bdc4](https://www.github.com/googleapis/nodejs-asset/commit/812bdc4)) + + +### Features + +* load protos from JSON, grpc-fallback support ([abe6f81](https://www.github.com/googleapis/nodejs-asset/commit/abe6f81)) + ### [1.2.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.2.0...v1.2.1) (2019-08-26) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 62e268f2087..69896273a38 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 2fbea87b674..e9fe60cceab 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.2.1", + "@google-cloud/asset": "^1.3.0", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^14.0.0" From 402bed4b258c4562bf8fee34927165e020e4c848 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Sep 2019 06:11:50 -0700 Subject: [PATCH 133/429] feat: .d.ts for protos (#197) --- packages/google-cloud-asset/.eslintignore | 1 + .../google-cloud-asset/protos/protos.d.ts | 10304 +++++++ packages/google-cloud-asset/protos/protos.js | 25636 ++++++++++++++++ .../src/v1/doc/google/iam/v1/doc_policy.js | 56 +- .../v1beta1/doc/google/iam/v1/doc_policy.js | 56 +- .../v1p2beta1/doc/google/iam/v1/doc_policy.js | 56 +- packages/google-cloud-asset/synth.metadata | 10 +- 7 files changed, 36060 insertions(+), 59 deletions(-) create mode 100644 packages/google-cloud-asset/protos/protos.d.ts create mode 100644 packages/google-cloud-asset/protos/protos.js diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore index f0c7aead4bf..09b31fe735a 100644 --- a/packages/google-cloud-asset/.eslintignore +++ b/packages/google-cloud-asset/.eslintignore @@ -2,3 +2,4 @@ src/**/doc/* build/ docs/ +protos/ diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts new file mode 100644 index 00000000000..35075e127dd --- /dev/null +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -0,0 +1,10304 @@ +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace asset. */ + namespace asset { + + /** Namespace v1. */ + namespace v1 { + + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse + */ + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); + + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: google.cloud.asset.v1.ContentType; + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsRequest + * @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.asset.v1.ExportAssetsRequest; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsRequest + * @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.asset.v1.ExportAssetsRequest; + + /** + * Verifies an ExportAssetsRequest 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { + + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + } + + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { + + /** + * Constructs a new ExportAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); + + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsResponse + * @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.asset.v1.ExportAssetsResponse; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsResponse + * @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.asset.v1.ExportAssetsResponse; + + /** + * Verifies an ExportAssetsResponse 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { + + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + } + + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); + + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; + + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: google.cloud.asset.v1.ContentType; + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryRequest + * @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.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryRequest + * @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.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Verifies a BatchGetAssetsHistoryRequest 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { + + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); + } + + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); + + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1.ITemporalAsset[]; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryResponse + * @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.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryResponse + * @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.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Verifies a BatchGetAssetsHistoryResponse 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @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.asset.v1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @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.asset.v1.OutputConfig; + + /** + * Verifies an OutputConfig 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination objectUri. */ + public objectUri?: "uri"; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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.asset.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.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse + */ + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); + + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: google.cloud.asset.v1beta1.ContentType; + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsRequest + * @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.asset.v1beta1.ExportAssetsRequest; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsRequest + * @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.asset.v1beta1.ExportAssetsRequest; + + /** + * Verifies an ExportAssetsRequest 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { + + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { + + /** + * Constructs a new ExportAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); + + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsResponse + * @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.asset.v1beta1.ExportAssetsResponse; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsResponse + * @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.asset.v1beta1.ExportAssetsResponse; + + /** + * Verifies an ExportAssetsResponse 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { + + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + } + + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); + + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; + + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: google.cloud.asset.v1beta1.ContentType; + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryRequest instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryRequest + * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryRequest + * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; + + /** + * Verifies a BatchGetAssetsHistoryRequest 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { + + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); + } + + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); + + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryResponse instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryResponse + * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryResponse + * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; + + /** + * Verifies a BatchGetAssetsHistoryResponse 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @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.asset.v1beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @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.asset.v1beta1.OutputConfig; + + /** + * Verifies an OutputConfig 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination objectUri. */ + public objectUri?: "uri"; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1beta1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1beta1.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1beta1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1beta1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1beta1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1beta1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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.asset.v1beta1.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.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1beta1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1beta1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { + + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1p2beta1.IExportAssetsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1p2beta1.IExportAssetsRequest): Promise; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1p2beta1.AssetService.BatchGetAssetsHistoryCallback): void; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest): Promise; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback): void; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise + */ + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest): Promise; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback): void; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise + */ + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest): Promise; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback): void; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise + */ + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest): Promise; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback): void; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): Promise; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback): void; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise + */ + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse + */ + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse + */ + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1p2beta1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsRequest); + + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: google.cloud.asset.v1p2beta1.ContentType; + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsRequest): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsRequest + * @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.asset.v1p2beta1.ExportAssetsRequest; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsRequest + * @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.asset.v1p2beta1.ExportAssetsRequest; + + /** + * Verifies an ExportAssetsRequest 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { + + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { + + /** + * Constructs a new ExportAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse); + + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsResponse + * @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.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsResponse + * @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.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Verifies an ExportAssetsResponse 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { + + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1p2beta1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + } + + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest); + + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; + + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: google.cloud.asset.v1p2beta1.ContentType; + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryRequest + * @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.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryRequest + * @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.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + + /** + * Verifies a BatchGetAssetsHistoryRequest 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { + + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1p2beta1.ITemporalAsset[]|null); + } + + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse); + + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1p2beta1.ITemporalAsset[]; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryResponse instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryResponse + * @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.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryResponse + * @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.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Verifies a BatchGetAssetsHistoryResponse 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { + + /** CreateFeedRequest parent */ + parent?: (string|null); + + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + } + + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { + + /** + * Constructs a new CreateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest); + + /** CreateFeedRequest parent. */ + public parent: string; + + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + + /** + * Creates a new CreateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest): google.cloud.asset.v1p2beta1.CreateFeedRequest; + + /** + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFeedRequest + * @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.asset.v1p2beta1.CreateFeedRequest; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFeedRequest + * @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.asset.v1p2beta1.CreateFeedRequest; + + /** + * Verifies a CreateFeedRequest 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 CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.CreateFeedRequest; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { + + /** GetFeedRequest name */ + name?: (string|null); + } + + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { + + /** + * Constructs a new GetFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest); + + /** GetFeedRequest name. */ + public name: string; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest): google.cloud.asset.v1p2beta1.GetFeedRequest; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFeedRequest + * @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.asset.v1p2beta1.GetFeedRequest; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFeedRequest + * @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.asset.v1p2beta1.GetFeedRequest; + + /** + * Verifies a GetFeedRequest 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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GetFeedRequest; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { + + /** ListFeedsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { + + /** + * Constructs a new ListFeedsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest); + + /** ListFeedsRequest parent. */ + public parent: string; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest): google.cloud.asset.v1p2beta1.ListFeedsRequest; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsRequest + * @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.asset.v1p2beta1.ListFeedsRequest; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsRequest + * @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.asset.v1p2beta1.ListFeedsRequest; + + /** + * Verifies a ListFeedsRequest 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 ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsRequest; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { + + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1p2beta1.IFeed[]|null); + } + + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { + + /** + * Constructs a new ListFeedsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse); + + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1p2beta1.IFeed[]; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse): google.cloud.asset.v1p2beta1.ListFeedsResponse; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsResponse + * @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.asset.v1p2beta1.ListFeedsResponse; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsResponse + * @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.asset.v1p2beta1.ListFeedsResponse; + + /** + * Verifies a ListFeedsResponse 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 ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsResponse; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { + + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { + + /** + * Constructs a new UpdateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest); + + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFeedRequest + * @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.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFeedRequest + * @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.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Verifies an UpdateFeedRequest 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { + + /** DeleteFeedRequest name */ + name?: (string|null); + } + + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { + + /** + * Constructs a new DeleteFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest); + + /** DeleteFeedRequest name. */ + public name: string; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFeedRequest + * @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.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFeedRequest + * @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.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Verifies a DeleteFeedRequest 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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1p2beta1.IBigQueryDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1p2beta1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IOutputConfig): google.cloud.asset.v1p2beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @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.asset.v1p2beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @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.asset.v1p2beta1.OutputConfig; + + /** + * Verifies an OutputConfig 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination uriPrefix. */ + public uriPrefix: string; + + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IGcsDestination): google.cloud.asset.v1p2beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1p2beta1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1p2beta1.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination force */ + force?: (boolean|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination force. */ + public force: boolean; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IBigQueryDestination): google.cloud.asset.v1p2beta1.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @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.asset.v1p2beta1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @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.asset.v1p2beta1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubDestination + * @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.asset.v1p2beta1.PubsubDestination; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubDestination + * @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.asset.v1p2beta1.PubsubDestination; + + /** + * Verifies a PubsubDestination 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 PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + IAM_POLICY_NAME = 3, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { + + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + } + + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { + + /** + * Constructs a new FeedOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig); + + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedOutputConfig + * @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.asset.v1p2beta1.FeedOutputConfig; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedOutputConfig + * @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.asset.v1p2beta1.FeedOutputConfig; + + /** + * Verifies a FeedOutputConfig 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 FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Feed. */ + interface IFeed { + + /** Feed name */ + name?: (string|null); + + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1p2beta1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + } + + /** Represents a Feed. */ + class Feed implements IFeed { + + /** + * Constructs a new Feed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeed); + + /** Feed name. */ + public name: string; + + /** Feed assetNames. */ + public assetNames: string[]; + + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: google.cloud.asset.v1p2beta1.ContentType; + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + + /** + * Creates a new Feed instance using the specified properties. + * @param [properties] Properties to set + * @returns Feed instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeed): google.cloud.asset.v1p2beta1.Feed; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feed + * @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.asset.v1p2beta1.Feed; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feed + * @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.asset.v1p2beta1.Feed; + + /** + * Verifies a Feed 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 Feed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Feed; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1p2beta1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1p2beta1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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.asset.v1p2beta1.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.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset iamPolicyName */ + iamPolicyName?: (Uint8Array|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset iamPolicyName. */ + public iamPolicyName: Uint8Array; + + /** Asset ancestors. */ + public ancestors: string[]; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1p2beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1p2beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + + /** Resource internalData */ + internalData?: (google.protobuf.IAny|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** Resource internalData. */ + public internalData?: (google.protobuf.IAny|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1p2beta1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1p2beta1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource 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 }; + } + } + + /** 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|null); + + /** FieldDescriptorProto type */ + type?: (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); + } + + /** 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; + + /** FieldDescriptorProto type. */ + public type: 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); + + /** + * 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|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); + } + + /** 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; + + /** 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); + } + + /** 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|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (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); + } + + /** 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; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: 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|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|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; + + /** 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|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** 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|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; + + /** + * 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 Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @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.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @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.Struct; + + /** + * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue: google.protobuf.NullValue; + + /** Value numberValue. */ + public numberValue: number; + + /** Value stringValue. */ + public stringValue: string; + + /** Value boolValue. */ + public boolValue: boolean; + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @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.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @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.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @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.ListValue; + + /** + * Verifies a ListValue 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 ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|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); + + /** 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 }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|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); + + /** 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 }; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy etag */ + etag?: (Uint8Array|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy etag. */ + public etag: Uint8Array; + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: google.iam.v1.BindingDelta.Action; + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: google.iam.v1.AuditConfigDelta.Action; + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @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.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @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.type.Expr; + + /** + * Verifies an Expr 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr 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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js new file mode 100644 index 00000000000..cc49b8a1939 --- /dev/null +++ b/packages/google-cloud-asset/protos/protos.js @@ -0,0 +1,25636 @@ +/*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("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.asset = (function() { + + /** + * Namespace asset. + * @memberof google.cloud + * @namespace + */ + var asset = {}; + + asset.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.asset + * @namespace + */ + var v1 = {}; + + v1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef BatchGetAssetsHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + */ + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { + return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse, request, callback); + }, "name", { value: "BatchGetAssetsHistory" }); + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1.ExportAssetsRequest = (function() { + + /** + * Properties of an ExportAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + */ + + /** + * Constructs a new ExportAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set + */ + function ExportAssetsRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.parent = ""; + + /** + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.readTime = null; + + /** + * ExportAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.contentType = 0; + + /** + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest instance + */ + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); + }; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.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.asset.v1.ExportAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + */ + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.ExportAssetsRequest} message ExportAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsRequest; + })(); + + v1.ExportAssetsResponse = (function() { + + /** + * Properties of an ExportAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + */ + + /** + * Constructs a new ExportAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set + */ + function ExportAssetsResponse(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]]; + } + + /** + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.readTime = null; + + /** + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse instance + */ + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.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.asset.v1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsResponse; + })(); + + v1.BatchGetAssetsHistoryRequest = (function() { + + /** + * Properties of a BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetAssetsHistoryRequest + * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent + * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames + * @property {google.cloud.asset.v1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType + * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + */ + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetAssetsHistoryRequest. + * @implements IBatchGetAssetsHistoryRequest + * @constructor + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + */ + function BatchGetAssetsHistoryRequest(properties) { + this.assetNames = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.parent = ""; + + /** + * BatchGetAssetsHistoryRequest assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + + /** + * BatchGetAssetsHistoryRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.contentType = 0; + + /** + * BatchGetAssetsHistoryRequest readTimeWindow. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + */ + BatchGetAssetsHistoryRequest.create = function create(properties) { + return new BatchGetAssetsHistoryRequest(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.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.asset.v1.BatchGetAssetsHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + message.contentType = reader.int32(); + break; + case 4: + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.readTimeWindow); + if (error) + return "readTimeWindow." + error; + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + */ + BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetNames = []; + if (options.defaults) { + object.parent = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.readTimeWindow = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryRequest; + })(); + + v1.BatchGetAssetsHistoryResponse = (function() { + + /** + * Properties of a BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + */ + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse + * @constructor + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + */ + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @instance + */ + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + */ + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.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.asset.v1.BatchGetAssetsHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.TemporalAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + */ + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.TemporalAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.TemporalAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryResponse; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.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.asset.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|undefined} objectUri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; + })(); + + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.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.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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 && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("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.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + return v1; + })(); + + asset.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1beta1 = {}; + + v1beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. + * @memberof google.cloud.asset.v1beta1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. + * @memberof google.cloud.asset.v1beta1.AssetService + * @typedef BatchGetAssetsHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + */ + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @param {google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { + return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, request, callback); + }, "name", { value: "BatchGetAssetsHistory" }); + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1beta1.ExportAssetsRequest = (function() { + + /** + * Properties of an ExportAssetsRequest. + * @memberof google.cloud.asset.v1beta1 + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + */ + + /** + * Constructs a new ExportAssetsRequest. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest + * @constructor + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set + */ + function ExportAssetsRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.parent = ""; + + /** + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.readTime = null; + + /** + * ExportAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1beta1.ContentType} contentType + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.contentType = 0; + + /** + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest instance + */ + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); + }; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.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.asset.v1beta1.ExportAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest + */ + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1beta1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1beta1.ExportAssetsRequest} message ExportAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsRequest; + })(); + + v1beta1.ExportAssetsResponse = (function() { + + /** + * Properties of an ExportAssetsResponse. + * @memberof google.cloud.asset.v1beta1 + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + */ + + /** + * Constructs a new ExportAssetsResponse. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse + * @constructor + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set + */ + function ExportAssetsResponse(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]]; + } + + /** + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.readTime = null; + + /** + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse instance + */ + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.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.asset.v1beta1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1beta1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsResponse; + })(); + + v1beta1.BatchGetAssetsHistoryRequest = (function() { + + /** + * Properties of a BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1beta1 + * @interface IBatchGetAssetsHistoryRequest + * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent + * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames + * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType + * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + */ + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents a BatchGetAssetsHistoryRequest. + * @implements IBatchGetAssetsHistoryRequest + * @constructor + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + */ + function BatchGetAssetsHistoryRequest(properties) { + this.assetNames = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.parent = ""; + + /** + * BatchGetAssetsHistoryRequest assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + + /** + * BatchGetAssetsHistoryRequest contentType. + * @member {google.cloud.asset.v1beta1.ContentType} contentType + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.contentType = 0; + + /** + * BatchGetAssetsHistoryRequest readTimeWindow. + * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + */ + BatchGetAssetsHistoryRequest.create = function create(properties) { + return new BatchGetAssetsHistoryRequest(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.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.asset.v1beta1.BatchGetAssetsHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + message.contentType = reader.int32(); + break; + case 4: + message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryRequest message. + * @function verify + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.readTimeWindow); + if (error) + return "readTimeWindow." + error; + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + */ + BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) + return object; + var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.readTimeWindow); + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetNames = []; + if (options.defaults) { + object.parent = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.readTimeWindow = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + object.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.readTimeWindow, options); + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryRequest; + })(); + + v1beta1.BatchGetAssetsHistoryResponse = (function() { + + /** + * Properties of a BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1beta1 + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + */ + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse + * @constructor + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + */ + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @instance + */ + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + */ + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.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.asset.v1beta1.BatchGetAssetsHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1beta1.TemporalAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @function verify + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1beta1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + */ + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) + return object; + var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1beta1.TemporalAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1beta1.TemporalAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryResponse; + })(); + + v1beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1beta1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.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.asset.v1beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|undefined} objectUri + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1beta1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1beta1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; + })(); + + v1beta1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1beta1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1beta1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemporalAsset; + })(); + + v1beta1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.v1beta1 + * @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.asset.v1beta1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1beta1.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 && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("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.asset.v1beta1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + */ + function Asset(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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1beta1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.Asset) + return object; + var message = new $root.google.cloud.asset.v1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.Asset + * @static + * @param {google.cloud.asset.v1beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1beta1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.Resource) + return object; + var message = new $root.google.cloud.asset.v1beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.Resource + * @static + * @param {google.cloud.asset.v1beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + return v1beta1; + })(); + + asset.v1p2beta1 = (function() { + + /** + * Namespace v1p2beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p2beta1 = {}; + + v1p2beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#exportAssets}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#batchGetAssetsHistory}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef BatchGetAssetsHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + */ + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { + return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, request, callback); + }, "name", { value: "BatchGetAssetsHistory" }); + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "GetFeed" }); + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse + */ + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p2beta1.ExportAssetsRequest = (function() { + + /** + * Properties of an ExportAssetsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + */ + + /** + * Constructs a new ExportAssetsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest=} [properties] Properties to set + */ + function ExportAssetsRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.parent = ""; + + /** + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.readTime = null; + + /** + * ExportAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.contentType = 0; + + /** + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest instance + */ + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); + }; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.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.asset.v1p2beta1.ExportAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + */ + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "IAM_POLICY_NAME": + case 3: + message.contentType = 3; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ExportAssetsRequest} message ExportAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsRequest; + })(); + + v1p2beta1.ExportAssetsResponse = (function() { + + /** + * Properties of an ExportAssetsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + */ + + /** + * Constructs a new ExportAssetsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set + */ + function ExportAssetsResponse(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]]; + } + + /** + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.readTime = null; + + /** + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse instance + */ + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.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.asset.v1p2beta1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsResponse; + })(); + + v1p2beta1.BatchGetAssetsHistoryRequest = (function() { + + /** + * Properties of a BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IBatchGetAssetsHistoryRequest + * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent + * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType + * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + */ + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a BatchGetAssetsHistoryRequest. + * @implements IBatchGetAssetsHistoryRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + */ + function BatchGetAssetsHistoryRequest(properties) { + this.assetNames = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.parent = ""; + + /** + * BatchGetAssetsHistoryRequest assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + + /** + * BatchGetAssetsHistoryRequest contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.contentType = 0; + + /** + * BatchGetAssetsHistoryRequest readTimeWindow. + * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + */ + BatchGetAssetsHistoryRequest.create = function create(properties) { + return new BatchGetAssetsHistoryRequest(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.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.asset.v1p2beta1.BatchGetAssetsHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + message.contentType = reader.int32(); + break; + case 4: + message.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.readTimeWindow); + if (error) + return "readTimeWindow." + error; + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + */ + BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "IAM_POLICY_NAME": + case 3: + message.contentType = 3; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.readTimeWindow); + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetNames = []; + if (options.defaults) { + object.parent = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.readTimeWindow = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + object.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.readTimeWindow, options); + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryRequest; + })(); + + v1p2beta1.BatchGetAssetsHistoryResponse = (function() { + + /** + * Properties of a BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + */ + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + */ + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @instance + */ + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + */ + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1p2beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.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.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1p2beta1.TemporalAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + */ + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryResponse; + })(); + + v1p2beta1.CreateFeedRequest = (function() { + + /** + * Properties of a CreateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed + */ + + /** + * Constructs a new CreateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + */ + function CreateFeedRequest(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]]; + } + + /** + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.parent = ""; + + /** + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feedId = ""; + + /** + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feed = null; + + /** + * Creates a new CreateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance + */ + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); + }; + + /** + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && message.hasOwnProperty("feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFeedRequest.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.asset.v1p2beta1.CreateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFeedRequest.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.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + return null; + }; + + /** + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + */ + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } + return message; + }; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + return object; + }; + + /** + * Converts this CreateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFeedRequest; + })(); + + v1p2beta1.GetFeedRequest = (function() { + + /** + * Properties of a GetFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name + */ + + /** + * Constructs a new GetFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + */ + function GetFeedRequest(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]]; + } + + /** + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @instance + */ + GetFeedRequest.prototype.name = ""; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance + */ + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); + }; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.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.asset.v1p2beta1.GetFeedRequest(); + 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 GetFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFeedRequest.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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + */ + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFeedRequest.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 GetFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @instance + * @returns {Object.} JSON object + */ + GetFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetFeedRequest; + })(); + + v1p2beta1.ListFeedsRequest = (function() { + + /** + * Properties of a ListFeedsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent + */ + + /** + * Constructs a new ListFeedsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + */ + function ListFeedsRequest(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]]; + } + + /** + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @instance + */ + ListFeedsRequest.prototype.parent = ""; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance + */ + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); + }; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.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.asset.v1p2beta1.ListFeedsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsRequest.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"; + return null; + }; + + /** + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + */ + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFeedsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFeedsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFeedsRequest; + })(); + + v1p2beta1.ListFeedsResponse = (function() { + + /** + * Properties of a ListFeedsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds + */ + + /** + * Constructs a new ListFeedsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + */ + function ListFeedsResponse(properties) { + this.feeds = []; + 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]]; + } + + /** + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @instance + */ + ListFeedsResponse.prototype.feeds = $util.emptyArray; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance + */ + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); + }; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.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.asset.v1p2beta1.ListFeedsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } + return null; + }; + + /** + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + */ + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); + } + return object; + }; + + /** + * Converts this ListFeedsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFeedsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFeedsResponse; + })(); + + v1p2beta1.UpdateFeedRequest = (function() { + + /** + * Properties of an UpdateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + */ + + /** + * Constructs a new UpdateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + */ + function UpdateFeedRequest(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]]; + } + + /** + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.feed = null; + + /** + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance + */ + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); + }; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.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.asset.v1p2beta1.UpdateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.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 UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + */ + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.feed = null; + object.updateMask = null; + } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFeedRequest; + })(); + + v1p2beta1.DeleteFeedRequest = (function() { + + /** + * Properties of a DeleteFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name + */ + + /** + * Constructs a new DeleteFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + */ + function DeleteFeedRequest(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]]; + } + + /** + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @instance + */ + DeleteFeedRequest.prototype.name = ""; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance + */ + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); + }; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.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.asset.v1p2beta1.DeleteFeedRequest(); + 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 DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFeedRequest.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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + */ + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFeedRequest.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 DeleteFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteFeedRequest; + })(); + + v1p2beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.asset.v1p2beta1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1p2beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + $root.google.cloud.asset.v1p2beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.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.asset.v1p2beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1p2beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|"uriPrefix"|undefined} objectUri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1p2beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.uriPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v1p2beta1.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {boolean|null} [force] BigQueryDestination force + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; + + /** + * BigQueryDestination force. + * @member {boolean} force + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.force = false; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && message.hasOwnProperty("dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && message.hasOwnProperty("table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.force != null && message.hasOwnProperty("force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.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.asset.v1p2beta1.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataset = reader.string(); + break; + case 2: + message.table = reader.string(); + break; + case 3: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p2beta1.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.force = false; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryDestination; + })(); + + v1p2beta1.PubsubDestination = (function() { + + /** + * Properties of a PubsubDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic + */ + + /** + * Constructs a new PubsubDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination + * @constructor + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + */ + function PubsubDestination(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]]; + } + + /** + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @instance + */ + PubsubDestination.prototype.topic = ""; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance + */ + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); + }; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.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.asset.v1p2beta1.PubsubDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubDestination message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + */ + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this PubsubDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @instance + * @returns {Object.} JSON object + */ + PubsubDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PubsubDestination; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p2beta1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} IAM_POLICY_NAME=3 IAM_POLICY_NAME value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1p2beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[3] = "IAM_POLICY_NAME"] = 3; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1p2beta1.FeedOutputConfig = (function() { + + /** + * Properties of a FeedOutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + */ + + /** + * Constructs a new FeedOutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig + * @constructor + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + */ + function FeedOutputConfig(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]]; + } + + /** + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + */ + FeedOutputConfig.prototype.pubsubDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + */ + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance + */ + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); + }; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedOutputConfig.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.asset.v1p2beta1.FeedOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeedOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeedOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } + } + return null; + }; + + /** + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + */ + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); + } + return message; + }; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeedOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; + } + return object; + }; + + /** + * Converts this FeedOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + * @returns {Object.} JSON object + */ + FeedOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FeedOutputConfig; + })(); + + v1p2beta1.Feed = (function() { + + /** + * Properties of a Feed. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + */ + + /** + * Constructs a new Feed. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a Feed. + * @implements IFeed + * @constructor + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + */ + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; + 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]]; + } + + /** + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.name = ""; + + /** + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.assetNames = $util.emptyArray; + + /** + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.assetTypes = $util.emptyArray; + + /** + * Feed contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.contentType = 0; + + /** + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.feedOutputConfig = null; + + /** + * Creates a new Feed instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance + */ + Feed.create = function create(properties) { + return new Feed(properties); + }; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feed.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.asset.v1p2beta1.Feed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feed message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feed.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.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); + if (error) + return "feedOutputConfig." + error; + } + return null; + }; + + /** + * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + */ + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "IAM_POLICY_NAME": + case 3: + message.contentType = 3; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); + } + return message; + }; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.Feed} message Feed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + } + if (options.defaults) { + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); + return object; + }; + + /** + * Converts this Feed to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + * @returns {Object.} JSON object + */ + Feed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Feed; + })(); + + v1p2beta1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1p2beta1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1p2beta1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemporalAsset; + })(); + + v1p2beta1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.v1p2beta1 + * @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.asset.v1p2beta1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.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 && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("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.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1p2beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Uint8Array|null} [iamPolicyName] Asset iamPolicyName + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.ancestors = []; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset iamPolicyName. + * @member {Uint8Array} iamPolicyName + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.iamPolicyName = $util.newBuffer([]); + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.iamPolicyName); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1p2beta1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 5: + message.iamPolicyName = reader.bytes(); + break; + case 6: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) + if (!(message.iamPolicyName && typeof message.iamPolicyName.length === "number" || $util.isString(message.iamPolicyName))) + return "iamPolicyName: buffer expected"; + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.iamPolicyName != null) + if (typeof object.iamPolicyName === "string") + $util.base64.decode(object.iamPolicyName, message.iamPolicyName = $util.newBuffer($util.base64.length(object.iamPolicyName)), 0); + else if (object.iamPolicyName.length) + message.iamPolicyName = object.iamPolicyName; + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + if (options.bytes === String) + object.iamPolicyName = ""; + else { + object.iamPolicyName = []; + if (options.bytes !== Array) + object.iamPolicyName = $util.newBuffer(object.iamPolicyName); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) + object.iamPolicyName = options.bytes === String ? $util.base64.encode(message.iamPolicyName, 0, message.iamPolicyName.length) : options.bytes === Array ? Array.prototype.slice.call(message.iamPolicyName) : message.iamPolicyName; + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1p2beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {google.protobuf.IAny|null} [internalData] Resource internalData + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource internalData. + * @member {google.protobuf.IAny|null|undefined} internalData + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.internalData = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.internalData != null && message.hasOwnProperty("internalData")) + $root.google.protobuf.Any.encode(message.internalData, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1p2beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 7: + message.internalData = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + if (message.internalData != null && message.hasOwnProperty("internalData")) { + var error = $root.google.protobuf.Any.verify(message.internalData); + if (error) + return "internalData." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + if (object.internalData != null) { + if (typeof object.internalData !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Resource.internalData: object expected"); + message.internalData = $root.google.protobuf.Any.fromObject(object.internalData); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.internalData = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.internalData != null && message.hasOwnProperty("internalData")) + object.internalData = $root.google.protobuf.Any.toObject(message.internalData, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + return v1p2beta1; + })(); + + return asset; + })(); + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("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; + })(); + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + 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; + 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; + } + 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); + } + 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 = ""; + } + 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; + 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 {string} + * @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 {string} + * @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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("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 + */ + + /** + * 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 = []; + 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 = false; + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("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(); + 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; + 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; + } + } + 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]); + } + } + 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 = []; + 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 = false; + 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); + } + 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 {string} + * @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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("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(); + 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; + 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; + } + } + 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]); + } + } + 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; + } + 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); + } + 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 + */ + + /** + * 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 = []; + 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; + + /** + * 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 && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("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(); + 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; + 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; + } + } + 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]); + } + } + 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 = []; + 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; + } + 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); + } + 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 {string} + * @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 {string} + * @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 && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".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 {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * 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.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * 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 && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 && message.hasOwnProperty(".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 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + 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.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; + } + 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"; + } + 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.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"]); + } + 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]); + } + 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 {string} + * @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 && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("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 && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("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 && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("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 && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.hasOwnProperty("fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.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.Struct(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.fields === $util.emptyObject) + message.fields = {}; + key = reader.string(); + reader.pos++; + message.fields[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = 0; + + /** + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = false; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && message.hasOwnProperty("nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && message.hasOwnProperty("numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && message.hasOwnProperty("boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && message.hasOwnProperty("structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && message.hasOwnProperty("listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.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.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nullValue = reader.int32(); + break; + case 2: + message.numberValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {string} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + 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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.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.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + 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 && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("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; + })(); + + 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 && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("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; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int32(); + break; + case 4: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + case 3: + message.etag = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 3: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Binding; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && message.hasOwnProperty("member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + case 4: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && message.hasOwnProperty("logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.service = reader.string(); + break; + case 3: + message.exemptedMember = reader.string(); + break; + case 4: + message.logType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && message.hasOwnProperty("expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.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.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + return type; + })(); + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && message.hasOwnProperty("metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && message.hasOwnProperty("done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && message.hasOwnProperty("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 && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("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-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index 2dbe3faa3a6..dd2654a99ba 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -20,27 +20,36 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `binding` binds a list of - * `members` to a `role`, where the members can be user accounts, Google groups, - * Google domains, and service accounts. A `role` is a named list of permissions - * defined by IAM. + * A `Policy` is a collection of `bindings`. A `binding` binds one or more + * `members` to a single `role`. Members can be user accounts, service accounts, + * Google groups, and domains (such as G Suite). A `role` is a named list of + * permissions (defined by IAM or configured by users). A `binding` can + * optionally specify a `condition`, which is a logic expression that further + * constrains the role binding based on attributes about the request and/or + * target resource. * * **JSON Example** * * { * "bindings": [ * { - * "role": "roles/owner", + * "role": "role/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" + * "serviceAccount:my-project-id@appspot.gserviceaccount.com" * ] * }, * { - * "role": "roles/viewer", - * "members": ["user:sean@example.com"] + * "role": "roles/resourcemanager.organizationViewer", + * "members": ["user:eve@example.com"], + * "condition": { + * "title": "expirable access", + * "description": "Does not grant access after Sep 2020", + * "expression": "request.time < + * timestamp('2020-10-01T00:00:00.000Z')", + * } * } * ] * } @@ -52,12 +61,15 @@ * - user:mike@example.com * - group:admins@example.com * - domain:google.com - * - serviceAccount:my-other-app@appspot.gserviceaccount.com - * role: roles/owner + * - serviceAccount:my-project-id@appspot.gserviceaccount.com + * role: roles/resourcemanager.organizationAdmin * - members: - * - user:sean@example.com - * role: roles/viewer - * + * - user:eve@example.com + * role: roles/resourcemanager.organizationViewer + * condition: + * title: expirable access + * description: Does not grant access after Sep 2020 + * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') * * For a description of IAM and its features, see the * [IAM developer's guide](https://cloud.google.com/iam/docs). @@ -68,12 +80,18 @@ * Valid values are 0, 1, and 3. Requests specifying an invalid value will be * rejected. * - * Policies with any conditional bindings must specify version 3. Policies - * without any conditional bindings may specify any valid value or leave the - * field unset. + * Operations affecting conditional bindings must specify version 3. This can + * be either setting a conditional policy, modifying a conditional binding, + * or removing a conditional binding from the stored conditional policy. + * Operations on non-conditional policies may specify any valid value or + * leave the field unset. + * + * If no etag is provided in the call to `setIamPolicy`, any version + * compliance checks on the incoming and/or stored policy is skipped. * * @property {Object[]} bindings - * Associates a list of `members` to a `role`. + * Associates a list of `members` to a `role`. Optionally may specify a + * `condition` that determines when binding is in effect. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -88,7 +106,9 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. + * policy is overwritten. Due to blind-set semantics of an etag-less policy, + * 'setIamPolicy' will not fail even if either of incoming or stored policy + * does not meet the version requirements. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 2dbe3faa3a6..dd2654a99ba 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -20,27 +20,36 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `binding` binds a list of - * `members` to a `role`, where the members can be user accounts, Google groups, - * Google domains, and service accounts. A `role` is a named list of permissions - * defined by IAM. + * A `Policy` is a collection of `bindings`. A `binding` binds one or more + * `members` to a single `role`. Members can be user accounts, service accounts, + * Google groups, and domains (such as G Suite). A `role` is a named list of + * permissions (defined by IAM or configured by users). A `binding` can + * optionally specify a `condition`, which is a logic expression that further + * constrains the role binding based on attributes about the request and/or + * target resource. * * **JSON Example** * * { * "bindings": [ * { - * "role": "roles/owner", + * "role": "role/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" + * "serviceAccount:my-project-id@appspot.gserviceaccount.com" * ] * }, * { - * "role": "roles/viewer", - * "members": ["user:sean@example.com"] + * "role": "roles/resourcemanager.organizationViewer", + * "members": ["user:eve@example.com"], + * "condition": { + * "title": "expirable access", + * "description": "Does not grant access after Sep 2020", + * "expression": "request.time < + * timestamp('2020-10-01T00:00:00.000Z')", + * } * } * ] * } @@ -52,12 +61,15 @@ * - user:mike@example.com * - group:admins@example.com * - domain:google.com - * - serviceAccount:my-other-app@appspot.gserviceaccount.com - * role: roles/owner + * - serviceAccount:my-project-id@appspot.gserviceaccount.com + * role: roles/resourcemanager.organizationAdmin * - members: - * - user:sean@example.com - * role: roles/viewer - * + * - user:eve@example.com + * role: roles/resourcemanager.organizationViewer + * condition: + * title: expirable access + * description: Does not grant access after Sep 2020 + * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') * * For a description of IAM and its features, see the * [IAM developer's guide](https://cloud.google.com/iam/docs). @@ -68,12 +80,18 @@ * Valid values are 0, 1, and 3. Requests specifying an invalid value will be * rejected. * - * Policies with any conditional bindings must specify version 3. Policies - * without any conditional bindings may specify any valid value or leave the - * field unset. + * Operations affecting conditional bindings must specify version 3. This can + * be either setting a conditional policy, modifying a conditional binding, + * or removing a conditional binding from the stored conditional policy. + * Operations on non-conditional policies may specify any valid value or + * leave the field unset. + * + * If no etag is provided in the call to `setIamPolicy`, any version + * compliance checks on the incoming and/or stored policy is skipped. * * @property {Object[]} bindings - * Associates a list of `members` to a `role`. + * Associates a list of `members` to a `role`. Optionally may specify a + * `condition` that determines when binding is in effect. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -88,7 +106,9 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. + * policy is overwritten. Due to blind-set semantics of an etag-less policy, + * 'setIamPolicy' will not fail even if either of incoming or stored policy + * does not meet the version requirements. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js index 2dbe3faa3a6..dd2654a99ba 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js @@ -20,27 +20,36 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `binding` binds a list of - * `members` to a `role`, where the members can be user accounts, Google groups, - * Google domains, and service accounts. A `role` is a named list of permissions - * defined by IAM. + * A `Policy` is a collection of `bindings`. A `binding` binds one or more + * `members` to a single `role`. Members can be user accounts, service accounts, + * Google groups, and domains (such as G Suite). A `role` is a named list of + * permissions (defined by IAM or configured by users). A `binding` can + * optionally specify a `condition`, which is a logic expression that further + * constrains the role binding based on attributes about the request and/or + * target resource. * * **JSON Example** * * { * "bindings": [ * { - * "role": "roles/owner", + * "role": "role/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" + * "serviceAccount:my-project-id@appspot.gserviceaccount.com" * ] * }, * { - * "role": "roles/viewer", - * "members": ["user:sean@example.com"] + * "role": "roles/resourcemanager.organizationViewer", + * "members": ["user:eve@example.com"], + * "condition": { + * "title": "expirable access", + * "description": "Does not grant access after Sep 2020", + * "expression": "request.time < + * timestamp('2020-10-01T00:00:00.000Z')", + * } * } * ] * } @@ -52,12 +61,15 @@ * - user:mike@example.com * - group:admins@example.com * - domain:google.com - * - serviceAccount:my-other-app@appspot.gserviceaccount.com - * role: roles/owner + * - serviceAccount:my-project-id@appspot.gserviceaccount.com + * role: roles/resourcemanager.organizationAdmin * - members: - * - user:sean@example.com - * role: roles/viewer - * + * - user:eve@example.com + * role: roles/resourcemanager.organizationViewer + * condition: + * title: expirable access + * description: Does not grant access after Sep 2020 + * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') * * For a description of IAM and its features, see the * [IAM developer's guide](https://cloud.google.com/iam/docs). @@ -68,12 +80,18 @@ * Valid values are 0, 1, and 3. Requests specifying an invalid value will be * rejected. * - * Policies with any conditional bindings must specify version 3. Policies - * without any conditional bindings may specify any valid value or leave the - * field unset. + * Operations affecting conditional bindings must specify version 3. This can + * be either setting a conditional policy, modifying a conditional binding, + * or removing a conditional binding from the stored conditional policy. + * Operations on non-conditional policies may specify any valid value or + * leave the field unset. + * + * If no etag is provided in the call to `setIamPolicy`, any version + * compliance checks on the incoming and/or stored policy is skipped. * * @property {Object[]} bindings - * Associates a list of `members` to a `role`. + * Associates a list of `members` to a `role`. Optionally may specify a + * `condition` that determines when binding is in effect. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} @@ -88,7 +106,9 @@ * ensure that their change will be applied to the same version of the policy. * * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. + * policy is overwritten. Due to blind-set semantics of an etag-less policy, + * 'setIamPolicy' will not fail even if either of incoming or stored policy + * does not meet the version requirements. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f259606460d..35d86f87f61 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-31T11:07:20.415455Z", + "updateTime": "2019-09-20T11:07:26.247263Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.1", - "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" + "version": "0.36.3", + "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", - "internalRef": "266247326" + "sha": "44e588d97e7497dff01107d39b6a19062f9a4ffa", + "internalRef": "270200097" } }, { From 3d33b3991f3d23529d9b1ef9b0da5dc12a33b5aa Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 1 Oct 2019 20:15:00 -0700 Subject: [PATCH 134/429] fix: use compatible version of google-gax * fix: use compatible version of google-gax * fix: use gax v1.6.3 --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 69896273a38..b91677b4f7c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -41,7 +41,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^1.0.0", + "google-gax": "^1.6.3", "protobufjs": "^6.8.0" }, "devDependencies": { From 2f2caa5fdab842bd8124111601303ce13b3c4c37 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 8 Oct 2019 17:07:42 -0700 Subject: [PATCH 135/429] chore: update CONTRIBUTING.md and make releaseType node (#205) --- packages/google-cloud-asset/CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/google-cloud-asset/CONTRIBUTING.md b/packages/google-cloud-asset/CONTRIBUTING.md index 78aaa61b269..f6c4cf010e3 100644 --- a/packages/google-cloud-asset/CONTRIBUTING.md +++ b/packages/google-cloud-asset/CONTRIBUTING.md @@ -34,6 +34,7 @@ accept your pull requests. 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 @@ -46,8 +47,17 @@ accept your pull requests. 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 From 4c6df37172c90413bece198eb14ca4c31df058e1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 11 Oct 2019 21:01:56 -0700 Subject: [PATCH 136/429] chore: update pull request template (#201) --- .../src/v1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1p2beta1/doc/google/iam/v1/doc_policy.js | 2 +- packages/google-cloud-asset/synth.metadata | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index dd2654a99ba..57db8df60b1 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -33,7 +33,7 @@ * { * "bindings": [ * { - * "role": "role/resourcemanager.organizationAdmin", + * "role": "roles/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index dd2654a99ba..57db8df60b1 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -33,7 +33,7 @@ * { * "bindings": [ * { - * "role": "role/resourcemanager.organizationAdmin", + * "role": "roles/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js index dd2654a99ba..57db8df60b1 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js @@ -33,7 +33,7 @@ * { * "bindings": [ * { - * "role": "role/resourcemanager.organizationAdmin", + * "role": "roles/resourcemanager.organizationAdmin", * "members": [ * "user:mike@example.com", * "group:admins@example.com", diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 35d86f87f61..46f7c48eff6 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-09-20T11:07:26.247263Z", + "updateTime": "2019-10-01T11:09:07.207764Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.3", - "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" + "version": "0.37.1", + "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "44e588d97e7497dff01107d39b6a19062f9a4ffa", - "internalRef": "270200097" + "sha": "ce3c574d1266026cebea3a893247790bd68191c2", + "internalRef": "272147209" } }, { From 1685584a8a3437e7a95ef6d7f821c5a79da93e72 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Oct 2019 10:20:03 -0700 Subject: [PATCH 137/429] feat: add BigQuery destination and proto types (#206) --- .../google/cloud/asset/v1/asset_service.proto | 87 +- .../protos/google/cloud/asset/v1/assets.proto | 8 +- .../google-cloud-asset/protos/protos.d.ts | 361 +++- packages/google-cloud-asset/protos/protos.js | 1751 +++++++++++++---- .../google-cloud-asset/protos/protos.json | 152 +- .../src/v1/asset_service_client.js | 11 +- .../cloud/asset/v1/doc_asset_service.js | 70 +- packages/google-cloud-asset/synth.metadata | 10 +- 8 files changed, 2025 insertions(+), 425 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 0dfc2898b13..33dde9cd365 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -18,8 +18,13 @@ syntax = "proto3"; package google.cloud.asset.v1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/asset/v1/assets.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -29,9 +34,11 @@ option java_outer_classname = "AssetServiceProto"; option java_package = "com.google.cloud.asset.v1"; option php_namespace = "Google\\Cloud\\Asset\\V1"; - // Asset service definition. service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Exports assets with time and resource types to a given Cloud Storage // location. The output format is newline-delimited JSON. // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you @@ -41,6 +48,10 @@ service AssetService { post: "/v1/{parent=*/*}:exportAssets" body: "*" }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1.ExportAssetsResponse" + metadata_type: "google.cloud.asset.v1.ExportAssetsRequest" + }; } // Batch gets the update history of assets that overlap a time window. @@ -63,7 +74,12 @@ message ExportAssetsRequest { // organization number (such as "organizations/123"), a project ID (such as // "projects/my-project-id"), or a project number (such as "projects/12345"), // or a folder number (such as "folders/123"). - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; // Timestamp to take an asset snapshot. This can only be set to a timestamp // between 2018-10-02 UTC (inclusive) and the current time. If not specified, @@ -73,9 +89,9 @@ message ExportAssetsRequest { google.protobuf.Timestamp read_time = 2; // A list of asset types of which to take a snapshot for. For example: - // "compute.googleapis.com/Disk". If specified, only matching assets will be returned. - // See [Introduction to Cloud Asset - // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // "compute.googleapis.com/Disk". If specified, only matching assets will be + // returned. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) // for all supported asset types. repeated string asset_types = 3; @@ -85,7 +101,7 @@ message ExportAssetsRequest { // Required. Output configuration indicating where the results will be output // to. All results will be in newline delimited JSON format. - OutputConfig output_config = 5; + OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; } // The export asset response. This message is returned by the @@ -105,21 +121,27 @@ message BatchGetAssetsHistoryRequest { // Required. The relative name of the root asset. It can only be an // organization number (such as "organizations/123"), a project ID (such as // "projects/my-project-id")", or a project number (such as "projects/12345"). - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; // A list of the full names of the assets. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Resource // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + // and [Resource Name + // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) // for more info. // // The request becomes a no-op if the asset name list is empty, and the max // size of the asset name list is 100 in one request. repeated string asset_names = 2; - // Required. The content type. - ContentType content_type = 3; + // Optional. The content type. + ContentType content_type = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The time window for the asset history. Both start_time and // end_time are optional and if set, it must be after 2018-10-02 UTC. If @@ -127,7 +149,7 @@ message BatchGetAssetsHistoryRequest { // not set, the snapshot of the assets at end_time will be returned. The // returned results contain all temporal assets whose time window overlap with // read_time_window. - TimeWindow read_time_window = 4; + TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -142,6 +164,12 @@ message OutputConfig { oneof destination { // Destination on Cloud Storage. GcsDestination gcs_destination = 1; + + // Destination on BigQuery. The output table stores the fields in asset + // proto as columns in BigQuery. The resource/iam_policy field is converted + // to a record with each field to a column, except metadata to a single JSON + // string. + BigQueryDestination bigquery_destination = 2; } } @@ -155,9 +183,40 @@ message GcsDestination { // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. string uri = 1; + + // The uri prefix of all generated Cloud Storage objects. For example: + // "gs://bucket_name/object_name_prefix". Each object uri is in format: + // "gs://bucket_name/object_name_prefix// and only + // contains assets for that type. starts from 0. For example: + // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + // the first shard of output objects containing all + // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + // returned if file with the same name "gs://bucket_name/object_name_prefix" + // already exists. + string uri_prefix = 2; } } +// A BigQuery destination. +message BigQueryDestination { + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the snapshot result + // should be exported. If this dataset does not exist, the export call returns + // an error. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to which the snapshot result should be + // written. If this table does not exist, a new table with the given name + // will be created. + string table = 2 [(google.api.field_behavior) = REQUIRED]; + + // If the destination table already exists and this flag is `TRUE`, the + // table will be overwritten by the contents of assets snapshot. If the flag + // is not set and the destination table already exists, the export call + // returns an error. + bool force = 3; +} + // Asset content type. enum ContentType { // Unspecified content type. @@ -168,4 +227,10 @@ enum ContentType { // The actual IAM policy set on a resource. IAM_POLICY = 2; + + // The Cloud Organization Policy set on an asset. + ORG_POLICY = 4; + + // The Cloud Access context mananger Policy set on an asset. + ACCESS_POLICY = 5; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index f6a8108c0bd..e689b761822 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -18,11 +18,13 @@ syntax = "proto3"; package google.cloud.asset.v1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/iam/v1/policy.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset"; option java_multiple_files = true; @@ -30,7 +32,6 @@ option java_outer_classname = "AssetProto"; option java_package = "com.google.cloud.asset.v1"; option php_namespace = "Google\\Cloud\\Asset\\V1"; - // Temporal asset. In addition to the asset, the temporal asset includes the // status of the asset and valid from and to time of it. message TemporalAsset { @@ -57,6 +58,11 @@ message TimeWindow { // Cloud asset. This includes all Google Cloud Platform resources, // Cloud IAM policies, and other non-GCP assets. message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + // The full name of the asset. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Resource diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 35075e127dd..70a427e280f 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -490,6 +490,9 @@ export namespace google { /** OutputConfig gcsDestination */ gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); } /** Represents an OutputConfig. */ @@ -504,8 +507,11 @@ export namespace google { /** OutputConfig gcsDestination. */ public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** OutputConfig destination. */ - public destination?: "gcsDestination"; + public destination?: ("gcsDestination"|"bigqueryDestination"); /** * Creates a new OutputConfig instance using the specified properties. @@ -583,6 +589,9 @@ export namespace google { /** GcsDestination uri */ uri?: (string|null); + + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } /** Represents a GcsDestination. */ @@ -597,8 +606,11 @@ export namespace google { /** GcsDestination uri. */ public uri: string; + /** GcsDestination uriPrefix. */ + public uriPrefix: string; + /** GcsDestination objectUri. */ - public objectUri?: "uri"; + public objectUri?: ("uri"|"uriPrefix"); /** * Creates a new GcsDestination instance using the specified properties. @@ -671,11 +683,115 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination force */ + force?: (boolean|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination force. */ + public force: boolean; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @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.asset.v1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @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.asset.v1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** ContentType enum. */ enum ContentType { CONTENT_TYPE_UNSPECIFIED = 0, RESOURCE = 1, - IAM_POLICY = 2 + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 } /** Properties of a TemporalAsset. */ @@ -4737,6 +4853,230 @@ export namespace google { */ 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|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; + + /** + * 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. */ @@ -6469,6 +6809,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -6589,6 +6932,12 @@ export namespace google { /** 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. */ @@ -7114,11 +7463,11 @@ export namespace google { /** MethodOptions .google.api.http */ ".google.api.http"?: (google.api.IHttpRule|null); - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - /** MethodOptions .google.api.methodSignature */ ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); } /** Represents a MethodOptions. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index cc49b8a1939..4e86a4a736d 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -365,6 +365,8 @@ case 0: case 1: case 2: + case 4: + case 5: break; } if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { @@ -414,6 +416,14 @@ case 2: message.contentType = 2; break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; } if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") @@ -887,6 +897,8 @@ case 0: case 1: case 2: + case 4: + case 5: break; } if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { @@ -931,6 +943,14 @@ case 2: message.contentType = 2; break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; } if (object.readTimeWindow != null) { if (typeof object.readTimeWindow !== "object") @@ -1203,6 +1223,7 @@ * @memberof google.cloud.asset.v1 * @interface IOutputConfig * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.asset.v1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination */ /** @@ -1228,17 +1249,25 @@ */ OutputConfig.prototype.gcsDestination = null; + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * OutputConfig destination. - * @member {"gcsDestination"|undefined} destination + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination * @memberof google.cloud.asset.v1.OutputConfig * @instance */ Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), set: $util.oneOfSetter($oneOfFields) }); @@ -1268,6 +1297,8 @@ writer = $Writer.create(); if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -1305,6 +1336,9 @@ case 1: message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); break; + case 2: + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1349,6 +1383,16 @@ return "gcsDestination." + error; } } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } return null; }; @@ -1369,6 +1413,11 @@ throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.fromObject(object.bigqueryDestination); + } return message; }; @@ -1390,6 +1439,11 @@ if (options.oneofs) object.destination = "gcsDestination"; } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } return object; }; @@ -1414,6 +1468,7 @@ * @memberof google.cloud.asset.v1 * @interface IGcsDestination * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix */ /** @@ -1439,17 +1494,25 @@ */ GcsDestination.prototype.uri = ""; + /** + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * GcsDestination objectUri. - * @member {"uri"|undefined} objectUri + * @member {"uri"|"uriPrefix"|undefined} objectUri * @memberof google.cloud.asset.v1.GcsDestination * @instance */ Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), set: $util.oneOfSetter($oneOfFields) }); @@ -1479,6 +1542,8 @@ writer = $Writer.create(); if (message.uri != null && message.hasOwnProperty("uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; @@ -1516,6 +1581,9 @@ case 1: message.uri = reader.string(); break; + case 2: + message.uriPrefix = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1557,6 +1625,13 @@ if (!$util.isString(message.uri)) return "uri: string expected"; } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } return null; }; @@ -1574,6 +1649,8 @@ var message = new $root.google.cloud.asset.v1.GcsDestination(); if (object.uri != null) message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); return message; }; @@ -1595,6 +1672,11 @@ if (options.oneofs) object.objectUri = "uri"; } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } return object; }; @@ -1612,42 +1694,26 @@ return GcsDestination; })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - return values; - })(); - - v1.TemporalAsset = (function() { + v1.BigQueryDestination = (function() { /** - * Properties of a TemporalAsset. + * Properties of a BigQueryDestination. * @memberof google.cloud.asset.v1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {boolean|null} [force] BigQueryDestination force */ /** - * Constructs a new TemporalAsset. + * Constructs a new BigQueryDestination. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set */ - function TemporalAsset(properties) { + function BigQueryDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1655,101 +1721,101 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.BigQueryDestination * @instance */ - TemporalAsset.prototype.window = null; + BigQueryDestination.prototype.dataset = ""; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1.BigQueryDestination * @instance */ - TemporalAsset.prototype.deleted = false; + BigQueryDestination.prototype.table = ""; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * BigQueryDestination force. + * @member {boolean} force + * @memberof google.cloud.asset.v1.BigQueryDestination * @instance */ - TemporalAsset.prototype.asset = null; + BigQueryDestination.prototype.force = false; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new BigQueryDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + BigQueryDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataset != null && message.hasOwnProperty("dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && message.hasOwnProperty("table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.force != null && message.hasOwnProperty("force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a BigQueryDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + BigQueryDestination.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.asset.v1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BigQueryDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + message.dataset = reader.string(); break; case 2: - message.deleted = reader.bool(); + message.table = reader.string(); break; case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.force = reader.bool(); break; default: reader.skipType(tag & 7); @@ -1760,135 +1826,146 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies a BigQueryDestination message. * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + BigQueryDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BigQueryDestination) return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); - } + var message = new $root.google.cloud.asset.v1.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1.BigQueryDestination} message BigQueryDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + BigQueryDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + object.dataset = ""; + object.table = ""; + object.force = false; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this BigQueryDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.BigQueryDestination * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + BigQueryDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return BigQueryDestination; })(); - v1.TimeWindow = (function() { + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.TemporalAsset = (function() { /** - * Properties of a TimeWindow. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset */ /** - * Constructs a new TimeWindow. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set */ - function TimeWindow(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1896,88 +1973,101 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - TimeWindow.prototype.startTime = null; + TemporalAsset.prototype.window = null; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - TimeWindow.prototype.endTime = null; + TemporalAsset.prototype.deleted = false; /** - * Creates a new TimeWindow instance using the specified properties. + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset * @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) { + TemporalAsset.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.asset.v1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1988,129 +2078,135 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset * @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) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @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) { + TemporalAsset.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 (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); if (error) - return "startTime." + error; + return "window." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); if (error) - return "endTime." + error; + return "asset." + error; } return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); } return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.window = null; + object.deleted = false; + object.asset = 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); + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.TemporalAsset * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return TemporalAsset; })(); - v1.Asset = (function() { + v1.TimeWindow = (function() { /** - * Properties of an Asset. + * Properties of a TimeWindow. * @memberof google.cloud.asset.v1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime */ /** - * Constructs a new Asset. + * Constructs a new TimeWindow. * @memberof google.cloud.asset.v1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set */ - function Asset(properties) { + function TimeWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2118,12 +2214,234 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1.Asset + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1.TimeWindow * @instance */ - Asset.prototype.name = ""; + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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 && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("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.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; /** * Asset assetType. @@ -11090,102 +11408,639 @@ }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * 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 && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("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 {string} + * @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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + 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; + 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; + } + 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; + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.additionalBindings = []; + object.pattern = []; 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); + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11193,88 +12048,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -11285,96 +12140,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + 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 CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return ResourceReference; })(); return api; @@ -16216,6 +17071,7 @@ * @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 */ /** @@ -16274,6 +17130,14 @@ */ 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 @@ -16309,6 +17173,8 @@ 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 && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -16360,6 +17226,9 @@ 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; @@ -16416,6 +17285,11 @@ 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; }; @@ -16449,6 +17323,11 @@ 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; }; @@ -16472,6 +17351,7 @@ 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; @@ -16486,6 +17366,8 @@ 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; }; @@ -16516,6 +17398,8 @@ * @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 */ /** @@ -16528,6 +17412,7 @@ */ 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) @@ -16590,6 +17475,22 @@ */ 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 @@ -16629,6 +17530,14 @@ 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 && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -16686,6 +17595,19 @@ 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; @@ -16760,6 +17682,27 @@ 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; }; @@ -16821,6 +17764,44 @@ 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; }; @@ -16837,8 +17818,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; @@ -16846,6 +17829,7 @@ 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; @@ -16864,6 +17848,13 @@ 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; }; @@ -17892,8 +18883,8 @@ * @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 {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo */ /** @@ -17946,20 +18937,20 @@ MethodOptions.prototype[".google.api.http"] = null; /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature * @memberof google.protobuf.MethodOptions * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo * @memberof google.protobuf.MethodOptions * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; /** * Creates a new MethodOptions instance using the specified properties. @@ -18047,14 +19038,14 @@ case 72295728: message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; - case 1049: - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.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; @@ -18116,11 +19107,6 @@ if (error) return ".google.api.http." + error; } - 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; - } if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; @@ -18128,6 +19114,11 @@ 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; }; @@ -18174,11 +19165,6 @@ 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.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"]); - } if (object[".google.api.methodSignature"]) { if (!Array.isArray(object[".google.api.methodSignature"])) throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); @@ -18186,6 +19172,11 @@ 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; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 4244094a8a8..054f6ece9b3 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -13,17 +13,24 @@ "java_multiple_files": true, "java_outer_classname": "AssetProto", "java_package": "com.google.cloud.asset.v1", - "php_namespace": "Google\\Cloud\\Asset\\V1" + "php_namespace": "Google\\Cloud\\Asset\\V1", + "cc_enable_arenas": true }, "nested": { "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, "methods": { "ExportAssets": { "requestType": "ExportAssetsRequest", "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v1/{parent=*/*}:exportAssets", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.ExportAssetsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.ExportAssetsRequest" } }, "BatchGetAssetsHistory": { @@ -39,7 +46,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } }, "readTime": { "type": "google.protobuf.Timestamp", @@ -56,7 +67,10 @@ }, "outputConfig": { "type": "OutputConfig", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -76,7 +90,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } }, "assetNames": { "rule": "repeated", @@ -85,11 +103,17 @@ }, "contentType": { "type": "ContentType", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "readTimeWindow": { "type": "TimeWindow", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -106,7 +130,8 @@ "oneofs": { "destination": { "oneof": [ - "gcsDestination" + "gcsDestination", + "bigqueryDestination" ] } }, @@ -114,6 +139,10 @@ "gcsDestination": { "type": "GcsDestination", "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 } } }, @@ -121,7 +150,8 @@ "oneofs": { "objectUri": { "oneof": [ - "uri" + "uri", + "uriPrefix" ] } }, @@ -129,6 +159,32 @@ "uri": { "type": "string", "id": 1 + }, + "uriPrefix": { + "type": "string", + "id": 2 + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 } } }, @@ -136,7 +192,9 @@ "values": { "CONTENT_TYPE_UNSPECIFIED": 0, "RESOURCE": 1, - "IAM_POLICY": 2 + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5 } }, "TemporalAsset": { @@ -168,6 +226,10 @@ } }, "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, "fields": { "name": { "type": "string", @@ -844,7 +906,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ClientProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -952,6 +1014,74 @@ "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" + }, + "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 + } + }, + "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 + } + } } } }, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index 552ea2f983a..5817bae3c8a 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -268,9 +268,9 @@ class AssetServiceClient { * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * @param {string[]} [request.assetTypes] * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types. * @param {number} [request.contentType] * Asset content type. If not specified, no content but the asset name will be @@ -399,7 +399,7 @@ class AssetServiceClient { * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id")", or a project number (such as "projects/12345"). * @param {number} request.contentType - * Required. The content type. + * Optional. The content type. * * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} * @param {Object} request.readTimeWindow @@ -416,7 +416,8 @@ class AssetServiceClient { * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. * See [Resource * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + * and [Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) * for more info. * * The request becomes a no-op if the asset name list is empty, and the max diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js index 68ce8edc2e2..e03bca4e8a7 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js @@ -35,9 +35,9 @@ * * @property {string[]} assetTypes * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types. * * @property {number} contentType @@ -97,14 +97,15 @@ const ExportAssetsResponse = { * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. * See [Resource * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) + * and [Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) * for more info. * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. * * @property {number} contentType - * Required. The content type. + * Optional. The content type. * * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} * @@ -150,6 +151,14 @@ const BatchGetAssetsHistoryResponse = { * * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1.GcsDestination} * + * @property {Object} bigqueryDestination + * Destination on BigQuery. The output table stores the fields in asset + * proto as columns in BigQuery. The resource/iam_policy field is converted + * to a record with each field to a column, except metadata to a single JSON + * string. + * + * This object should have the same structure as [BigQueryDestination]{@link google.cloud.asset.v1.BigQueryDestination} + * * @typedef OutputConfig * @memberof google.cloud.asset.v1 * @see [google.cloud.asset.v1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} @@ -168,6 +177,17 @@ const OutputConfig = { * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) * for more information. * + * @property {string} uriPrefix + * The uri prefix of all generated Cloud Storage objects. For example: + * "gs://bucket_name/object_name_prefix". Each object uri is in format: + * "gs://bucket_name/object_name_prefix// and only + * contains assets for that type. starts from 0. For example: + * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + * the first shard of output objects containing all + * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + * returned if file with the same name "gs://bucket_name/object_name_prefix" + * already exists. + * * @typedef GcsDestination * @memberof google.cloud.asset.v1 * @see [google.cloud.asset.v1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} @@ -176,6 +196,34 @@ const GcsDestination = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * A BigQuery destination. + * + * @property {string} dataset + * Required. The BigQuery dataset in format + * "projects/projectId/datasets/datasetId", to which the snapshot result + * should be exported. If this dataset does not exist, the export call returns + * an error. + * + * @property {string} table + * Required. The BigQuery table to which the snapshot result should be + * written. If this table does not exist, a new table with the given name + * will be created. + * + * @property {boolean} force + * If the destination table already exists and this flag is `TRUE`, the + * table will be overwritten by the contents of assets snapshot. If the flag + * is not set and the destination table already exists, the export call + * returns an error. + * + * @typedef BigQueryDestination + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.BigQueryDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const BigQueryDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Asset content type. * @@ -197,5 +245,15 @@ const ContentType = { /** * The actual IAM policy set on a resource. */ - IAM_POLICY: 2 + IAM_POLICY: 2, + + /** + * The Cloud Organization Policy set on an asset. + */ + ORG_POLICY: 4, + + /** + * The Cloud Access context mananger Policy set on an asset. + */ + ACCESS_POLICY: 5 }; \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 46f7c48eff6..d7350492b46 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-10-01T11:09:07.207764Z", + "updateTime": "2019-10-12T11:08:05.446789Z", "sources": [ { "generator": { "name": "artman", - "version": "0.37.1", - "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" + "version": "0.39.0", + "dockerImage": "googleapis/artman@sha256:72554d0b3bdc0b4ac7d6726a6a606c00c14b454339037ed86be94574fb05d9f3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ce3c574d1266026cebea3a893247790bd68191c2", - "internalRef": "272147209" + "sha": "af8dd2c1750558b538eaa6bdaa3bc899079533ee", + "internalRef": "274260771" } }, { From beb78a24106f4c4923f7a848ce199fe4d3e6765b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2019 11:45:04 -0700 Subject: [PATCH 138/429] chore: release 1.4.0 (#204) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-asset/package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index a987552c3ff..460b9a8046b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,19 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.4.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.3.0...v1.4.0) (2019-10-12) + + +### Features + +* .d.ts for protos ([#197](https://www.github.com/googleapis/nodejs-asset/issues/197)) ([8f639cc](https://www.github.com/googleapis/nodejs-asset/commit/8f639cc1243bda24a83dd1005370a52eecd48654)) +* add BigQuery destination and proto types ([#206](https://www.github.com/googleapis/nodejs-asset/issues/206)) ([3834c36](https://www.github.com/googleapis/nodejs-asset/commit/3834c36ae39f4f0d98b03c2163ea92fccd51fc2f)) + + +### Bug Fixes + +* use compatible version of google-gax ([332323f](https://www.github.com/googleapis/nodejs-asset/commit/332323ff561c8d7fa23b3344e00226defb51d435)) + ## [1.3.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.2.1...v1.3.0) (2019-09-16) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b91677b4f7c..c358824a497 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.3.0", + "version": "1.4.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { From 0465c0edd35f03be02f369d60143238cd55f9221 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 21 Oct 2019 18:14:54 -0700 Subject: [PATCH 139/429] fix(deps): bump google-gax to 1.7.5 (#208) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c358824a497..1882ed7ca44 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -41,7 +41,7 @@ "predocs-test": "npm run docs" }, "dependencies": { - "google-gax": "^1.6.3", + "google-gax": "^1.7.5", "protobufjs": "^6.8.0" }, "devDependencies": { From e62f535908d4a0a5dbe819ed2cb48bb881737f14 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:38:19 -0700 Subject: [PATCH 140/429] chore: release 1.4.1 (#209) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 460b9a8046b..dfdfa6054cf 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.4.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.4.0...v1.4.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#208](https://www.github.com/googleapis/nodejs-asset/issues/208)) ([3803966](https://www.github.com/googleapis/nodejs-asset/commit/380396657e63cd69778eb42868149f5315dad69d)) + ## [1.4.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.3.0...v1.4.0) (2019-10-12) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1882ed7ca44..ee22993b6ef 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.4.0", + "version": "1.4.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index e9fe60cceab..e0bc8a78456 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.3.0", + "@google-cloud/asset": "^1.4.1", "@google-cloud/storage": "^3.0.0", "uuid": "^3.3.2", "yargs": "^14.0.0" From 4f9f2b13565f65d3c061fb1347eadcf9ed14a8e4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 5 Nov 2019 11:40:27 -0800 Subject: [PATCH 141/429] chore: exclude gapic files from code coverage (#214) --- packages/google-cloud-asset/.nycrc | 1 - packages/google-cloud-asset/synth.metadata | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index 23e322204ec..367688844eb 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -10,7 +10,6 @@ "**/docs", "**/samples", "**/scripts", - "**/src/**/v*/**/*.js", "**/protos", "**/test", ".jsdoc.js", diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index d7350492b46..a2faff90171 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-10-12T11:08:05.446789Z", + "updateTime": "2019-11-05T12:08:21.092666Z", "sources": [ { "generator": { "name": "artman", - "version": "0.39.0", - "dockerImage": "googleapis/artman@sha256:72554d0b3bdc0b4ac7d6726a6a606c00c14b454339037ed86be94574fb05d9f3" + "version": "0.41.0", + "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "af8dd2c1750558b538eaa6bdaa3bc899079533ee", - "internalRef": "274260771" + "sha": "8c6569ced063c08a48272de2e887860d0c40d388", + "internalRef": "278552094" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ], From c40bf05a371f95c3d5db512030d0e12fe6b42313 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 8 Nov 2019 05:59:45 +0200 Subject: [PATCH 142/429] fix(deps): update dependency @google-cloud/storage to v4 (#207) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index e0bc8a78456..cc7ff1bf9a2 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/asset": "^1.4.1", - "@google-cloud/storage": "^3.0.0", + "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^14.0.0" }, From c770b105c537bef78f70423ae73027cb9b6b74c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 13 Nov 2019 11:49:29 -0800 Subject: [PATCH 143/429] fix: import long into proto ts declaration file (#218) --- packages/google-cloud-asset/protos/protos.d.ts | 1 + .../src/v1/doc/google/iam/v1/doc_policy.js | 11 ++++++----- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 11 ++++++----- .../src/v1p2beta1/doc/google/iam/v1/doc_policy.js | 11 ++++++----- packages/google-cloud-asset/synth.metadata | 10 +++++----- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 70a427e280f..b65b6664197 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1,3 +1,4 @@ +import * as Long from "long"; import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index 57db8df60b1..606cdf98cad 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -82,12 +82,13 @@ * * Operations affecting conditional bindings must specify version 3. This can * be either setting a conditional policy, modifying a conditional binding, - * or removing a conditional binding from the stored conditional policy. + * or removing a binding (conditional or unconditional) from the stored + * conditional policy. * Operations on non-conditional policies may specify any valid value or * leave the field unset. * - * If no etag is provided in the call to `setIamPolicy`, any version - * compliance checks on the incoming and/or stored policy is skipped. + * If no etag is provided in the call to `setIamPolicy`, version compliance + * checks against the stored policy is skipped. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. Optionally may specify a @@ -107,8 +108,8 @@ * * If no `etag` is provided in the call to `setIamPolicy`, then the existing * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if either of incoming or stored policy - * does not meet the version requirements. + * 'setIamPolicy' will not fail even if the incoming policy version does not + * meet the requirements for modifying the stored policy. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 57db8df60b1..606cdf98cad 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -82,12 +82,13 @@ * * Operations affecting conditional bindings must specify version 3. This can * be either setting a conditional policy, modifying a conditional binding, - * or removing a conditional binding from the stored conditional policy. + * or removing a binding (conditional or unconditional) from the stored + * conditional policy. * Operations on non-conditional policies may specify any valid value or * leave the field unset. * - * If no etag is provided in the call to `setIamPolicy`, any version - * compliance checks on the incoming and/or stored policy is skipped. + * If no etag is provided in the call to `setIamPolicy`, version compliance + * checks against the stored policy is skipped. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. Optionally may specify a @@ -107,8 +108,8 @@ * * If no `etag` is provided in the call to `setIamPolicy`, then the existing * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if either of incoming or stored policy - * does not meet the version requirements. + * 'setIamPolicy' will not fail even if the incoming policy version does not + * meet the requirements for modifying the stored policy. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js index 57db8df60b1..606cdf98cad 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js @@ -82,12 +82,13 @@ * * Operations affecting conditional bindings must specify version 3. This can * be either setting a conditional policy, modifying a conditional binding, - * or removing a conditional binding from the stored conditional policy. + * or removing a binding (conditional or unconditional) from the stored + * conditional policy. * Operations on non-conditional policies may specify any valid value or * leave the field unset. * - * If no etag is provided in the call to `setIamPolicy`, any version - * compliance checks on the incoming and/or stored policy is skipped. + * If no etag is provided in the call to `setIamPolicy`, version compliance + * checks against the stored policy is skipped. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. Optionally may specify a @@ -107,8 +108,8 @@ * * If no `etag` is provided in the call to `setIamPolicy`, then the existing * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if either of incoming or stored policy - * does not meet the version requirements. + * 'setIamPolicy' will not fail even if the incoming policy version does not + * meet the requirements for modifying the stored policy. * * @typedef Policy * @memberof google.iam.v1 diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a2faff90171..df06d4dc9f1 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-05T12:08:21.092666Z", + "updateTime": "2019-11-12T12:08:33.032369Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8c6569ced063c08a48272de2e887860d0c40d388", - "internalRef": "278552094" + "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", + "internalRef": "279774957" } }, { From aa18ad25d7c4c7ab043274051536086158cd9c25 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 13 Nov 2019 11:58:24 -0800 Subject: [PATCH 144/429] fix(docs): snippets are now replaced in jsdoc comments (#217) --- packages/google-cloud-asset/.jsdoc.js | 3 ++- packages/google-cloud-asset/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index d44d529b125..04cf2c09117 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -26,7 +26,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { excludePattern: '(^|\\/|\\\\)[._]', diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ee22993b6ef..7effb58b8b9 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -53,6 +53,7 @@ "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.0.0", From 2be968a7a0d1518e3d9e399912e3023760579785 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2019 13:40:06 -0800 Subject: [PATCH 145/429] chore: release 1.4.2 (#215) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 9 +++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index dfdfa6054cf..6d09ae1bcd8 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.4.2](https://www.github.com/googleapis/nodejs-asset/compare/v1.4.1...v1.4.2) (2019-11-13) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/storage to v4 ([#207](https://www.github.com/googleapis/nodejs-asset/issues/207)) ([1b67b50](https://www.github.com/googleapis/nodejs-asset/commit/1b67b5022ee6cdf59e51614e911c5e45e00efdf2)) +* import long into proto ts declaration file ([#218](https://www.github.com/googleapis/nodejs-asset/issues/218)) ([00bc96e](https://www.github.com/googleapis/nodejs-asset/commit/00bc96e2944444b8ef5f61251202f42f5d54db72)) +* **docs:** snippets are now replaced in jsdoc comments ([#217](https://www.github.com/googleapis/nodejs-asset/issues/217)) ([bec38ad](https://www.github.com/googleapis/nodejs-asset/commit/bec38ad74dc50251cfdc5f4ab1c37e7d3ab9704f)) + ### [1.4.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.4.0...v1.4.1) (2019-10-22) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 7effb58b8b9..fa8586842a1 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.4.1", + "version": "1.4.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index cc7ff1bf9a2..8c8e9942b56 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.4.1", + "@google-cloud/asset": "^1.4.2", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^14.0.0" From a16a48b3ecdb98d8bb13a241b5f1f05d98cfb554 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 13 Nov 2019 15:21:57 -0800 Subject: [PATCH 146/429] chore: bump release level to beta (#219) --- packages/google-cloud-asset/.repo-metadata.json | 4 ++-- packages/google-cloud-asset/README.md | 9 +++++---- packages/google-cloud-asset/protos/protos.d.ts | 14 ++++++++++++++ packages/google-cloud-asset/synth.metadata | 6 +++--- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index 6af8ba7644a..e36b2288b3f 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -4,10 +4,10 @@ "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", "client_documentation": "https://googleapis.dev/nodejs/asset/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", - "release_level": "alpha", + "release_level": "beta", "language": "nodejs", "repo": "googleapis/nodejs-asset", "distribution_name": "@google-cloud/asset", "api_id": "cloudasset.googleapis.com", "requires_billing": true -} \ No newline at end of file +} diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index b6dbc7488fc..145e26c615e 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -4,7 +4,7 @@ # [Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) -[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![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/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) @@ -113,10 +113,11 @@ 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 **alpha**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index b65b6664197..523d31f0de7 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1,3 +1,17 @@ +// Copyright 2019 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 * as $protobuf from "protobufjs"; /** Namespace google. */ diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index df06d4dc9f1..c591b2bbd56 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-12T12:08:33.032369Z", + "updateTime": "2019-11-13T21:35:26.100161Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", - "internalRef": "279774957" + "sha": "dec8fd8ea5dc464496606189ba4b8949188639c8", + "internalRef": "280225437" } }, { From 2a3e67be4a8461b480c1629b71d4bf3fbd324a6f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 15 Nov 2019 11:55:25 -0800 Subject: [PATCH 147/429] docs: add license header --- packages/google-cloud-asset/protos/protos.js | 14 ++++++++++++++ packages/google-cloud-asset/synth.metadata | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 4e86a4a736d..246dcac4b8c 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -1,3 +1,17 @@ +// Copyright 2019 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 */ diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index c591b2bbd56..ed90e39cb74 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-13T21:35:26.100161Z", + "updateTime": "2019-11-15T12:08:43.646454Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dec8fd8ea5dc464496606189ba4b8949188639c8", - "internalRef": "280225437" + "sha": "f6808ff4e8b966cd571e99279d4a2780ed97dff2", + "internalRef": "280581337" } }, { From f5dd5bafad8f9c380a2e2e1029bc9139672aa93f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 18 Nov 2019 21:49:57 +0100 Subject: [PATCH 148/429] fix(deps): update dependency yargs to v15 (#222) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 8c8e9942b56..f146b72c613 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -18,7 +18,7 @@ "@google-cloud/asset": "^1.4.2", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", - "yargs": "^14.0.0" + "yargs": "^15.0.0" }, "devDependencies": { "chai": "^4.2.0", From e667c80a4fb3262ed28aa5a134f1f3cda5177b27 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 22 Nov 2019 13:01:22 -0800 Subject: [PATCH 149/429] feat: add plural and singular resource descriptor --- .../google-cloud-asset/protos/protos.d.ts | 15 ++++ packages/google-cloud-asset/protos/protos.js | 90 ++++++++++++++++++- .../google-cloud-asset/protos/protos.json | 14 +++ packages/google-cloud-asset/synth.metadata | 10 +-- 4 files changed, 123 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 523d31f0de7..4e8b482dda2 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -4893,6 +4893,12 @@ export namespace google { /** ResourceDescriptor history */ history?: (google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); } /** Represents a ResourceDescriptor. */ @@ -4916,6 +4922,12 @@ export namespace google { /** ResourceDescriptor history. */ public history: 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 @@ -6652,6 +6664,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 246dcac4b8c..3b85834d61e 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -11741,6 +11741,8 @@ * @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 */ /** @@ -11791,6 +11793,22 @@ */ 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 @@ -11824,6 +11842,10 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); if (message.history != null && message.hasOwnProperty("history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -11872,6 +11894,12 @@ 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; @@ -11929,6 +11957,12 @@ 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; }; @@ -11969,6 +12003,10 @@ message.history = 2; break; } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); return message; }; @@ -11991,6 +12029,8 @@ 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; @@ -12003,6 +12043,10 @@ 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; }; @@ -16417,6 +16461,7 @@ * @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 */ /** @@ -16429,6 +16474,7 @@ */ 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) @@ -16603,6 +16649,14 @@ */ 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 @@ -16670,6 +16724,9 @@ 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; }; @@ -16769,6 +16826,11 @@ 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; @@ -16879,6 +16941,15 @@ 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; }; @@ -16956,6 +17027,16 @@ 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; }; @@ -16972,8 +17053,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -17041,6 +17124,11 @@ 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; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 054f6ece9b3..ac7d32b0e0b 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1036,6 +1036,12 @@ "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, @@ -1059,6 +1065,14 @@ "history": { "type": "History", "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 } }, "nested": { diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index ed90e39cb74..7749078d126 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-15T12:08:43.646454Z", + "updateTime": "2019-11-19T12:09:07.531125Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.1", - "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" + "version": "0.42.1", + "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f6808ff4e8b966cd571e99279d4a2780ed97dff2", - "internalRef": "280581337" + "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", + "internalRef": "281088257" } }, { From e899d5dc86e1e67fdd3c762ed05db29b93e46b1a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Nov 2019 08:54:40 -0800 Subject: [PATCH 150/429] chore: update license headers --- .../google-cloud-asset/samples/quickstart.js | 27 +++++++++---------- .../samples/test/sample.test.js | 27 +++++++++---------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index c13fb2b9912..20103990aa3 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -1,17 +1,16 @@ -/** - * Copyright 2018, 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. - */ +// Copyright 2018 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'; diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 7253495cbd1..a7d73beb5e7 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -1,17 +1,16 @@ -/** - * Copyright 2018, 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. - */ +// Copyright 2018 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'; From b69825f6eeb7de272e9fc238b6269863e51956be Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 6 Dec 2019 11:38:04 -0800 Subject: [PATCH 151/429] feat: adds CreateFeed, GetFeed, ListFeeds, UpdateFeed, DeleteFeed methods --- .../google/cloud/asset/v1/asset_service.proto | 186 ++ .../protos/google/cloud/asset/v1/assets.proto | 10 +- .../google-cloud-asset/protos/protos.d.ts | 1214 ++++++- packages/google-cloud-asset/protos/protos.js | 2819 +++++++++++++++-- .../google-cloud-asset/protos/protos.json | 194 ++ .../src/v1/asset_service_client.js | 359 ++- .../src/v1/asset_service_client_config.json | 25 + .../cloud/asset/v1/doc_asset_service.js | 206 ++ .../doc/google/cloud/asset/v1/doc_assets.js | 8 + .../src/v1/doc/google/protobuf/doc_empty.js | 34 + .../v1/doc/google/protobuf/doc_field_mask.js | 228 ++ packages/google-cloud-asset/synth.metadata | 6 +- packages/google-cloud-asset/test/gapic-v1.js | 298 ++ 13 files changed, 5134 insertions(+), 453 deletions(-) create mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js create mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 33dde9cd365..6566d03995f 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -66,6 +66,49 @@ service AssetService { get: "/v1/{parent=*/*}:batchGetAssetsHistory" }; } + + // Creates a feed in a parent project/folder/organization to listen to its + // asset updates. + rpc CreateFeed(CreateFeedRequest) returns (Feed) { + option (google.api.http) = { + post: "/v1/{parent=*/*}/feeds" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details about an asset feed. + rpc GetFeed(GetFeedRequest) returns (Feed) { + option (google.api.http) = { + get: "/v1/{name=*/*/feeds/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all asset feeds in a parent project/folder/organization. + rpc ListFeeds(ListFeedsRequest) returns (ListFeedsResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/feeds" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an asset feed configuration. + rpc UpdateFeed(UpdateFeedRequest) returns (Feed) { + option (google.api.http) = { + patch: "/v1/{feed.name=*/*/feeds/*}" + body: "*" + }; + option (google.api.method_signature) = "feed"; + } + + // Deletes an asset feed. + rpc DeleteFeed(DeleteFeedRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=*/*/feeds/*}" + }; + option (google.api.method_signature) = "name"; + } } // Export asset request. @@ -158,6 +201,82 @@ message BatchGetAssetsHistoryResponse { repeated TemporalAsset assets = 1; } +// Create asset feed request. +message CreateFeedRequest { + // Required. The name of the project/folder/organization where this feed + // should be created in. It can only be an organization number (such as + // "organizations/123"), a folder number (such as "folders/123"), a project ID + // (such as "projects/my-project-id")", or a project number (such as + // "projects/12345"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. This is the client-assigned asset feed identifier and it needs to + // be unique under a specific parent project/folder/organization. + string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The feed details. The field `name` must be empty and it will be generated + // in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Get asset feed request. +message GetFeedRequest { + // Required. The name of the Feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } + ]; +} + +// List asset feeds request. +message ListFeedsRequest { + // Required. The parent project/folder/organization whose feeds are to be + // listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; +} + +message ListFeedsResponse { + // A list of feeds. + repeated Feed feeds = 1; +} + +// Update asset feed request. +message UpdateFeedRequest { + // Required. The new values of feed details. It must match an existing feed and the + // field `name` must be in the format of: + // projects/project_number/feeds/feed_id or + // folders/folder_number/feeds/feed_id or + // organizations/organization_number/feeds/feed_id. + Feed feed = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only updates the `feed` fields indicated by this mask. + // The field mask must not be empty, and it must not contain fields that + // are immutable or only set by the server. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +message DeleteFeedRequest { + // Required. The name of the feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } + ]; +} + // Output configuration for export assets destination. message OutputConfig { // Asset export destination. @@ -217,6 +336,13 @@ message BigQueryDestination { bool force = 3; } +// A Cloud Pubsub destination. +message PubsubDestination { + // The name of the Cloud Pub/Sub topic to publish to. + // For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + string topic = 1; +} + // Asset content type. enum ContentType { // Unspecified content type. @@ -234,3 +360,63 @@ enum ContentType { // The Cloud Access context mananger Policy set on an asset. ACCESS_POLICY = 5; } + +// Output configuration for asset feed destination. +message FeedOutputConfig { + // Asset feed destination. + oneof destination { + // Destination on Cloud Pubsub. + PubsubDestination pubsub_destination = 1; + } +} + +// An asset feed used to export asset updates to a destinations. +// An asset feed filter controls what updates are exported. +// The asset feed must be created within a project, organization, or +// folder. Supported destinations are: +// Cloud Pub/Sub topics. +message Feed { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Feed" + pattern: "projects/{project}/feeds/{feed}" + pattern: "folders/{folder}/feeds/{feed}" + pattern: "organizations/{organization}/feeds/{feed}" + history: ORIGINALLY_SINGLE_PATTERN + }; + + // Required. The format will be + // projects/{project_number}/feeds/{client-assigned_feed_identifier} or + // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + // organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + // + // The client-assigned feed identifier must be unique within the parent + // project/folder/organization. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of the full names of the assets to receive updates. You must specify + // either or both of asset_names and asset_types. Only asset updates matching + // specified asset_names and asset_types are exported to the feed. For + // example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more info. + repeated string asset_names = 2; + + // A list of types of the assets to receive updates. You must specify either + // or both of asset_names and asset_types. Only asset updates matching + // specified asset_names and asset_types are exported to the feed. + // For example: + // "compute.googleapis.com/Disk" See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name and + // type will be returned. + ContentType content_type = 4; + + // Required. Feed output configuration defining where the asset updates are + // published to. + FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index e689b761822..6a5c8cb8cb2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -17,12 +17,12 @@ syntax = "proto3"; package google.cloud.asset.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/iam/v1/policy.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -79,6 +79,14 @@ message Asset { // Representation of the actual Cloud IAM policy set on a cloud resource. For // each resource, there must be at most one Cloud IAM policy set on it. google.iam.v1.Policy iam_policy = 4; + + // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, + // represented as a list of relative resource names. Ancestry path starts with + // the closest CRM ancestor and ends at root. If the asset is a CRM + // project/folder/organization, this starts from the asset itself. + // + // Example: ["projects/123456789", "folders/5432", "organizations/1234"] + repeated string ancestors = 10; } // Representation of a cloud resource. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 4e8b482dda2..0806c5416ce 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -73,6 +73,76 @@ export namespace google { * @returns Promise */ public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise + */ + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise + */ + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise + */ + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; } namespace AssetService { @@ -90,6 +160,41 @@ export namespace google { * @param [response] BatchGetAssetsHistoryResponse */ type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse + */ + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of an ExportAssetsRequest. */ @@ -500,241 +605,799 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + /** CreateFeedRequest parent */ + parent?: (string|null); - /** OutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { /** - * Constructs a new OutputConfig. + * Constructs a new CreateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IOutputConfig); + constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + /** CreateFeedRequest parent. */ + public parent: string; - /** OutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** CreateFeedRequest feedId. */ + public feedId: string; - /** OutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns CreateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns CreateFeedRequest * @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.asset.v1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateFeedRequest; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns CreateFeedRequest * @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.asset.v1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateFeedRequest; /** - * Verifies an OutputConfig message. + * Verifies a CreateFeedRequest 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns CreateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this CreateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** GetFeedRequest name */ + name?: (string|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { /** - * Constructs a new GcsDestination. + * Constructs a new GetFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; + constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); - /** GcsDestination uriPrefix. */ - public uriPrefix: string; - - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** GetFeedRequest name. */ + public name: string; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns GetFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns GetFeedRequest * @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.asset.v1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetFeedRequest; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns GetFeedRequest * @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.asset.v1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetFeedRequest; /** - * Verifies a GcsDestination message. + * Verifies a GetFeedRequest 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns GetFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this GetFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { - - /** BigQueryDestination dataset */ - dataset?: (string|null); - - /** BigQueryDestination table */ - table?: (string|null); + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { - /** BigQueryDestination force */ - force?: (boolean|null); + /** ListFeedsRequest parent */ + parent?: (string|null); } - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { /** - * Constructs a new BigQueryDestination. + * Constructs a new ListFeedsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; + constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); - /** BigQueryDestination table. */ - public table: string; - - /** BigQueryDestination force. */ - public force: boolean; + /** ListFeedsRequest parent. */ + public parent: string; /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BigQueryDestination instance + * @returns ListFeedsRequest instance */ - public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; + public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsRequest + * @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.asset.v1.ListFeedsRequest; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsRequest + * @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.asset.v1.ListFeedsRequest; + + /** + * Verifies a ListFeedsRequest 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 ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { + + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1.IFeed[]|null); + } + + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { + + /** + * Constructs a new ListFeedsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); + + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1.IFeed[]; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsResponse + * @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.asset.v1.ListFeedsResponse; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsResponse + * @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.asset.v1.ListFeedsResponse; + + /** + * Verifies a ListFeedsResponse 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 ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { + + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); + + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { + + /** + * Constructs a new UpdateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); + + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); + + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFeedRequest + * @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.asset.v1.UpdateFeedRequest; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFeedRequest + * @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.asset.v1.UpdateFeedRequest; + + /** + * Verifies an UpdateFeedRequest 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { + + /** DeleteFeedRequest name */ + name?: (string|null); + } + + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { + + /** + * Constructs a new DeleteFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); + + /** DeleteFeedRequest name. */ + public name: string; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFeedRequest + * @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.asset.v1.DeleteFeedRequest; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFeedRequest + * @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.asset.v1.DeleteFeedRequest; + + /** + * Verifies a DeleteFeedRequest 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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @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.asset.v1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @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.asset.v1.OutputConfig; + + /** + * Verifies an OutputConfig 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination uriPrefix. */ + public uriPrefix: string; + + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination force */ + force?: (boolean|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination force. */ + public force: boolean; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; /** * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. @@ -742,59 +1405,149 @@ export namespace google { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @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.asset.v1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @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.asset.v1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BigQueryDestination + * @returns PubsubDestination * @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.asset.v1.BigQueryDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PubsubDestination; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BigQueryDestination + * @returns PubsubDestination * @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.asset.v1.BigQueryDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PubsubDestination; /** - * Verifies a BigQueryDestination message. + * Verifies a PubsubDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BigQueryDestination + * @returns PubsubDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BigQueryDestination to JSON. + * Converts this PubsubDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -809,6 +1562,213 @@ export namespace google { ACCESS_POLICY = 5 } + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { + + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + } + + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { + + /** + * Constructs a new FeedOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); + + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedOutputConfig + * @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.asset.v1.FeedOutputConfig; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedOutputConfig + * @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.asset.v1.FeedOutputConfig; + + /** + * Verifies a FeedOutputConfig 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 FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Feed. */ + interface IFeed { + + /** Feed name */ + name?: (string|null); + + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + } + + /** Represents a Feed. */ + class Feed implements IFeed { + + /** + * Constructs a new Feed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IFeed); + + /** Feed name. */ + public name: string; + + /** Feed assetNames. */ + public assetNames: string[]; + + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: google.cloud.asset.v1.ContentType; + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + + /** + * Creates a new Feed instance using the specified properties. + * @param [properties] Properties to set + * @returns Feed instance + */ + public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feed + * @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.asset.v1.Feed; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feed + * @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.asset.v1.Feed; + + /** + * Verifies a Feed 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 Feed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a TemporalAsset. */ interface ITemporalAsset { @@ -1021,6 +1981,9 @@ export namespace google { /** Asset iamPolicy */ iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); } /** Represents an Asset. */ @@ -1044,6 +2007,9 @@ export namespace google { /** Asset iamPolicy. */ public iamPolicy?: (google.iam.v1.IPolicy|null); + /** Asset ancestors. */ + public ancestors: string[]; + /** * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 3b85834d61e..7827dfb3ddd 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -164,6 +164,171 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1.CreateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1.GetFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "GetFeed" }); + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListFeedsResponse} [response] ListFeedsResponse + */ + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1.ListFeedsRequest, $root.google.cloud.asset.v1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1.UpdateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); @@ -1230,25 +1395,26 @@ return BatchGetAssetsHistoryResponse; })(); - v1.OutputConfig = (function() { + v1.CreateFeedRequest = (function() { /** - * Properties of an OutputConfig. + * Properties of a CreateFeedRequest. * @memberof google.cloud.asset.v1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination - * @property {google.cloud.asset.v1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1.IFeed|null} [feed] CreateFeedRequest feed */ /** - * Constructs a new OutputConfig. + * Constructs a new CreateFeedRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest * @constructor - * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set */ - function OutputConfig(properties) { + function CreateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1256,102 +1422,101 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1.OutputConfig + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.CreateFeedRequest * @instance */ - OutputConfig.prototype.gcsDestination = null; + CreateFeedRequest.prototype.parent = ""; /** - * OutputConfig bigqueryDestination. - * @member {google.cloud.asset.v1.IBigQueryDestination|null|undefined} bigqueryDestination - * @memberof google.cloud.asset.v1.OutputConfig + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1.CreateFeedRequest * @instance */ - OutputConfig.prototype.bigqueryDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateFeedRequest.prototype.feedId = ""; /** - * OutputConfig destination. - * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination - * @memberof google.cloud.asset.v1.OutputConfig + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1.CreateFeedRequest * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateFeedRequest.prototype.feed = null; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig instance + * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + CreateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) - $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && message.hasOwnProperty("feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + CreateFeedRequest.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.asset.v1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.CreateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); + message.feedId = reader.string(); + break; + case 3: + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1362,138 +1527,2035 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a CreateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.CreateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + CreateFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - if (properties.destination === 1) - return "destination: multiple values"; - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.BigQueryDestination.verify(message.bigqueryDestination); - if (error) - return "bigqueryDestination." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); + if (error) + return "feed." + error; } return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + */ + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.CreateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); + } + return message; + }; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.CreateFeedRequest} message CreateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + return object; + }; + + /** + * Converts this CreateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateFeedRequest; + })(); + + v1.GetFeedRequest = (function() { + + /** + * Properties of a GetFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name + */ + + /** + * Constructs a new GetFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest + * @constructor + * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set + */ + function GetFeedRequest(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]]; + } + + /** + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.GetFeedRequest + * @instance + */ + GetFeedRequest.prototype.name = ""; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest instance + */ + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); + }; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.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.asset.v1.GetFeedRequest(); + 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 GetFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFeedRequest.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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + */ + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GetFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.GetFeedRequest} message GetFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFeedRequest.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 GetFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GetFeedRequest + * @instance + * @returns {Object.} JSON object + */ + GetFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetFeedRequest; + })(); + + v1.ListFeedsRequest = (function() { + + /** + * Properties of a ListFeedsRequest. + * @memberof google.cloud.asset.v1 + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent + */ + + /** + * Constructs a new ListFeedsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest + * @constructor + * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set + */ + function ListFeedsRequest(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]]; + } + + /** + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @instance + */ + ListFeedsRequest.prototype.parent = ""; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest instance + */ + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); + }; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.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.asset.v1.ListFeedsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsRequest.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"; + return null; + }; + + /** + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + */ + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListFeedsRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.ListFeedsRequest} message ListFeedsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFeedsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFeedsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFeedsRequest; + })(); + + v1.ListFeedsResponse = (function() { + + /** + * Properties of a ListFeedsResponse. + * @memberof google.cloud.asset.v1 + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds + */ + + /** + * Constructs a new ListFeedsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse + * @constructor + * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set + */ + function ListFeedsResponse(properties) { + this.feeds = []; + 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]]; + } + + /** + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @instance + */ + ListFeedsResponse.prototype.feeds = $util.emptyArray; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse instance + */ + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); + }; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.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.asset.v1.ListFeedsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } + return null; + }; + + /** + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + */ + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListFeedsResponse) + return object; + var message = new $root.google.cloud.asset.v1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1.Feed.fromObject(object.feeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.ListFeedsResponse} message ListFeedsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1.Feed.toObject(message.feeds[j], options); + } + return object; + }; + + /** + * Converts this ListFeedsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFeedsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFeedsResponse; + })(); + + v1.UpdateFeedRequest = (function() { + + /** + * Properties of an UpdateFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + */ + + /** + * Constructs a new UpdateFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest + * @constructor + * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set + */ + function UpdateFeedRequest(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]]; + } + + /** + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.feed = null; + + /** + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest instance + */ + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); + }; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.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.asset.v1.UpdateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feed = $root.google.cloud.asset.v1.Feed.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 UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); + if (error) + return "feed." + 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + */ + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.UpdateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.UpdateFeedRequest} message UpdateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.feed = null; + object.updateMask = null; + } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFeedRequest; + })(); + + v1.DeleteFeedRequest = (function() { + + /** + * Properties of a DeleteFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name + */ + + /** + * Constructs a new DeleteFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest + * @constructor + * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set + */ + function DeleteFeedRequest(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]]; + } + + /** + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @instance + */ + DeleteFeedRequest.prototype.name = ""; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest instance + */ + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); + }; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.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.asset.v1.DeleteFeedRequest(); + 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 DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFeedRequest.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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + */ + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.DeleteFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.DeleteFeedRequest} message DeleteFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFeedRequest.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 DeleteFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteFeedRequest; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.asset.v1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.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.asset.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|"uriPrefix"|undefined} objectUri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.uriPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v1.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1 + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {boolean|null} [force] BigQueryDestination force + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; + + /** + * BigQueryDestination force. + * @member {boolean} force + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.force = false; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && message.hasOwnProperty("dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && message.hasOwnProperty("table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.force != null && message.hasOwnProperty("force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.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.asset.v1.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataset = reader.string(); + break; + case 2: + message.table = reader.string(); + break; + case 3: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.OutputConfig) + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BigQueryDestination) return object; - var message = new $root.google.cloud.asset.v1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); + var message = new $root.google.cloud.asset.v1.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.force = false; } - if (object.bigqueryDestination != null) { - if (typeof object.bigqueryDestination !== "object") - throw TypeError(".google.cloud.asset.v1.OutputConfig.bigqueryDestination: object expected"); - message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.fromObject(object.bigqueryDestination); + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryDestination; + })(); + + v1.PubsubDestination = (function() { + + /** + * Properties of a PubsubDestination. + * @memberof google.cloud.asset.v1 + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic + */ + + /** + * Constructs a new PubsubDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination + * @constructor + * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set + */ + function PubsubDestination(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]]; + } + + /** + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1.PubsubDestination + * @instance + */ + PubsubDestination.prototype.topic = ""; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination instance + */ + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); + }; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.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.asset.v1.PubsubDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubDestination message. + * @function verify + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + */ + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.PubsubDestination) + return object; + var message = new $root.google.cloud.asset.v1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.PubsubDestination * @static - * @param {google.cloud.asset.v1.OutputConfig} message OutputConfig + * @param {google.cloud.asset.v1.PubsubDestination} message PubsubDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + PubsubDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - object.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.toObject(message.bigqueryDestination, options); - if (options.oneofs) - object.destination = "bigqueryDestination"; - } + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this PubsubDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.PubsubDestination * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + PubsubDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return PubsubDestination; })(); - v1.GcsDestination = (function() { + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.FeedOutputConfig = (function() { /** - * Properties of a GcsDestination. + * Properties of a FeedOutputConfig. * @memberof google.cloud.asset.v1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - * @property {string|null} [uriPrefix] GcsDestination uriPrefix + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination */ /** - * Constructs a new GcsDestination. + * Constructs a new FeedOutputConfig. * @memberof google.cloud.asset.v1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig * @constructor - * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set */ - function GcsDestination(properties) { + function FeedOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1501,102 +3563,89 @@ } /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * GcsDestination uriPrefix. - * @member {string} uriPrefix - * @memberof google.cloud.asset.v1.GcsDestination + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @instance */ - GcsDestination.prototype.uriPrefix = ""; + FeedOutputConfig.prototype.pubsubDestination = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GcsDestination objectUri. - * @member {"uri"|"uriPrefix"|undefined} objectUri - * @memberof google.cloud.asset.v1.GcsDestination + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @instance */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new FeedOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination instance + * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig instance */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encode = function encode(message, writer) { + FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + $root.google.cloud.asset.v1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decode = function decode(reader, length) { + FeedOutputConfig.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.asset.v1.GcsDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.FeedOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); - break; - case 2: - message.uriPrefix = reader.string(); + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1607,127 +3656,123 @@ }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsDestination message. + * Verifies a FeedOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsDestination.verify = function verify(message) { + FeedOutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - if (properties.objectUri === 1) - return "objectUri: multiple values"; - properties.objectUri = 1; - if (!$util.isString(message.uriPrefix)) - return "uriPrefix: string expected"; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } } return null; }; /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.GcsDestination) + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.FeedOutputConfig) return object; - var message = new $root.google.cloud.asset.v1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.uriPrefix != null) - message.uriPrefix = String(object.uriPrefix); + var message = new $root.google.cloud.asset.v1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.fromObject(object.pubsubDestination); + } return message; }; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.GcsDestination} message GcsDestination + * @param {google.cloud.asset.v1.FeedOutputConfig} message FeedOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsDestination.toObject = function toObject(message, options) { + FeedOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - object.uriPrefix = message.uriPrefix; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.toObject(message.pubsubDestination, options); if (options.oneofs) - object.objectUri = "uriPrefix"; + object.destination = "pubsubDestination"; } return object; }; /** - * Converts this GcsDestination to JSON. + * Converts this FeedOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @instance * @returns {Object.} JSON object */ - GcsDestination.prototype.toJSON = function toJSON() { + FeedOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsDestination; + return FeedOutputConfig; })(); - v1.BigQueryDestination = (function() { + v1.Feed = (function() { /** - * Properties of a BigQueryDestination. + * Properties of a Feed. * @memberof google.cloud.asset.v1 - * @interface IBigQueryDestination - * @property {string|null} [dataset] BigQueryDestination dataset - * @property {string|null} [table] BigQueryDestination table - * @property {boolean|null} [force] BigQueryDestination force + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig */ /** - * Constructs a new BigQueryDestination. + * Constructs a new Feed. * @memberof google.cloud.asset.v1 - * @classdesc Represents a BigQueryDestination. - * @implements IBigQueryDestination + * @classdesc Represents a Feed. + * @implements IFeed * @constructor - * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set */ - function BigQueryDestination(properties) { + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1735,101 +3780,133 @@ } /** - * BigQueryDestination dataset. - * @member {string} dataset - * @memberof google.cloud.asset.v1.BigQueryDestination + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1.Feed * @instance */ - BigQueryDestination.prototype.dataset = ""; + Feed.prototype.name = ""; /** - * BigQueryDestination table. - * @member {string} table - * @memberof google.cloud.asset.v1.BigQueryDestination + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1.Feed * @instance */ - BigQueryDestination.prototype.table = ""; + Feed.prototype.assetNames = $util.emptyArray; /** - * BigQueryDestination force. - * @member {boolean} force - * @memberof google.cloud.asset.v1.BigQueryDestination + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.Feed * @instance */ - BigQueryDestination.prototype.force = false; + Feed.prototype.assetTypes = $util.emptyArray; /** - * Creates a new BigQueryDestination instance using the specified properties. + * Feed contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.contentType = 0; + + /** + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.feedOutputConfig = null; + + /** + * Creates a new Feed instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination instance + * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Feed} Feed instance */ - BigQueryDestination.create = function create(properties) { - return new BigQueryDestination(properties); + Feed.create = function create(properties) { + return new Feed(properties); }; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encode = function encode(message, writer) { + Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && message.hasOwnProperty("dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.table != null && message.hasOwnProperty("table")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); - if (message.force != null && message.hasOwnProperty("force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + Feed.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decode = function decode(reader, length) { + Feed.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.asset.v1.BigQueryDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Feed(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataset = reader.string(); + message.name = reader.string(); break; case 2: - message.table = reader.string(); + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); break; case 3: - message.force = reader.bool(); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1840,124 +3917,179 @@ }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + Feed.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQueryDestination message. + * Verifies a Feed message. * @function verify - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BigQueryDestination.verify = function verify(message) { + Feed.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1.FeedOutputConfig.verify(message.feedOutputConfig); + if (error) + return "feedOutputConfig." + error; + } return null; }; /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1.Feed} Feed */ - BigQueryDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.BigQueryDestination) + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Feed) return object; - var message = new $root.google.cloud.asset.v1.BigQueryDestination(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.table != null) - message.table = String(object.table); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.asset.v1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.fromObject(object.feedOutputConfig); + } return message; }; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * Creates a plain object from a Feed message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.BigQueryDestination} message BigQueryDestination + * @param {google.cloud.asset.v1.Feed} message Feed * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQueryDestination.toObject = function toObject(message, options) { + Feed.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + } if (options.defaults) { - object.dataset = ""; - object.table = ""; - object.force = false; + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this BigQueryDestination to JSON. + * Converts this Feed to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.Feed * @instance * @returns {Object.} JSON object */ - BigQueryDestination.prototype.toJSON = function toJSON() { + Feed.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BigQueryDestination; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; + return Feed; })(); v1.TemporalAsset = (function() { @@ -2432,6 +4564,7 @@ * @property {string|null} [assetType] Asset assetType * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors */ /** @@ -2443,6 +4576,7 @@ * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set */ function Asset(properties) { + this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2481,6 +4615,14 @@ */ Asset.prototype.iamPolicy = null; + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + /** * Creates a new Asset instance using the specified properties. * @function create @@ -2513,6 +4655,9 @@ $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); return writer; }; @@ -2559,6 +4704,11 @@ case 4: message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -2610,6 +4760,13 @@ if (error) return "iamPolicy." + error; } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } return null; }; @@ -2639,6 +4796,13 @@ throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } return message; }; @@ -2655,6 +4819,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; if (options.defaults) { object.name = ""; object.assetType = ""; @@ -2669,6 +4835,11 @@ object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } return object; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index ac7d32b0e0b..1773e244ac6 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -39,6 +39,48 @@ "options": { "(google.api.http).get": "/v1/{parent=*/*}:batchGetAssetsHistory" } + }, + "CreateFeed": { + "requestType": "CreateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}/feeds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + } + }, + "GetFeed": { + "requestType": "GetFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).get": "/v1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + } + }, + "ListFeeds": { + "requestType": "ListFeedsRequest", + "responseType": "ListFeedsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/feeds", + "(google.api.method_signature)": "parent" + } + }, + "UpdateFeed": { + "requestType": "UpdateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).patch": "/v1/{feed.name=*/*/feeds/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "feed" + } + }, + "DeleteFeed": { + "requestType": "DeleteFeedRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + } } } }, @@ -126,6 +168,93 @@ } } }, + "CreateFeedRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feedId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feed": { + "type": "Feed", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } + } + } + }, + "ListFeedsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListFeedsResponse": { + "fields": { + "feeds": { + "rule": "repeated", + "type": "Feed", + "id": 1 + } + } + }, + "UpdateFeedRequest": { + "fields": { + "feed": { + "type": "Feed", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } + } + } + }, "OutputConfig": { "oneofs": { "destination": { @@ -188,6 +317,14 @@ } } }, + "PubsubDestination": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, "ContentType": { "values": { "CONTENT_TYPE_UNSPECIFIED": 0, @@ -197,6 +334,58 @@ "ACCESS_POLICY": 5 } }, + "FeedOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "pubsubDestination" + ] + } + }, + "fields": { + "pubsubDestination": { + "type": "PubsubDestination", + "id": 1 + } + } + }, + "Feed": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Feed", + "(google.api.resource).pattern": "organizations/{organization}/feeds/{feed}", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "feedOutputConfig": { + "type": "FeedOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "TemporalAsset": { "fields": { "window": { @@ -246,6 +435,11 @@ "iamPolicy": { "type": "google.iam.v1.Policy", "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 } } }, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index 5817bae3c8a..5d2cabbacb4 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -125,6 +125,9 @@ class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + feedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), }; @@ -179,7 +182,15 @@ class AssetServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. - const assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; + const assetServiceStubMethods = [ + 'exportAssets', + 'batchGetAssetsHistory', + 'createFeed', + 'getFeed', + 'listFeeds', + 'updateFeed', + 'deleteFeed', + ]; for (const methodName of assetServiceStubMethods) { const innerCallPromise = assetServiceStub.then( stub => (...args) => { @@ -480,10 +491,334 @@ class AssetServiceClient { ); } + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {Object} request.feed + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} + * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1.Feed}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * const feedId = ''; + * const feed = {}; + * const request = { + * parent: parent, + * feedId: feedId, + * feed: feed, + * }; + * client.createFeed(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.createFeed(request, options, callback); + } + + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1.Feed}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + * client.getFeed({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + 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, + }); + + return this._innerApiCalls.getFeed(request, options, callback); + } + + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @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/interfaces/CallOptions.html} 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 [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const parent = ''; + * client.listFeeds({parent: parent}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + listFeeds(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.listFeeds(request, options, callback); + } + + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} + * @param {Object} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1.Feed}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const feed = {}; + * const updateMask = {}; + * const request = { + * feed: feed, + * updateMask: updateMask, + * }; + * client.updateFeed(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'feed.name': request.feed.name, + }); + + return this._innerApiCalls.updateFeed(request, options, callback); + } + + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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/interfaces/CallOptions.html} for the details. + * @param {function(?Error)} [callback] + * The function which will be called with the result of the API call. + * @returns {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const asset = require('asset.v1'); + * + * const client = new asset.v1.AssetServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + * client.deleteFeed({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteFeed(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + 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, + }); + + return this._innerApiCalls.deleteFeed(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- + /** + * Return a fully-qualified feed resource name string. + * + * @param {String} project + * @param {String} feed + * @returns {String} + */ + feedPath(project, feed) { + return this._pathTemplates.feedPathTemplate.render({ + project: project, + feed: feed, + }); + } + /** * Return a fully-qualified project resource name string. * @@ -496,6 +831,28 @@ class AssetServiceClient { }); } + /** + * Parse the feedName from a feed resource. + * + * @param {String} feedName + * A fully-qualified path representing a feed resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromFeedName(feedName) { + return this._pathTemplates.feedPathTemplate.match(feedName).project; + } + + /** + * Parse the feedName from a feed resource. + * + * @param {String} feedName + * A fully-qualified path representing a feed resources. + * @returns {String} - A string representing the feed. + */ + matchFeedFromFeedName(feedName) { + return this._pathTemplates.feedPathTemplate.match(feedName).feed; + } + /** * Parse the projectName from a project resource. * diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index e1004902b79..dc56b109a4c 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -29,6 +29,31 @@ "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default" + }, + "CreateFeed": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeed": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFeeds": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFeed": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeed": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js index e03bca4e8a7..4101467945d 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js @@ -143,6 +143,126 @@ const BatchGetAssetsHistoryResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Create asset feed request. + * + * @property {string} parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * + * @property {string} feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * + * @property {Object} feed + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} + * + * @typedef CreateFeedRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.CreateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const CreateFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Get asset feed request. + * + * @property {string} name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * @typedef GetFeedRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.GetFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const GetFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * List asset feeds request. + * + * @property {string} parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * + * @typedef ListFeedsRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.ListFeedsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const ListFeedsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * @property {Object[]} feeds + * A list of feeds. + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} + * + * @typedef ListFeedsResponse + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.ListFeedsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const ListFeedsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Update asset feed request. + * + * @property {Object} feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * + * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} + * + * @property {Object} updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateFeedRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.UpdateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const UpdateFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * @property {string} name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * + * @typedef DeleteFeedRequest + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.DeleteFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const DeleteFeedRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Output configuration for export assets destination. * @@ -224,6 +344,92 @@ const BigQueryDestination = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * A Cloud Pubsub destination. + * + * @property {string} topic + * The name of the Cloud Pub/Sub topic to publish to. + * For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + * + * @typedef PubsubDestination + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.PubsubDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const PubsubDestination = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for asset feed destination. + * + * @property {Object} pubsubDestination + * Destination on Cloud Pubsub. + * + * This object should have the same structure as [PubsubDestination]{@link google.cloud.asset.v1.PubsubDestination} + * + * @typedef FeedOutputConfig + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.FeedOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const FeedOutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * An asset feed used to export asset updates to a destinations. + * An asset feed filter controls what updates are exported. + * The asset feed must be created within a project, organization, or + * folder. Supported destinations are: + * Cloud Pub/Sub topics. + * + * @property {string} name + * Required. The format will be + * projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * + * The client-assigned feed identifier must be unique within the parent + * project/folder/organization. + * + * @property {string[]} assetNames + * A list of the full names of the assets to receive updates. You must specify + * either or both of asset_names and asset_types. Only asset updates matching + * specified asset_names and asset_types are exported to the feed. For + * example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * for more info. + * + * @property {string[]} assetTypes + * A list of types of the assets to receive updates. You must specify either + * or both of asset_names and asset_types. Only asset updates matching + * specified asset_names and asset_types are exported to the feed. + * For example: + * "compute.googleapis.com/Disk" See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * + * @property {number} contentType + * Asset content type. If not specified, no content but the asset name and + * type will be returned. + * + * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} + * + * @property {Object} feedOutputConfig + * Required. Feed output configuration defining where the asset updates are + * published to. + * + * This object should have the same structure as [FeedOutputConfig]{@link google.cloud.asset.v1.FeedOutputConfig} + * + * @typedef Feed + * @memberof google.cloud.asset.v1 + * @see [google.cloud.asset.v1.Feed definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} + */ +const Feed = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Asset content type. * diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js index 2c21347d37b..559a0ee2279 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js @@ -87,6 +87,14 @@ const TimeWindow = { * * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} * + * @property {string[]} ancestors + * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, + * represented as a list of relative resource names. Ancestry path starts with + * the closest CRM ancestor and ends at root. If the asset is a CRM + * project/folder/organization, this starts from the asset itself. + * + * Example: ["projects/123456789", "folders/5432", "organizations/1234"] + * * @typedef Asset * @memberof google.cloud.asset.v1 * @see [google.cloud.asset.v1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js new file mode 100644 index 00000000000..0b446dd9ce4 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js @@ -0,0 +1,34 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + * @typedef Empty + * @memberof google.protobuf + * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} + */ +const Empty = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js new file mode 100644 index 00000000000..011207b8626 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js @@ -0,0 +1,228 @@ +// Copyright 2019 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * + * @property {string[]} paths + * The set of field mask paths. + * + * @typedef FieldMask + * @memberof google.protobuf + * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} + */ +const FieldMask = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 7749078d126..eabe62b41c1 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-19T12:09:07.531125Z", + "updateTime": "2019-12-06T12:09:07.132948Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", - "internalRef": "281088257" + "sha": "b10e4547017ca529ac8d183e839f3c272e1c13de", + "internalRef": "284059574" } }, { diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js index 7e8e6d0dd8c..d0198ef6bfa 100644 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ b/packages/google-cloud-asset/test/gapic-v1.js @@ -205,6 +205,304 @@ describe('AssetServiceClient', () => { }); }); }); + + describe('createFeed', () => { + it('invokes createFeed without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const feedId = 'feedId-976011428'; + const feed = {}; + const request = { + parent: parent, + feedId: feedId, + feed: feed, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createFeed(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFeed with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const feedId = 'feedId-976011428'; + const feed = {}; + const request = { + parent: parent, + feedId: feedId, + feed: feed, + }; + + // Mock Grpc layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createFeed(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getFeed', () => { + it('invokes getFeed without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const expectedResponse = { + name: name2, + }; + + // Mock Grpc layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getFeed(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getFeed with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getFeed(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listFeeds', () => { + it('invokes listFeeds without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const request = { + parent: parent, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.listFeeds(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listFeeds with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const parent = 'parent-995424086'; + const request = { + parent: parent, + }; + + // Mock Grpc layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listFeeds(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateFeed', () => { + it('invokes updateFeed without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const feed = {}; + const updateMask = {}; + const request = { + feed: feed, + updateMask: updateMask, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateFeed(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFeed with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const feed = {}; + const updateMask = {}; + const request = { + feed: feed, + updateMask: updateMask, + }; + + // Mock Grpc layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateFeed(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteFeed', () => { + it('invokes deleteFeed without error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(request); + + client.deleteFeed(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteFeed with error', done => { + const client = new assetModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.feedPath('[PROJECT]', '[FEED]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteFeed(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); }); function mockSimpleGrpcMethod(expectedRequest, response, error) { From f98244e1a0850b823c0e3b0bc499a44a56670944 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2019 12:29:15 -0800 Subject: [PATCH 152/429] chore: release 1.5.0 (#225) --- packages/google-cloud-asset/CHANGELOG.md | 14 ++++++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 6d09ae1bcd8..80703279ffc 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,20 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.5.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.4.2...v1.5.0) (2019-12-06) + + +### Features + +* add plural and singular resource descriptor ([93c314d](https://www.github.com/googleapis/nodejs-asset/commit/93c314deee5e4b1a165f5126ca42a6b1568be148)) +* adds CreateFeed, GetFeed, ListFeeds, UpdateFeed, DeleteFeed methods ([13903ae](https://www.github.com/googleapis/nodejs-asset/commit/13903aebf37840973a7bf2b7c0d35f36880bf612)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([10472c9](https://www.github.com/googleapis/nodejs-asset/commit/10472c9e4be30a9ad61ace224943808cb32c8813)) +* **deps:** update dependency yargs to v15 ([#222](https://www.github.com/googleapis/nodejs-asset/issues/222)) ([a7beda9](https://www.github.com/googleapis/nodejs-asset/commit/a7beda95d9fdf6b55c019128a74e62f1410eeae4)) + ### [1.4.2](https://www.github.com/googleapis/nodejs-asset/compare/v1.4.1...v1.4.2) (2019-11-13) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index fa8586842a1..ebf32274829 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.4.2", + "version": "1.5.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index f146b72c613..25be366baba 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.4.2", + "@google-cloud/asset": "^1.5.0", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^15.0.0" From 1e2d8e354194a8ae9b8059e2ddf07a772d1720cd Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Dec 2019 12:17:08 -0500 Subject: [PATCH 153/429] docs: update jsdoc license/samples-README (#233) --- packages/google-cloud-asset/.jsdoc.js | 29 +++++++++---------- packages/google-cloud-asset/samples/README.md | 8 ++++- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 04cf2c09117..e662e8e8ea1 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -1,18 +1,17 @@ -/*! - * Copyright 2018 Google LLC. All Rights Reserved. - * - * 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. - */ +// Copyright 2019 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. +// 'use strict'; diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index 09eb533231f..85caa258991 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -26,6 +26,12 @@ Before running the samples, make sure you've followed the steps outlined in [Using the client library](https://github.com/googleapis/nodejs-asset#using-the-client-library). +`cd samples` + +`npm install` + +`cd ..` + ## Samples @@ -183,4 +189,4 @@ __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-asset&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview \ No newline at end of file +[product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview From 5444a887c529870e0e03cf780cedaef734225272 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 27 Dec 2019 18:20:56 +0200 Subject: [PATCH 154/429] chore(deps): update dependency eslint-plugin-node to v11 (#237) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ebf32274829..4086bf2fd01 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -48,7 +48,7 @@ "codecov": "^3.0.4", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^10.0.0", + "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", From a6acd27cffd882c8283693af07bd20c6cc183509 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Dec 2019 13:49:08 -0800 Subject: [PATCH 155/429] refactor: use explicit mocha imports (#239) --- packages/google-cloud-asset/samples/test/sample.test.js | 1 + packages/google-cloud-asset/system-test/.eslintrc.yml | 2 -- packages/google-cloud-asset/test/.eslintrc.yml | 3 --- packages/google-cloud-asset/test/gapic-v1.js | 1 + packages/google-cloud-asset/test/gapic-v1beta1.js | 1 + packages/google-cloud-asset/test/gapic-v1p2beta1.js | 1 + 6 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 packages/google-cloud-asset/test/.eslintrc.yml diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index a7d73beb5e7..5f2cd1ccc4e 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -15,6 +15,7 @@ 'use strict'; const {assert} = require('chai'); +const {after, before, describe, it} = require('mocha'); const uuid = require('uuid'); const cp = require('child_process'); const {Storage} = require('@google-cloud/storage'); diff --git a/packages/google-cloud-asset/system-test/.eslintrc.yml b/packages/google-cloud-asset/system-test/.eslintrc.yml index f9605165c0f..282535f55f6 100644 --- a/packages/google-cloud-asset/system-test/.eslintrc.yml +++ b/packages/google-cloud-asset/system-test/.eslintrc.yml @@ -1,5 +1,3 @@ --- -env: - mocha: true rules: no-console: off diff --git a/packages/google-cloud-asset/test/.eslintrc.yml b/packages/google-cloud-asset/test/.eslintrc.yml deleted file mode 100644 index 6db2a46c535..00000000000 --- a/packages/google-cloud-asset/test/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -env: - mocha: true diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js index d0198ef6bfa..519f9a53cfd 100644 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ b/packages/google-cloud-asset/test/gapic-v1.js @@ -15,6 +15,7 @@ 'use strict'; const assert = require('assert'); +const {describe, it} = require('mocha'); const assetModule = require('../src'); diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index c30f666dcef..d7f8f74405d 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -15,6 +15,7 @@ 'use strict'; const assert = require('assert'); +const {describe, it} = require('mocha'); const assetModule = require('../src'); diff --git a/packages/google-cloud-asset/test/gapic-v1p2beta1.js b/packages/google-cloud-asset/test/gapic-v1p2beta1.js index c82d95e591c..e1fbc7d46dc 100644 --- a/packages/google-cloud-asset/test/gapic-v1p2beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1p2beta1.js @@ -15,6 +15,7 @@ 'use strict'; const assert = require('assert'); +const {describe, it} = require('mocha'); const assetModule = require('../src'); From 1379396bec04381420e54cc1837f94ec300fb328 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 3 Jan 2020 22:49:04 -0800 Subject: [PATCH 156/429] build: use c8 for coverage (#236) * build: use c8 for coverage * chore: do our samples exercise more of the codebase Co-authored-by: Benjamin E. Coe Co-authored-by: Alexander Fenster --- packages/google-cloud-asset/package.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 4086bf2fd01..da61f429ab0 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -29,13 +29,12 @@ "Cloud Asset API" ], "scripts": { - "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", "lint": "eslint '**/*.js'", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "samples-test": "c8 npm run samples-test-suite", + "samples-test-suite": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", - "test-no-cover": "mocha test/*.js", - "test": "npm run cover", + "test": "c8 mocha", "fix": "eslint --fix '**/*.js'", "docs-test": "linkinator docs", "predocs-test": "npm run docs" @@ -56,7 +55,7 @@ "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", - "nyc": "^14.0.0", + "c8": "^7.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7" } From ce5b3db801de56952c0d4bebb270cdbac2862e94 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 4 Jan 2020 12:03:04 -0800 Subject: [PATCH 157/429] chore: update nyc config (#240) --- packages/google-cloud-asset/.nycrc | 1 + .../google-cloud-asset/protos/protos.d.ts | 2 +- packages/google-cloud-asset/protos/protos.js | 2 +- packages/google-cloud-asset/synth.metadata | 2244 ++++++++++++++++- 4 files changed, 2242 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/.nycrc b/packages/google-cloud-asset/.nycrc index 367688844eb..b18d5472b62 100644 --- a/packages/google-cloud-asset/.nycrc +++ b/packages/google-cloud-asset/.nycrc @@ -12,6 +12,7 @@ "**/scripts", "**/protos", "**/test", + "**/*.d.ts", ".jsdoc.js", "**/.jsdoc.js", "karma.conf.js", diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 0806c5416ce..5b9c16a1843 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 7827dfb3ddd..f311118aeb2 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index eabe62b41c1..e48a69bafa6 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-12-06T12:09:07.132948Z", + "updateTime": "2020-01-04T12:09:26.924903Z", "sources": [ { "generator": { "name": "artman", - "version": "0.42.1", - "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" + "version": "0.43.0", + "dockerImage": "googleapis/artman@sha256:264654a37596a44b0668b8ce6ac41082d713f6ee150b3fc6425fa78cc64e4f20" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b10e4547017ca529ac8d183e839f3c272e1c13de", - "internalRef": "284059574" + "sha": "91ef2d9dd69807b0b79555f22566fb2d81e49ff9", + "internalRef": "287999179" } }, { @@ -55,5 +55,2239 @@ "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" } } + ], + "newFiles": [ + { + "path": "package.json" + }, + { + "path": "webpack.config.js" + }, + { + "path": ".prettierignore" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": ".prettierrc" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "renovate.json" + }, + { + "path": ".nycrc" + }, + { + "path": "LICENSE" + }, + { + "path": "synth.py" + }, + { + "path": ".eslintignore" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "package-lock.json" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": "README.md" + }, + { + "path": "synth.metadata" + }, + { + "path": ".gitignore" + }, + { + "path": "codecov.yaml" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": "node_modules/uc.micro/package.json" + }, + { + "path": "node_modules/eastasianwidth/package.json" + }, + { + "path": "node_modules/defer-to-connect/package.json" + }, + { + "path": "node_modules/object-is/package.json" + }, + { + "path": "node_modules/is-arguments/package.json" + }, + { + "path": "node_modules/eventemitter3/package.json" + }, + { + "path": "node_modules/long/package.json" + }, + { + "path": "node_modules/lodash/package.json" + }, + { + "path": "node_modules/diff/package.json" + }, + { + "path": "node_modules/has-flag/package.json" + }, + { + "path": "node_modules/prelude-ls/package.json" + }, + { + "path": "node_modules/source-map/package.json" + }, + { + "path": "node_modules/spdx-correct/package.json" + }, + { + "path": "node_modules/normalize-url/package.json" + }, + { + "path": "node_modules/tmp/package.json" + }, + { + "path": "node_modules/got/package.json" + }, + { + "path": "node_modules/agent-base/package.json" + }, + { + "path": "node_modules/process-nextick-args/package.json" + }, + { + "path": "node_modules/google-gax/package.json" + }, + { + "path": "node_modules/next-tick/package.json" + }, + { + "path": "node_modules/hosted-git-info/package.json" + }, + { + "path": "node_modules/is-symbol/package.json" + }, + { + "path": "node_modules/once/package.json" + }, + { + "path": "node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/ansi-escapes/package.json" + }, + { + "path": "node_modules/gcp-metadata/package.json" + }, + { + "path": "node_modules/espower-loader/package.json" + }, + { + "path": "node_modules/validate-npm-package-license/package.json" + }, + { + "path": "node_modules/doctrine/package.json" + }, + { + "path": "node_modules/power-assert-context-formatter/package.json" + }, + { + "path": "node_modules/marked/package.json" + }, + { + "path": "node_modules/jsdoc/package.json" + }, + { + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/flat-cache/package.json" + }, + { + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/is-npm/package.json" + }, + { + "path": "node_modules/espower-location-detector/package.json" + }, + { + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + }, + { + "path": "node_modules/base64-js/package.json" + }, + { + "path": "node_modules/is-glob/package.json" + }, + { + "path": "node_modules/taffydb/package.json" + }, + { + "path": "node_modules/mocha/package.json" + }, + { + "path": "node_modules/mocha/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/mocha/node_modules/glob/package.json" + }, + { + "path": "node_modules/mocha/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/mocha/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/mocha/node_modules/find-up/package.json" + }, + { + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/mocha/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs/package.json" + }, + { + "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/mocha/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/mocha/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/mocha/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/mocha/node_modules/ms/package.json" + }, + { + "path": "node_modules/mocha/node_modules/color-name/package.json" + }, + { + "path": "node_modules/mocha/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/mocha/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/mocha/node_modules/cliui/package.json" + }, + { + "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" + }, + { + "path": "node_modules/mocha/node_modules/which/package.json" + }, + { + "path": "node_modules/mocha/node_modules/string-width/package.json" + }, + { + "path": "node_modules/mocha/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/minimist/package.json" + }, + { + "path": "node_modules/type/package.json" + }, + { + "path": "node_modules/yargs-unparser/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/css-select/package.json" + }, + { + "path": "node_modules/file-entry-cache/package.json" + }, + { + "path": "node_modules/he/package.json" + }, + { + "path": "node_modules/xmlcreate/package.json" + }, + { + "path": "node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/ecdsa-sig-formatter/package.json" + }, + { + "path": "node_modules/nice-try/package.json" + }, + { + "path": "node_modules/log-symbols/package.json" + }, + { + "path": "node_modules/object.getownpropertydescriptors/package.json" + }, + { + "path": "node_modules/@protobufjs/path/package.json" + }, + { + "path": "node_modules/@protobufjs/pool/package.json" + }, + { + "path": "node_modules/@protobufjs/float/package.json" + }, + { + "path": "node_modules/@protobufjs/aspromise/package.json" + }, + { + "path": "node_modules/@protobufjs/fetch/package.json" + }, + { + "path": "node_modules/@protobufjs/utf8/package.json" + }, + { + "path": "node_modules/@protobufjs/codegen/package.json" + }, + { + "path": "node_modules/@protobufjs/inquire/package.json" + }, + { + "path": "node_modules/@protobufjs/base64/package.json" + }, + { + "path": "node_modules/@protobufjs/eventemitter/package.json" + }, + { + "path": "node_modules/gtoken/package.json" + }, + { + "path": "node_modules/through2/package.json" + }, + { + "path": "node_modules/p-limit/package.json" + }, + { + "path": "node_modules/argparse/package.json" + }, + { + "path": "node_modules/eslint-scope/package.json" + }, + { + "path": "node_modules/extend/package.json" + }, + { + "path": "node_modules/is-path-inside/package.json" + }, + { + "path": "node_modules/destroy/package.json" + }, + { + "path": "node_modules/power-assert-formatter/package.json" + }, + { + "path": "node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/global-dirs/package.json" + }, + { + "path": "node_modules/fast-deep-equal/package.json" + }, + { + "path": "node_modules/mimic-fn/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + }, + { + "path": "node_modules/core-util-is/package.json" + }, + { + "path": "node_modules/string.prototype.trimright/package.json" + }, + { + "path": "node_modules/catharsis/package.json" + }, + { + "path": "node_modules/node-fetch/package.json" + }, + { + "path": "node_modules/linkinator/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/chalk/package.json" + }, + { + "path": "node_modules/fresh/package.json" + }, + { + "path": "node_modules/safer-buffer/package.json" + }, + { + "path": "node_modules/is-stream-ended/package.json" + }, + { + "path": "node_modules/mimic-response/package.json" + }, + { + "path": "node_modules/requizzle/package.json" + }, + { + "path": "node_modules/cacheable-request/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/figures/package.json" + }, + { + "path": "node_modules/power-assert-util-string-width/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + }, + { + "path": "node_modules/abort-controller/package.json" + }, + { + "path": "node_modules/widest-line/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + }, + { + "path": "node_modules/boxen/package.json" + }, + { + "path": "node_modules/boxen/node_modules/chalk/package.json" + }, + { + "path": "node_modules/glob/package.json" + }, + { + "path": "node_modules/buffer-equal-constant-time/package.json" + }, + { + "path": "node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/acorn-es7-plugin/package.json" + }, + { + "path": "node_modules/acorn/package.json" + }, + { + "path": "node_modules/spdx-expression-parse/package.json" + }, + { + "path": "node_modules/read-pkg/package.json" + }, + { + "path": "node_modules/read-pkg/node_modules/type-fest/package.json" + }, + { + "path": "node_modules/node-environment-flags/package.json" + }, + { + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + }, + { + "path": "node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/escallmatch/package.json" + }, + { + "path": "node_modules/escallmatch/node_modules/esprima/package.json" + }, + { + "path": "node_modules/is-typedarray/package.json" + }, + { + "path": "node_modules/callsites/package.json" + }, + { + "path": "node_modules/safe-buffer/package.json" + }, + { + "path": "node_modules/type-fest/package.json" + }, + { + "path": "node_modules/espree/package.json" + }, + { + "path": "node_modules/server-destroy/package.json" + }, + { + "path": "node_modules/rc/package.json" + }, + { + "path": "node_modules/rc/node_modules/minimist/package.json" + }, + { + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/fs.realpath/package.json" + }, + { + "path": "node_modules/es6-set/package.json" + }, + { + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/js-yaml/package.json" + }, + { + "path": "node_modules/ajv/package.json" + }, + { + "path": "node_modules/prettier-linter-helpers/package.json" + }, + { + "path": "node_modules/p-finally/package.json" + }, + { + "path": "node_modules/redent/package.json" + }, + { + "path": "node_modules/diff-match-patch/package.json" + }, + { + "path": "node_modules/signal-exit/package.json" + }, + { + "path": "node_modules/core-js/package.json" + }, + { + "path": "node_modules/package-json/package.json" + }, + { + "path": "node_modules/package-json/node_modules/semver/package.json" + }, + { + "path": "node_modules/indexof/package.json" + }, + { + "path": "node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/p-try/package.json" + }, + { + "path": "node_modules/empower/package.json" + }, + { + "path": "node_modules/external-editor/package.json" + }, + { + "path": "node_modules/html-escaper/package.json" + }, + { + "path": "node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/regexpp/package.json" + }, + { + "path": "node_modules/p-cancelable/package.json" + }, + { + "path": "node_modules/set-blocking/package.json" + }, + { + "path": "node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/encodeurl/package.json" + }, + { + "path": "node_modules/table/package.json" + }, + { + "path": "node_modules/table/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/table/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/table/node_modules/string-width/package.json" + }, + { + "path": "node_modules/table/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/has-symbols/package.json" + }, + { + "path": "node_modules/escodegen/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/source-map/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/esprima/package.json" + }, + { + "path": "node_modules/unpipe/package.json" + }, + { + "path": "node_modules/dot-prop/package.json" + }, + { + "path": "node_modules/es-abstract/package.json" + }, + { + "path": "node_modules/update-notifier/package.json" + }, + { + "path": "node_modules/update-notifier/node_modules/chalk/package.json" + }, + { + "path": "node_modules/domutils/package.json" + }, + { + "path": "node_modules/find-up/package.json" + }, + { + "path": "node_modules/event-emitter/package.json" + }, + { + "path": "node_modules/parse-json/package.json" + }, + { + "path": "node_modules/linkify-it/package.json" + }, + { + "path": "node_modules/ignore/package.json" + }, + { + "path": "node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/etag/package.json" + }, + { + "path": "node_modules/empower-assert/package.json" + }, + { + "path": "node_modules/is-extglob/package.json" + }, + { + "path": "node_modules/json-bigint/package.json" + }, + { + "path": "node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/traverse/package.json" + }, + { + "path": "node_modules/escope/package.json" + }, + { + "path": "node_modules/prettier/package.json" + }, + { + "path": "node_modules/mime/package.json" + }, + { + "path": "node_modules/google-auth-library/package.json" + }, + { + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + }, + { + "path": "node_modules/string.prototype.trimleft/package.json" + }, + { + "path": "node_modules/get-stdin/package.json" + }, + { + "path": "node_modules/espower/package.json" + }, + { + "path": "node_modules/espower/node_modules/source-map/package.json" + }, + { + "path": "node_modules/minimatch/package.json" + }, + { + "path": "node_modules/json-buffer/package.json" + }, + { + "path": "node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/nth-check/package.json" + }, + { + "path": "node_modules/is-date-object/package.json" + }, + { + "path": "node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/onetime/package.json" + }, + { + "path": "node_modules/argv/package.json" + }, + { + "path": "node_modules/codecov/package.json" + }, + { + "path": "node_modules/uri-js/package.json" + }, + { + "path": "node_modules/power-assert-renderer-comparison/package.json" + }, + { + "path": "node_modules/locate-path/package.json" + }, + { + "path": "node_modules/text-table/package.json" + }, + { + "path": "node_modules/p-timeout/package.json" + }, + { + "path": "node_modules/progress/package.json" + }, + { + "path": "node_modules/es5-ext/package.json" + }, + { + "path": "node_modules/statuses/package.json" + }, + { + "path": "node_modules/markdown-it-anchor/package.json" + }, + { + "path": "node_modules/jsonexport/package.json" + }, + { + "path": "node_modules/domhandler/package.json" + }, + { + "path": "node_modules/mkdirp/package.json" + }, + { + "path": "node_modules/is-installed-globally/package.json" + }, + { + "path": "node_modules/http-cache-semantics/package.json" + }, + { + "path": "node_modules/empower-core/package.json" + }, + { + "path": "node_modules/string_decoder/package.json" + }, + { + "path": "node_modules/htmlparser2/package.json" + }, + { + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/send/package.json" + }, + { + "path": "node_modules/send/node_modules/mime/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + }, + { + "path": "node_modules/send/node_modules/ms/package.json" + }, + { + "path": "node_modules/convert-source-map/package.json" + }, + { + "path": "node_modules/js-tokens/package.json" + }, + { + "path": "node_modules/es6-weak-map/package.json" + }, + { + "path": "node_modules/array-filter/package.json" + }, + { + "path": "node_modules/es6-map/package.json" + }, + { + "path": "node_modules/to-readable-stream/package.json" + }, + { + "path": "node_modules/type-name/package.json" + }, + { + "path": "node_modules/regexp.prototype.flags/package.json" + }, + { + "path": "node_modules/deep-equal/package.json" + }, + { + "path": "node_modules/graceful-fs/package.json" + }, + { + "path": "node_modules/chalk/package.json" + }, + { + "path": "node_modules/chalk/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/chalk/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/chalk/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/chalk/node_modules/color-name/package.json" + }, + { + "path": "node_modules/chalk/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/write/package.json" + }, + { + "path": "node_modules/ext/package.json" + }, + { + "path": "node_modules/ext/node_modules/type/package.json" + }, + { + "path": "node_modules/yargs/package.json" + }, + { + "path": "node_modules/through/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + }, + { + "path": "node_modules/parseurl/package.json" + }, + { + "path": "node_modules/setprototypeof/package.json" + }, + { + "path": "node_modules/jwa/package.json" + }, + { + "path": "node_modules/camelcase/package.json" + }, + { + "path": "node_modules/deep-extend/package.json" + }, + { + "path": "node_modules/inflight/package.json" + }, + { + "path": "node_modules/istanbul-reports/package.json" + }, + { + "path": "node_modules/es6-iterator/package.json" + }, + { + "path": "node_modules/run-async/package.json" + }, + { + "path": "node_modules/@bcoe/v8-coverage/package.json" + }, + { + "path": "node_modules/esquery/package.json" + }, + { + "path": "node_modules/resolve/package.json" + }, + { + "path": "node_modules/functional-red-black-tree/package.json" + }, + { + "path": "node_modules/inquirer/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/json-schema-traverse/package.json" + }, + { + "path": "node_modules/meow/package.json" + }, + { + "path": "node_modules/es-to-primitive/package.json" + }, + { + "path": "node_modules/ini/package.json" + }, + { + "path": "node_modules/call-signature/package.json" + }, + { + "path": "node_modules/dom-serializer/package.json" + }, + { + "path": "node_modules/on-finished/package.json" + }, + { + "path": "node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/ansi-colors/package.json" + }, + { + "path": "node_modules/end-of-stream/package.json" + }, + { + "path": "node_modules/require-main-filename/package.json" + }, + { + "path": "node_modules/supports-color/package.json" + }, + { + "path": "node_modules/eslint-visitor-keys/package.json" + }, + { + "path": "node_modules/get-caller-file/package.json" + }, + { + "path": "node_modules/brace-expansion/package.json" + }, + { + "path": "node_modules/ignore-walk/package.json" + }, + { + "path": "node_modules/urlgrey/package.json" + }, + { + "path": "node_modules/balanced-match/package.json" + }, + { + "path": "node_modules/markdown-it/package.json" + }, + { + "path": "node_modules/rxjs/package.json" + }, + { + "path": "node_modules/iconv-lite/package.json" + }, + { + "path": "node_modules/is-plain-obj/package.json" + }, + { + "path": "node_modules/fast-text-encoding/package.json" + }, + { + "path": "node_modules/os-tmpdir/package.json" + }, + { + "path": "node_modules/test-exclude/package.json" + }, + { + "path": "node_modules/resolve-from/package.json" + }, + { + "path": "node_modules/source-map-support/package.json" + }, + { + "path": "node_modules/source-map-support/node_modules/source-map/package.json" + }, + { + "path": "node_modules/punycode/package.json" + }, + { + "path": "node_modules/ee-first/package.json" + }, + { + "path": "node_modules/p-locate/package.json" + }, + { + "path": "node_modules/@types/long/package.json" + }, + { + "path": "node_modules/@types/minimist/package.json" + }, + { + "path": "node_modules/@types/node/package.json" + }, + { + "path": "node_modules/@types/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/@types/is-windows/package.json" + }, + { + "path": "node_modules/@types/fs-extra/package.json" + }, + { + "path": "node_modules/@types/color-name/package.json" + }, + { + "path": "node_modules/@types/normalize-package-data/package.json" + }, + { + "path": "node_modules/wide-align/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/string-width/package.json" + }, + { + "path": "node_modules/is-promise/package.json" + }, + { + "path": "node_modules/spdx-exceptions/package.json" + }, + { + "path": "node_modules/slice-ansi/package.json" + }, + { + "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/slice-ansi/node_modules/color-name/package.json" + }, + { + "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/eslint-plugin-prettier/package.json" + }, + { + "path": "node_modules/decompress-response/package.json" + }, + { + "path": "node_modules/parent-module/package.json" + }, + { + "path": "node_modules/jsdoc-region-tag/package.json" + }, + { + "path": "node_modules/domelementtype/package.json" + }, + { + "path": "node_modules/typedarray-to-buffer/package.json" + }, + { + "path": "node_modules/typedarray-to-buffer/.airtap.yml" + }, + { + "path": "node_modules/typedarray-to-buffer/.travis.yml" + }, + { + "path": "node_modules/typedarray-to-buffer/index.js" + }, + { + "path": "node_modules/typedarray-to-buffer/LICENSE" + }, + { + "path": "node_modules/typedarray-to-buffer/README.md" + }, + { + "path": "node_modules/typedarray-to-buffer/test/basic.js" + }, + { + "path": "node_modules/sprintf-js/package.json" + }, + { + "path": "node_modules/path-key/package.json" + }, + { + "path": "node_modules/isarray/package.json" + }, + { + "path": "node_modules/@grpc/grpc-js/package.json" + }, + { + "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" + }, + { + "path": "node_modules/@grpc/proto-loader/package.json" + }, + { + "path": "node_modules/responselike/package.json" + }, + { + "path": "node_modules/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/minimist-options/package.json" + }, + { + "path": "node_modules/minimist-options/node_modules/arrify/package.json" + }, + { + "path": "node_modules/latest-version/package.json" + }, + { + "path": "node_modules/amdefine/package.json" + }, + { + "path": "node_modules/estraverse/package.json" + }, + { + "path": "node_modules/http-errors/package.json" + }, + { + "path": "node_modules/term-size/package.json" + }, + { + "path": "node_modules/bluebird/package.json" + }, + { + "path": "node_modules/natural-compare/package.json" + }, + { + "path": "node_modules/xdg-basedir/package.json" + }, + { + "path": "node_modules/ansi-align/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/string-width/package.json" + }, + { + "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/js2xmlparser/package.json" + }, + { + "path": "node_modules/teeny-request/package.json" + }, + { + "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/espower-source/package.json" + }, + { + "path": "node_modules/espower-source/node_modules/acorn/package.json" + }, + { + "path": "node_modules/d/package.json" + }, + { + "path": "node_modules/is-stream/package.json" + }, + { + "path": "node_modules/debug/package.json" + }, + { + "path": "node_modules/espurify/package.json" + }, + { + "path": "node_modules/wrappy/package.json" + }, + { + "path": "node_modules/import-fresh/package.json" + }, + { + "path": "node_modules/eslint/package.json" + }, + { + "path": "node_modules/eslint/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + }, + { + "path": "node_modules/eslint/node_modules/path-key/package.json" + }, + { + "path": "node_modules/eslint/node_modules/debug/package.json" + }, + { + "path": "node_modules/eslint/node_modules/semver/package.json" + }, + { + "path": "node_modules/eslint/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/eslint/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/eslint/node_modules/which/package.json" + }, + { + "path": "node_modules/es6-promise/package.json" + }, + { + "path": "node_modules/is-yarn-global/package.json" + }, + { + "path": "node_modules/array-find/package.json" + }, + { + "path": "node_modules/imurmurhash/package.json" + }, + { + "path": "node_modules/globals/package.json" + }, + { + "path": "node_modules/is-ci/package.json" + }, + { + "path": "node_modules/mdurl/package.json" + }, + { + "path": "node_modules/error-ex/package.json" + }, + { + "path": "node_modules/is-url/package.json" + }, + { + "path": "node_modules/stream-shift/package.json" + }, + { + "path": "node_modules/ci-info/package.json" + }, + { + "path": "node_modules/path-exists/package.json" + }, + { + "path": "node_modules/esrecurse/package.json" + }, + { + "path": "node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/trim-newlines/package.json" + }, + { + "path": "node_modules/json-parse-better-errors/package.json" + }, + { + "path": "node_modules/retry-request/package.json" + }, + { + "path": "node_modules/retry-request/node_modules/debug/package.json" + }, + { + "path": "node_modules/merge-estraverse-visitors/package.json" + }, + { + "path": "node_modules/arrify/package.json" + }, + { + "path": "node_modules/is-windows/package.json" + }, + { + "path": "node_modules/call-matcher/package.json" + }, + { + "path": "node_modules/furi/package.json" + }, + { + "path": "node_modules/v8-compile-cache/package.json" + }, + { + "path": "node_modules/decamelize/package.json" + }, + { + "path": "node_modules/jws/package.json" + }, + { + "path": "node_modules/unique-string/package.json" + }, + { + "path": "node_modules/css-what/package.json" + }, + { + "path": "node_modules/crypto-random-string/package.json" + }, + { + "path": "node_modules/url-parse-lax/package.json" + }, + { + "path": "node_modules/@istanbuljs/schema/package.json" + }, + { + "path": "node_modules/ms/package.json" + }, + { + "path": "node_modules/decamelize-keys/package.json" + }, + { + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + }, + { + "path": "node_modules/make-dir/package.json" + }, + { + "path": "node_modules/make-dir/node_modules/semver/package.json" + }, + { + "path": "node_modules/get-stream/package.json" + }, + { + "path": "node_modules/word-wrap/package.json" + }, + { + "path": "node_modules/keyv/package.json" + }, + { + "path": "node_modules/semver/package.json" + }, + { + "path": "node_modules/esutils/package.json" + }, + { + "path": "node_modules/intelli-espower-loader/package.json" + }, + { + "path": "node_modules/color-name/package.json" + }, + { + "path": "node_modules/object-keys/package.json" + }, + { + "path": "node_modules/event-target-shim/package.json" + }, + { + "path": "node_modules/stringifier/package.json" + }, + { + "path": "node_modules/write-file-atomic/package.json" + }, + { + "path": "node_modules/is-regex/package.json" + }, + { + "path": "node_modules/google-p12-pem/package.json" + }, + { + "path": "node_modules/v8-to-istanbul/package.json" + }, + { + "path": "node_modules/@szmarczak/http-timer/package.json" + }, + { + "path": "node_modules/growl/package.json" + }, + { + "path": "node_modules/flat/package.json" + }, + { + "path": "node_modules/path-is-absolute/package.json" + }, + { + "path": "node_modules/path-parse/package.json" + }, + { + "path": "node_modules/node-forge/package.json" + }, + { + "path": "node_modules/levn/package.json" + }, + { + "path": "node_modules/chardet/package.json" + }, + { + "path": "node_modules/lodash.camelcase/package.json" + }, + { + "path": "node_modules/walkdir/package.json" + }, + { + "path": "node_modules/foreground-child/package.json" + }, + { + "path": "node_modules/quick-lru/package.json" + }, + { + "path": "node_modules/serve-static/package.json" + }, + { + "path": "node_modules/which-module/package.json" + }, + { + "path": "node_modules/power-assert/package.json" + }, + { + "path": "node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/fast-levenshtein/package.json" + }, + { + "path": "node_modules/power-assert-context-traversal/package.json" + }, + { + "path": "node_modules/range-parser/package.json" + }, + { + "path": "node_modules/type-check/package.json" + }, + { + "path": "node_modules/normalize-package-data/package.json" + }, + { + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + }, + { + "path": "node_modules/registry-auth-token/package.json" + }, + { + "path": "node_modules/deep-is/package.json" + }, + { + "path": "node_modules/cli-boxes/package.json" + }, + { + "path": "node_modules/finalhandler/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/debug/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/ms/package.json" + }, + { + "path": "node_modules/optionator/package.json" + }, + { + "path": "node_modules/lodash.has/package.json" + }, + { + "path": "node_modules/xtend/package.json" + }, + { + "path": "node_modules/util-deprecate/package.json" + }, + { + "path": "node_modules/concat-map/package.json" + }, + { + "path": "node_modules/duplexify/package.json" + }, + { + "path": "node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/hard-rejection/package.json" + }, + { + "path": "node_modules/power-assert-renderer-file/package.json" + }, + { + "path": "node_modules/gaxios/package.json" + }, + { + "path": "node_modules/y18n/package.json" + }, + { + "path": "node_modules/clone-response/package.json" + }, + { + "path": "node_modules/is-obj/package.json" + }, + { + "path": "node_modules/toidentifier/package.json" + }, + { + "path": "node_modules/esprima/package.json" + }, + { + "path": "node_modules/is-callable/package.json" + }, + { + "path": "node_modules/camelcase-keys/package.json" + }, + { + "path": "node_modules/is-arrayish/package.json" + }, + { + "path": "node_modules/fast-diff/package.json" + }, + { + "path": "node_modules/configstore/package.json" + }, + { + "path": "node_modules/universal-deep-strict-equal/package.json" + }, + { + "path": "node_modules/power-assert-renderer-assertion/package.json" + }, + { + "path": "node_modules/glob-parent/package.json" + }, + { + "path": "node_modules/object.assign/package.json" + }, + { + "path": "node_modules/color-convert/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" + }, + { + "path": "node_modules/cliui/package.json" + }, + { + "path": "node_modules/cheerio/package.json" + }, + { + "path": "node_modules/flatted/package.json" + }, + { + "path": "node_modules/parse5/package.json" + }, + { + "path": "node_modules/power-assert-renderer-base/package.json" + }, + { + "path": "node_modules/es6-promisify/package.json" + }, + { + "path": "node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/indent-string/package.json" + }, + { + "path": "node_modules/tslib/package.json" + }, + { + "path": "node_modules/prepend-http/package.json" + }, + { + "path": "node_modules/fast-json-stable-stringify/package.json" + }, + { + "path": "node_modules/semver-diff/package.json" + }, + { + "path": "node_modules/semver-diff/node_modules/semver/package.json" + }, + { + "path": "node_modules/cli-width/package.json" + }, + { + "path": "node_modules/escape-html/package.json" + }, + { + "path": "node_modules/protobufjs/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package-lock.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + }, + { + "path": "node_modules/has/package.json" + }, + { + "path": "node_modules/boolbase/package.json" + }, + { + "path": "node_modules/@sindresorhus/is/package.json" + }, + { + "path": "node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/mute-stream/package.json" + }, + { + "path": "node_modules/p-queue/package.json" + }, + { + "path": "node_modules/cli-cursor/package.json" + }, + { + "path": "node_modules/bignumber.js/package.json" + }, + { + "path": "node_modules/wrap-ansi/package.json" + }, + { + "path": "node_modules/require-directory/package.json" + }, + { + "path": "node_modules/uuid/package.json" + }, + { + "path": "node_modules/c8/package.json" + }, + { + "path": "node_modules/eslint-config-prettier/package.json" + }, + { + "path": "node_modules/function-bind/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/package.json" + }, + { + "path": "node_modules/object-inspect/package.json" + }, + { + "path": "node_modules/entities/package.json" + }, + { + "path": "node_modules/define-properties/package.json" + }, + { + "path": "node_modules/has-yarn/package.json" + }, + { + "path": "node_modules/min-indent/package.json" + }, + { + "path": "node_modules/underscore/package.json" + }, + { + "path": "node_modules/power-assert-renderer-diagram/package.json" + }, + { + "path": "node_modules/browser-stdout/package.json" + }, + { + "path": "node_modules/registry-url/package.json" + }, + { + "path": "node_modules/which/package.json" + }, + { + "path": "node_modules/@babel/highlight/package.json" + }, + { + "path": "node_modules/@babel/code-frame/package.json" + }, + { + "path": "node_modules/@babel/parser/package.json" + }, + { + "path": "node_modules/strip-indent/package.json" + }, + { + "path": "node_modules/map-obj/package.json" + }, + { + "path": "node_modules/duplexer3/package.json" + }, + { + "path": "node_modules/isexe/package.json" + }, + { + "path": "node_modules/klaw/package.json" + }, + { + "path": "node_modules/inherits/package.json" + }, + { + "path": "node_modules/lodash.at/package.json" + }, + { + "path": "node_modules/pump/package.json" + }, + { + "path": "node_modules/spdx-license-ids/package.json" + }, + { + "path": "node_modules/depd/package.json" + }, + { + "path": "node_modules/import-lazy/package.json" + }, + { + "path": "node_modules/string-width/package.json" + }, + { + "path": "node_modules/lines-and-columns/package.json" + }, + { + "path": "node_modules/astral-regex/package.json" + }, + { + "path": "node_modules/rimraf/package.json" + }, + { + "path": "node_modules/restore-cursor/package.json" + }, + { + "path": "node_modules/yallist/package.json" + }, + { + "path": "node_modules/emoji-regex/package.json" + }, + { + "path": "system-test/.eslintrc.yml" + }, + { + "path": "system-test/no-tests.js" + }, + { + "path": ".git/config" + }, + { + "path": ".git/index" + }, + { + "path": ".git/packed-refs" + }, + { + "path": ".git/shallow" + }, + { + "path": ".git/HEAD" + }, + { + "path": ".git/refs/heads/autosynth" + }, + { + "path": ".git/refs/heads/master" + }, + { + "path": ".git/refs/remotes/origin/HEAD" + }, + { + "path": ".git/objects/pack/pack-d44569af94a96b3c438fb4b055c8ec60a5aea892.pack" + }, + { + "path": ".git/objects/pack/pack-d44569af94a96b3c438fb4b055c8ec60a5aea892.idx" + }, + { + "path": ".git/logs/HEAD" + }, + { + "path": ".git/logs/refs/heads/autosynth" + }, + { + "path": ".git/logs/refs/heads/master" + }, + { + "path": ".git/logs/refs/remotes/origin/HEAD" + }, + { + "path": "src/index.js" + }, + { + "path": "src/browser.js" + }, + { + "path": "src/v1/index.js" + }, + { + "path": "src/v1/asset_service_client.js" + }, + { + "path": "src/v1/asset_service_proto_list.json" + }, + { + "path": "src/v1/asset_service_client_config.json" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1/doc/google/cloud/asset/v1/doc_assets.js" + }, + { + "path": "src/v1/doc/google/cloud/asset/v1/doc_asset_service.js" + }, + { + "path": "src/v1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_empty.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1beta1/index.js" + }, + { + "path": "src/v1beta1/asset_service_client.js" + }, + { + "path": "src/v1beta1/asset_service_proto_list.json" + }, + { + "path": "src/v1beta1/asset_service_client_config.json" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js" + }, + { + "path": "src/v1beta1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1beta1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1p2beta1/index.js" + }, + { + "path": "src/v1p2beta1/asset_service_client.js" + }, + { + "path": "src/v1p2beta1/asset_service_proto_list.json" + }, + { + "path": "src/v1p2beta1/asset_service_client_config.json" + }, + { + "path": "src/v1p2beta1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js" + }, + { + "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js" + }, + { + "path": "src/v1p2beta1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1p2beta1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1p2beta1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_empty.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.json" + }, + { + "path": "protos/google/cloud/asset/v1/assets.proto" + }, + { + "path": "protos/google/cloud/asset/v1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1beta1/assets.proto" + }, + { + "path": "protos/google/cloud/asset/v1beta1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1p2beta1/assets.proto" + }, + { + "path": "protos/google/cloud/asset/v1p2beta1/asset_service.proto" + }, + { + "path": "__pycache__/synth.cpython-36.pyc" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/updateFeed.js" + }, + { + "path": "samples/deleteFeed.js" + }, + { + "path": "samples/createFeed.js" + }, + { + "path": "samples/listFeeds.js" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/getFeed.js" + }, + { + "path": "samples/exportAssets.js" + }, + { + "path": "samples/.eslintrc.yml" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/getBatchAssetHistory.js" + }, + { + "path": "samples/test/sample.test.js" + }, + { + "path": "test/gapic-v1.js" + }, + { + "path": "test/gapic-v1beta1.js" + }, + { + "path": "test/gapic-v1p2beta1.js" + } ] } \ No newline at end of file From 596fb0fd52c9fabd04ba31caab3d6095281ae804 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 6 Jan 2020 18:50:01 +0200 Subject: [PATCH 158/429] chore(deps): update dependency mocha to v7 (#241) --- packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index da61f429ab0..b03fe2ce3ae 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -54,7 +54,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", - "mocha": "^6.0.0", + "mocha": "^7.0.0", "c8": "^7.0.0", "power-assert": "^1.6.0", "prettier": "^1.13.7" diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 25be366baba..892a603973f 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -22,6 +22,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.0.0" + "mocha": "^7.0.0" } } From e734aa16981bc57ee46cb84458a2b952639af4ae Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2020 10:46:54 -0800 Subject: [PATCH 159/429] chore: release 1.6.0 * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 80703279ffc..4f19750eb57 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [1.6.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.5.0...v1.6.0) (2020-01-06) + + +### Features + +* **samples:** update real time feed api sample code to use v1 API surface ([f15d2e2](https://www.github.com/googleapis/nodejs-asset/commit/f15d2e2cb4ff56bcc0fe5d83a090f5c92e4b25df)) + ## [1.5.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.4.2...v1.5.0) (2019-12-06) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b03fe2ce3ae..3b91ed0f445 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.5.0", + "version": "1.6.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 892a603973f..b700c06f935 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.5.0", + "@google-cloud/asset": "^1.6.0", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^15.0.0" From 5a50a55674cd18b12f73de2063f01af13e26a2bd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 13 Jan 2020 17:18:51 -0800 Subject: [PATCH 160/429] docs: small change to resource format in jsdoc --- .../doc/google/longrunning/doc_operations.js | 2 +- .../doc/google/longrunning/doc_operations.js | 2 +- .../doc/google/longrunning/doc_operations.js | 2 +- packages/google-cloud-asset/synth.metadata | 2240 +---------------- 4 files changed, 6 insertions(+), 2240 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js index 4719aebdc91..5aa806fd340 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js @@ -22,7 +22,7 @@ * @property {string} name * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the - * `name` should have the format of `operations/some/unique/name`. + * `name` should be a resource name ending with `operations/{unique_id}`. * * @property {Object} metadata * Service-specific metadata associated with the operation. It typically diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js index 4719aebdc91..5aa806fd340 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -22,7 +22,7 @@ * @property {string} name * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the - * `name` should have the format of `operations/some/unique/name`. + * `name` should be a resource name ending with `operations/{unique_id}`. * * @property {Object} metadata * Service-specific metadata associated with the operation. It typically diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js index 4719aebdc91..5aa806fd340 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js @@ -22,7 +22,7 @@ * @property {string} name * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the - * `name` should have the format of `operations/some/unique/name`. + * `name` should be a resource name ending with `operations/{unique_id}`. * * @property {Object} metadata * Service-specific metadata associated with the operation. It typically diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e48a69bafa6..76c8b82e57f 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-01-04T12:09:26.924903Z", + "updateTime": "2020-01-13T12:09:26.166607Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91ef2d9dd69807b0b79555f22566fb2d81e49ff9", - "internalRef": "287999179" + "sha": "06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68", + "internalRef": "289413169" } }, { @@ -55,2239 +55,5 @@ "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" } } - ], - "newFiles": [ - { - "path": "package.json" - }, - { - "path": "webpack.config.js" - }, - { - "path": ".prettierignore" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": ".prettierrc" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "renovate.json" - }, - { - "path": ".nycrc" - }, - { - "path": "LICENSE" - }, - { - "path": "synth.py" - }, - { - "path": ".eslintignore" - }, - { - "path": "linkinator.config.json" - }, - { - "path": "package-lock.json" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": "README.md" - }, - { - "path": "synth.metadata" - }, - { - "path": ".gitignore" - }, - { - "path": "codecov.yaml" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": "node_modules/uc.micro/package.json" - }, - { - "path": "node_modules/eastasianwidth/package.json" - }, - { - "path": "node_modules/defer-to-connect/package.json" - }, - { - "path": "node_modules/object-is/package.json" - }, - { - "path": "node_modules/is-arguments/package.json" - }, - { - "path": "node_modules/eventemitter3/package.json" - }, - { - "path": "node_modules/long/package.json" - }, - { - "path": "node_modules/lodash/package.json" - }, - { - "path": "node_modules/diff/package.json" - }, - { - "path": "node_modules/has-flag/package.json" - }, - { - "path": "node_modules/prelude-ls/package.json" - }, - { - "path": "node_modules/source-map/package.json" - }, - { - "path": "node_modules/spdx-correct/package.json" - }, - { - "path": "node_modules/normalize-url/package.json" - }, - { - "path": "node_modules/tmp/package.json" - }, - { - "path": "node_modules/got/package.json" - }, - { - "path": "node_modules/agent-base/package.json" - }, - { - "path": "node_modules/process-nextick-args/package.json" - }, - { - "path": "node_modules/google-gax/package.json" - }, - { - "path": "node_modules/next-tick/package.json" - }, - { - "path": "node_modules/hosted-git-info/package.json" - }, - { - "path": "node_modules/is-symbol/package.json" - }, - { - "path": "node_modules/once/package.json" - }, - { - "path": "node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/ansi-escapes/package.json" - }, - { - "path": "node_modules/gcp-metadata/package.json" - }, - { - "path": "node_modules/espower-loader/package.json" - }, - { - "path": "node_modules/validate-npm-package-license/package.json" - }, - { - "path": "node_modules/doctrine/package.json" - }, - { - "path": "node_modules/power-assert-context-formatter/package.json" - }, - { - "path": "node_modules/marked/package.json" - }, - { - "path": "node_modules/jsdoc/package.json" - }, - { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/flat-cache/package.json" - }, - { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/is-npm/package.json" - }, - { - "path": "node_modules/espower-location-detector/package.json" - }, - { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" - }, - { - "path": "node_modules/base64-js/package.json" - }, - { - "path": "node_modules/is-glob/package.json" - }, - { - "path": "node_modules/taffydb/package.json" - }, - { - "path": "node_modules/mocha/package.json" - }, - { - "path": "node_modules/mocha/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/mocha/node_modules/glob/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/mocha/node_modules/find-up/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/mocha/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs/package.json" - }, - { - "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/mocha/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/mocha/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/mocha/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ms/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-name/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/mocha/node_modules/cliui/package.json" - }, - { - "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/which/package.json" - }, - { - "path": "node_modules/mocha/node_modules/string-width/package.json" - }, - { - "path": "node_modules/mocha/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/minimist/package.json" - }, - { - "path": "node_modules/type/package.json" - }, - { - "path": "node_modules/yargs-unparser/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/css-select/package.json" - }, - { - "path": "node_modules/file-entry-cache/package.json" - }, - { - "path": "node_modules/he/package.json" - }, - { - "path": "node_modules/xmlcreate/package.json" - }, - { - "path": "node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/ecdsa-sig-formatter/package.json" - }, - { - "path": "node_modules/nice-try/package.json" - }, - { - "path": "node_modules/log-symbols/package.json" - }, - { - "path": "node_modules/object.getownpropertydescriptors/package.json" - }, - { - "path": "node_modules/@protobufjs/path/package.json" - }, - { - "path": "node_modules/@protobufjs/pool/package.json" - }, - { - "path": "node_modules/@protobufjs/float/package.json" - }, - { - "path": "node_modules/@protobufjs/aspromise/package.json" - }, - { - "path": "node_modules/@protobufjs/fetch/package.json" - }, - { - "path": "node_modules/@protobufjs/utf8/package.json" - }, - { - "path": "node_modules/@protobufjs/codegen/package.json" - }, - { - "path": "node_modules/@protobufjs/inquire/package.json" - }, - { - "path": "node_modules/@protobufjs/base64/package.json" - }, - { - "path": "node_modules/@protobufjs/eventemitter/package.json" - }, - { - "path": "node_modules/gtoken/package.json" - }, - { - "path": "node_modules/through2/package.json" - }, - { - "path": "node_modules/p-limit/package.json" - }, - { - "path": "node_modules/argparse/package.json" - }, - { - "path": "node_modules/eslint-scope/package.json" - }, - { - "path": "node_modules/extend/package.json" - }, - { - "path": "node_modules/is-path-inside/package.json" - }, - { - "path": "node_modules/destroy/package.json" - }, - { - "path": "node_modules/power-assert-formatter/package.json" - }, - { - "path": "node_modules/read-pkg-up/package.json" - }, - { - "path": "node_modules/global-dirs/package.json" - }, - { - "path": "node_modules/fast-deep-equal/package.json" - }, - { - "path": "node_modules/mimic-fn/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" - }, - { - "path": "node_modules/core-util-is/package.json" - }, - { - "path": "node_modules/string.prototype.trimright/package.json" - }, - { - "path": "node_modules/catharsis/package.json" - }, - { - "path": "node_modules/node-fetch/package.json" - }, - { - "path": "node_modules/linkinator/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/chalk/package.json" - }, - { - "path": "node_modules/fresh/package.json" - }, - { - "path": "node_modules/safer-buffer/package.json" - }, - { - "path": "node_modules/is-stream-ended/package.json" - }, - { - "path": "node_modules/mimic-response/package.json" - }, - { - "path": "node_modules/requizzle/package.json" - }, - { - "path": "node_modules/cacheable-request/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/figures/package.json" - }, - { - "path": "node_modules/power-assert-util-string-width/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" - }, - { - "path": "node_modules/abort-controller/package.json" - }, - { - "path": "node_modules/widest-line/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" - }, - { - "path": "node_modules/boxen/package.json" - }, - { - "path": "node_modules/boxen/node_modules/chalk/package.json" - }, - { - "path": "node_modules/glob/package.json" - }, - { - "path": "node_modules/buffer-equal-constant-time/package.json" - }, - { - "path": "node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/acorn-es7-plugin/package.json" - }, - { - "path": "node_modules/acorn/package.json" - }, - { - "path": "node_modules/spdx-expression-parse/package.json" - }, - { - "path": "node_modules/read-pkg/package.json" - }, - { - "path": "node_modules/read-pkg/node_modules/type-fest/package.json" - }, - { - "path": "node_modules/node-environment-flags/package.json" - }, - { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" - }, - { - "path": "node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/escallmatch/package.json" - }, - { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" - }, - { - "path": "node_modules/is-typedarray/package.json" - }, - { - "path": "node_modules/callsites/package.json" - }, - { - "path": "node_modules/safe-buffer/package.json" - }, - { - "path": "node_modules/type-fest/package.json" - }, - { - "path": "node_modules/espree/package.json" - }, - { - "path": "node_modules/server-destroy/package.json" - }, - { - "path": "node_modules/rc/package.json" - }, - { - "path": "node_modules/rc/node_modules/minimist/package.json" - }, - { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/fs.realpath/package.json" - }, - { - "path": "node_modules/es6-set/package.json" - }, - { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/js-yaml/package.json" - }, - { - "path": "node_modules/ajv/package.json" - }, - { - "path": "node_modules/prettier-linter-helpers/package.json" - }, - { - "path": "node_modules/p-finally/package.json" - }, - { - "path": "node_modules/redent/package.json" - }, - { - "path": "node_modules/diff-match-patch/package.json" - }, - { - "path": "node_modules/signal-exit/package.json" - }, - { - "path": "node_modules/core-js/package.json" - }, - { - "path": "node_modules/package-json/package.json" - }, - { - "path": "node_modules/package-json/node_modules/semver/package.json" - }, - { - "path": "node_modules/indexof/package.json" - }, - { - "path": "node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/p-try/package.json" - }, - { - "path": "node_modules/empower/package.json" - }, - { - "path": "node_modules/external-editor/package.json" - }, - { - "path": "node_modules/html-escaper/package.json" - }, - { - "path": "node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/regexpp/package.json" - }, - { - "path": "node_modules/p-cancelable/package.json" - }, - { - "path": "node_modules/set-blocking/package.json" - }, - { - "path": "node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/encodeurl/package.json" - }, - { - "path": "node_modules/table/package.json" - }, - { - "path": "node_modules/table/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/table/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/table/node_modules/string-width/package.json" - }, - { - "path": "node_modules/table/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/has-symbols/package.json" - }, - { - "path": "node_modules/escodegen/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/source-map/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/esprima/package.json" - }, - { - "path": "node_modules/unpipe/package.json" - }, - { - "path": "node_modules/dot-prop/package.json" - }, - { - "path": "node_modules/es-abstract/package.json" - }, - { - "path": "node_modules/update-notifier/package.json" - }, - { - "path": "node_modules/update-notifier/node_modules/chalk/package.json" - }, - { - "path": "node_modules/domutils/package.json" - }, - { - "path": "node_modules/find-up/package.json" - }, - { - "path": "node_modules/event-emitter/package.json" - }, - { - "path": "node_modules/parse-json/package.json" - }, - { - "path": "node_modules/linkify-it/package.json" - }, - { - "path": "node_modules/ignore/package.json" - }, - { - "path": "node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/etag/package.json" - }, - { - "path": "node_modules/empower-assert/package.json" - }, - { - "path": "node_modules/is-extglob/package.json" - }, - { - "path": "node_modules/json-bigint/package.json" - }, - { - "path": "node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/traverse/package.json" - }, - { - "path": "node_modules/escope/package.json" - }, - { - "path": "node_modules/prettier/package.json" - }, - { - "path": "node_modules/mime/package.json" - }, - { - "path": "node_modules/google-auth-library/package.json" - }, - { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" - }, - { - "path": "node_modules/string.prototype.trimleft/package.json" - }, - { - "path": "node_modules/get-stdin/package.json" - }, - { - "path": "node_modules/espower/package.json" - }, - { - "path": "node_modules/espower/node_modules/source-map/package.json" - }, - { - "path": "node_modules/minimatch/package.json" - }, - { - "path": "node_modules/json-buffer/package.json" - }, - { - "path": "node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/nth-check/package.json" - }, - { - "path": "node_modules/is-date-object/package.json" - }, - { - "path": "node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/onetime/package.json" - }, - { - "path": "node_modules/argv/package.json" - }, - { - "path": "node_modules/codecov/package.json" - }, - { - "path": "node_modules/uri-js/package.json" - }, - { - "path": "node_modules/power-assert-renderer-comparison/package.json" - }, - { - "path": "node_modules/locate-path/package.json" - }, - { - "path": "node_modules/text-table/package.json" - }, - { - "path": "node_modules/p-timeout/package.json" - }, - { - "path": "node_modules/progress/package.json" - }, - { - "path": "node_modules/es5-ext/package.json" - }, - { - "path": "node_modules/statuses/package.json" - }, - { - "path": "node_modules/markdown-it-anchor/package.json" - }, - { - "path": "node_modules/jsonexport/package.json" - }, - { - "path": "node_modules/domhandler/package.json" - }, - { - "path": "node_modules/mkdirp/package.json" - }, - { - "path": "node_modules/is-installed-globally/package.json" - }, - { - "path": "node_modules/http-cache-semantics/package.json" - }, - { - "path": "node_modules/empower-core/package.json" - }, - { - "path": "node_modules/string_decoder/package.json" - }, - { - "path": "node_modules/htmlparser2/package.json" - }, - { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/send/package.json" - }, - { - "path": "node_modules/send/node_modules/mime/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" - }, - { - "path": "node_modules/send/node_modules/ms/package.json" - }, - { - "path": "node_modules/convert-source-map/package.json" - }, - { - "path": "node_modules/js-tokens/package.json" - }, - { - "path": "node_modules/es6-weak-map/package.json" - }, - { - "path": "node_modules/array-filter/package.json" - }, - { - "path": "node_modules/es6-map/package.json" - }, - { - "path": "node_modules/to-readable-stream/package.json" - }, - { - "path": "node_modules/type-name/package.json" - }, - { - "path": "node_modules/regexp.prototype.flags/package.json" - }, - { - "path": "node_modules/deep-equal/package.json" - }, - { - "path": "node_modules/graceful-fs/package.json" - }, - { - "path": "node_modules/chalk/package.json" - }, - { - "path": "node_modules/chalk/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/chalk/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/chalk/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-name/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/write/package.json" - }, - { - "path": "node_modules/ext/package.json" - }, - { - "path": "node_modules/ext/node_modules/type/package.json" - }, - { - "path": "node_modules/yargs/package.json" - }, - { - "path": "node_modules/through/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" - }, - { - "path": "node_modules/parseurl/package.json" - }, - { - "path": "node_modules/setprototypeof/package.json" - }, - { - "path": "node_modules/jwa/package.json" - }, - { - "path": "node_modules/camelcase/package.json" - }, - { - "path": "node_modules/deep-extend/package.json" - }, - { - "path": "node_modules/inflight/package.json" - }, - { - "path": "node_modules/istanbul-reports/package.json" - }, - { - "path": "node_modules/es6-iterator/package.json" - }, - { - "path": "node_modules/run-async/package.json" - }, - { - "path": "node_modules/@bcoe/v8-coverage/package.json" - }, - { - "path": "node_modules/esquery/package.json" - }, - { - "path": "node_modules/resolve/package.json" - }, - { - "path": "node_modules/functional-red-black-tree/package.json" - }, - { - "path": "node_modules/inquirer/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/json-schema-traverse/package.json" - }, - { - "path": "node_modules/meow/package.json" - }, - { - "path": "node_modules/es-to-primitive/package.json" - }, - { - "path": "node_modules/ini/package.json" - }, - { - "path": "node_modules/call-signature/package.json" - }, - { - "path": "node_modules/dom-serializer/package.json" - }, - { - "path": "node_modules/on-finished/package.json" - }, - { - "path": "node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/ansi-colors/package.json" - }, - { - "path": "node_modules/end-of-stream/package.json" - }, - { - "path": "node_modules/require-main-filename/package.json" - }, - { - "path": "node_modules/supports-color/package.json" - }, - { - "path": "node_modules/eslint-visitor-keys/package.json" - }, - { - "path": "node_modules/get-caller-file/package.json" - }, - { - "path": "node_modules/brace-expansion/package.json" - }, - { - "path": "node_modules/ignore-walk/package.json" - }, - { - "path": "node_modules/urlgrey/package.json" - }, - { - "path": "node_modules/balanced-match/package.json" - }, - { - "path": "node_modules/markdown-it/package.json" - }, - { - "path": "node_modules/rxjs/package.json" - }, - { - "path": "node_modules/iconv-lite/package.json" - }, - { - "path": "node_modules/is-plain-obj/package.json" - }, - { - "path": "node_modules/fast-text-encoding/package.json" - }, - { - "path": "node_modules/os-tmpdir/package.json" - }, - { - "path": "node_modules/test-exclude/package.json" - }, - { - "path": "node_modules/resolve-from/package.json" - }, - { - "path": "node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/source-map-support/node_modules/source-map/package.json" - }, - { - "path": "node_modules/punycode/package.json" - }, - { - "path": "node_modules/ee-first/package.json" - }, - { - "path": "node_modules/p-locate/package.json" - }, - { - "path": "node_modules/@types/long/package.json" - }, - { - "path": "node_modules/@types/minimist/package.json" - }, - { - "path": "node_modules/@types/node/package.json" - }, - { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/@types/is-windows/package.json" - }, - { - "path": "node_modules/@types/fs-extra/package.json" - }, - { - "path": "node_modules/@types/color-name/package.json" - }, - { - "path": "node_modules/@types/normalize-package-data/package.json" - }, - { - "path": "node_modules/wide-align/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/is-promise/package.json" - }, - { - "path": "node_modules/spdx-exceptions/package.json" - }, - { - "path": "node_modules/slice-ansi/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-name/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/eslint-plugin-prettier/package.json" - }, - { - "path": "node_modules/decompress-response/package.json" - }, - { - "path": "node_modules/parent-module/package.json" - }, - { - "path": "node_modules/jsdoc-region-tag/package.json" - }, - { - "path": "node_modules/domelementtype/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/.travis.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/index.js" - }, - { - "path": "node_modules/typedarray-to-buffer/LICENSE" - }, - { - "path": "node_modules/typedarray-to-buffer/README.md" - }, - { - "path": "node_modules/typedarray-to-buffer/test/basic.js" - }, - { - "path": "node_modules/sprintf-js/package.json" - }, - { - "path": "node_modules/path-key/package.json" - }, - { - "path": "node_modules/isarray/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" - }, - { - "path": "node_modules/@grpc/proto-loader/package.json" - }, - { - "path": "node_modules/responselike/package.json" - }, - { - "path": "node_modules/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/minimist-options/package.json" - }, - { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" - }, - { - "path": "node_modules/latest-version/package.json" - }, - { - "path": "node_modules/amdefine/package.json" - }, - { - "path": "node_modules/estraverse/package.json" - }, - { - "path": "node_modules/http-errors/package.json" - }, - { - "path": "node_modules/term-size/package.json" - }, - { - "path": "node_modules/bluebird/package.json" - }, - { - "path": "node_modules/natural-compare/package.json" - }, - { - "path": "node_modules/xdg-basedir/package.json" - }, - { - "path": "node_modules/ansi-align/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/js2xmlparser/package.json" - }, - { - "path": "node_modules/teeny-request/package.json" - }, - { - "path": "node_modules/teeny-request/node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/espower-source/package.json" - }, - { - "path": "node_modules/espower-source/node_modules/acorn/package.json" - }, - { - "path": "node_modules/d/package.json" - }, - { - "path": "node_modules/is-stream/package.json" - }, - { - "path": "node_modules/debug/package.json" - }, - { - "path": "node_modules/espurify/package.json" - }, - { - "path": "node_modules/wrappy/package.json" - }, - { - "path": "node_modules/import-fresh/package.json" - }, - { - "path": "node_modules/eslint/package.json" - }, - { - "path": "node_modules/eslint/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" - }, - { - "path": "node_modules/eslint/node_modules/path-key/package.json" - }, - { - "path": "node_modules/eslint/node_modules/debug/package.json" - }, - { - "path": "node_modules/eslint/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/eslint/node_modules/which/package.json" - }, - { - "path": "node_modules/es6-promise/package.json" - }, - { - "path": "node_modules/is-yarn-global/package.json" - }, - { - "path": "node_modules/array-find/package.json" - }, - { - "path": "node_modules/imurmurhash/package.json" - }, - { - "path": "node_modules/globals/package.json" - }, - { - "path": "node_modules/is-ci/package.json" - }, - { - "path": "node_modules/mdurl/package.json" - }, - { - "path": "node_modules/error-ex/package.json" - }, - { - "path": "node_modules/is-url/package.json" - }, - { - "path": "node_modules/stream-shift/package.json" - }, - { - "path": "node_modules/ci-info/package.json" - }, - { - "path": "node_modules/path-exists/package.json" - }, - { - "path": "node_modules/esrecurse/package.json" - }, - { - "path": "node_modules/lru-cache/package.json" - }, - { - "path": "node_modules/trim-newlines/package.json" - }, - { - "path": "node_modules/json-parse-better-errors/package.json" - }, - { - "path": "node_modules/retry-request/package.json" - }, - { - "path": "node_modules/retry-request/node_modules/debug/package.json" - }, - { - "path": "node_modules/merge-estraverse-visitors/package.json" - }, - { - "path": "node_modules/arrify/package.json" - }, - { - "path": "node_modules/is-windows/package.json" - }, - { - "path": "node_modules/call-matcher/package.json" - }, - { - "path": "node_modules/furi/package.json" - }, - { - "path": "node_modules/v8-compile-cache/package.json" - }, - { - "path": "node_modules/decamelize/package.json" - }, - { - "path": "node_modules/jws/package.json" - }, - { - "path": "node_modules/unique-string/package.json" - }, - { - "path": "node_modules/css-what/package.json" - }, - { - "path": "node_modules/crypto-random-string/package.json" - }, - { - "path": "node_modules/url-parse-lax/package.json" - }, - { - "path": "node_modules/@istanbuljs/schema/package.json" - }, - { - "path": "node_modules/ms/package.json" - }, - { - "path": "node_modules/decamelize-keys/package.json" - }, - { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" - }, - { - "path": "node_modules/make-dir/package.json" - }, - { - "path": "node_modules/make-dir/node_modules/semver/package.json" - }, - { - "path": "node_modules/get-stream/package.json" - }, - { - "path": "node_modules/word-wrap/package.json" - }, - { - "path": "node_modules/keyv/package.json" - }, - { - "path": "node_modules/semver/package.json" - }, - { - "path": "node_modules/esutils/package.json" - }, - { - "path": "node_modules/intelli-espower-loader/package.json" - }, - { - "path": "node_modules/color-name/package.json" - }, - { - "path": "node_modules/object-keys/package.json" - }, - { - "path": "node_modules/event-target-shim/package.json" - }, - { - "path": "node_modules/stringifier/package.json" - }, - { - "path": "node_modules/write-file-atomic/package.json" - }, - { - "path": "node_modules/is-regex/package.json" - }, - { - "path": "node_modules/google-p12-pem/package.json" - }, - { - "path": "node_modules/v8-to-istanbul/package.json" - }, - { - "path": "node_modules/@szmarczak/http-timer/package.json" - }, - { - "path": "node_modules/growl/package.json" - }, - { - "path": "node_modules/flat/package.json" - }, - { - "path": "node_modules/path-is-absolute/package.json" - }, - { - "path": "node_modules/path-parse/package.json" - }, - { - "path": "node_modules/node-forge/package.json" - }, - { - "path": "node_modules/levn/package.json" - }, - { - "path": "node_modules/chardet/package.json" - }, - { - "path": "node_modules/lodash.camelcase/package.json" - }, - { - "path": "node_modules/walkdir/package.json" - }, - { - "path": "node_modules/foreground-child/package.json" - }, - { - "path": "node_modules/quick-lru/package.json" - }, - { - "path": "node_modules/serve-static/package.json" - }, - { - "path": "node_modules/which-module/package.json" - }, - { - "path": "node_modules/power-assert/package.json" - }, - { - "path": "node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/fast-levenshtein/package.json" - }, - { - "path": "node_modules/power-assert-context-traversal/package.json" - }, - { - "path": "node_modules/range-parser/package.json" - }, - { - "path": "node_modules/type-check/package.json" - }, - { - "path": "node_modules/normalize-package-data/package.json" - }, - { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" - }, - { - "path": "node_modules/registry-auth-token/package.json" - }, - { - "path": "node_modules/deep-is/package.json" - }, - { - "path": "node_modules/cli-boxes/package.json" - }, - { - "path": "node_modules/finalhandler/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/debug/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/ms/package.json" - }, - { - "path": "node_modules/optionator/package.json" - }, - { - "path": "node_modules/lodash.has/package.json" - }, - { - "path": "node_modules/xtend/package.json" - }, - { - "path": "node_modules/util-deprecate/package.json" - }, - { - "path": "node_modules/concat-map/package.json" - }, - { - "path": "node_modules/duplexify/package.json" - }, - { - "path": "node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/hard-rejection/package.json" - }, - { - "path": "node_modules/power-assert-renderer-file/package.json" - }, - { - "path": "node_modules/gaxios/package.json" - }, - { - "path": "node_modules/y18n/package.json" - }, - { - "path": "node_modules/clone-response/package.json" - }, - { - "path": "node_modules/is-obj/package.json" - }, - { - "path": "node_modules/toidentifier/package.json" - }, - { - "path": "node_modules/esprima/package.json" - }, - { - "path": "node_modules/is-callable/package.json" - }, - { - "path": "node_modules/camelcase-keys/package.json" - }, - { - "path": "node_modules/is-arrayish/package.json" - }, - { - "path": "node_modules/fast-diff/package.json" - }, - { - "path": "node_modules/configstore/package.json" - }, - { - "path": "node_modules/universal-deep-strict-equal/package.json" - }, - { - "path": "node_modules/power-assert-renderer-assertion/package.json" - }, - { - "path": "node_modules/glob-parent/package.json" - }, - { - "path": "node_modules/object.assign/package.json" - }, - { - "path": "node_modules/color-convert/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" - }, - { - "path": "node_modules/cliui/package.json" - }, - { - "path": "node_modules/cheerio/package.json" - }, - { - "path": "node_modules/flatted/package.json" - }, - { - "path": "node_modules/parse5/package.json" - }, - { - "path": "node_modules/power-assert-renderer-base/package.json" - }, - { - "path": "node_modules/es6-promisify/package.json" - }, - { - "path": "node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/indent-string/package.json" - }, - { - "path": "node_modules/tslib/package.json" - }, - { - "path": "node_modules/prepend-http/package.json" - }, - { - "path": "node_modules/fast-json-stable-stringify/package.json" - }, - { - "path": "node_modules/semver-diff/package.json" - }, - { - "path": "node_modules/semver-diff/node_modules/semver/package.json" - }, - { - "path": "node_modules/cli-width/package.json" - }, - { - "path": "node_modules/escape-html/package.json" - }, - { - "path": "node_modules/protobufjs/package.json" - }, - { - "path": "node_modules/protobufjs/cli/package.json" - }, - { - "path": "node_modules/protobufjs/cli/package-lock.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" - }, - { - "path": "node_modules/has/package.json" - }, - { - "path": "node_modules/boolbase/package.json" - }, - { - "path": "node_modules/@sindresorhus/is/package.json" - }, - { - "path": "node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/mute-stream/package.json" - }, - { - "path": "node_modules/p-queue/package.json" - }, - { - "path": "node_modules/cli-cursor/package.json" - }, - { - "path": "node_modules/bignumber.js/package.json" - }, - { - "path": "node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/require-directory/package.json" - }, - { - "path": "node_modules/uuid/package.json" - }, - { - "path": "node_modules/c8/package.json" - }, - { - "path": "node_modules/eslint-config-prettier/package.json" - }, - { - "path": "node_modules/function-bind/package.json" - }, - { - "path": "node_modules/istanbul-lib-report/package.json" - }, - { - "path": "node_modules/object-inspect/package.json" - }, - { - "path": "node_modules/entities/package.json" - }, - { - "path": "node_modules/define-properties/package.json" - }, - { - "path": "node_modules/has-yarn/package.json" - }, - { - "path": "node_modules/min-indent/package.json" - }, - { - "path": "node_modules/underscore/package.json" - }, - { - "path": "node_modules/power-assert-renderer-diagram/package.json" - }, - { - "path": "node_modules/browser-stdout/package.json" - }, - { - "path": "node_modules/registry-url/package.json" - }, - { - "path": "node_modules/which/package.json" - }, - { - "path": "node_modules/@babel/highlight/package.json" - }, - { - "path": "node_modules/@babel/code-frame/package.json" - }, - { - "path": "node_modules/@babel/parser/package.json" - }, - { - "path": "node_modules/strip-indent/package.json" - }, - { - "path": "node_modules/map-obj/package.json" - }, - { - "path": "node_modules/duplexer3/package.json" - }, - { - "path": "node_modules/isexe/package.json" - }, - { - "path": "node_modules/klaw/package.json" - }, - { - "path": "node_modules/inherits/package.json" - }, - { - "path": "node_modules/lodash.at/package.json" - }, - { - "path": "node_modules/pump/package.json" - }, - { - "path": "node_modules/spdx-license-ids/package.json" - }, - { - "path": "node_modules/depd/package.json" - }, - { - "path": "node_modules/import-lazy/package.json" - }, - { - "path": "node_modules/string-width/package.json" - }, - { - "path": "node_modules/lines-and-columns/package.json" - }, - { - "path": "node_modules/astral-regex/package.json" - }, - { - "path": "node_modules/rimraf/package.json" - }, - { - "path": "node_modules/restore-cursor/package.json" - }, - { - "path": "node_modules/yallist/package.json" - }, - { - "path": "node_modules/emoji-regex/package.json" - }, - { - "path": "system-test/.eslintrc.yml" - }, - { - "path": "system-test/no-tests.js" - }, - { - "path": ".git/config" - }, - { - "path": ".git/index" - }, - { - "path": ".git/packed-refs" - }, - { - "path": ".git/shallow" - }, - { - "path": ".git/HEAD" - }, - { - "path": ".git/refs/heads/autosynth" - }, - { - "path": ".git/refs/heads/master" - }, - { - "path": ".git/refs/remotes/origin/HEAD" - }, - { - "path": ".git/objects/pack/pack-d44569af94a96b3c438fb4b055c8ec60a5aea892.pack" - }, - { - "path": ".git/objects/pack/pack-d44569af94a96b3c438fb4b055c8ec60a5aea892.idx" - }, - { - "path": ".git/logs/HEAD" - }, - { - "path": ".git/logs/refs/heads/autosynth" - }, - { - "path": ".git/logs/refs/heads/master" - }, - { - "path": ".git/logs/refs/remotes/origin/HEAD" - }, - { - "path": "src/index.js" - }, - { - "path": "src/browser.js" - }, - { - "path": "src/v1/index.js" - }, - { - "path": "src/v1/asset_service_client.js" - }, - { - "path": "src/v1/asset_service_proto_list.json" - }, - { - "path": "src/v1/asset_service_client_config.json" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1/doc/google/cloud/asset/v1/doc_assets.js" - }, - { - "path": "src/v1/doc/google/cloud/asset/v1/doc_asset_service.js" - }, - { - "path": "src/v1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_empty.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v1beta1/index.js" - }, - { - "path": "src/v1beta1/asset_service_client.js" - }, - { - "path": "src/v1beta1/asset_service_proto_list.json" - }, - { - "path": "src/v1beta1/asset_service_client_config.json" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js" - }, - { - "path": "src/v1beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1p2beta1/index.js" - }, - { - "path": "src/v1p2beta1/asset_service_client.js" - }, - { - "path": "src/v1p2beta1/asset_service_proto_list.json" - }, - { - "path": "src/v1p2beta1/asset_service_client_config.json" - }, - { - "path": "src/v1p2beta1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js" - }, - { - "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js" - }, - { - "path": "src/v1p2beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1p2beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1p2beta1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1p2beta1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1p2beta1/doc/google/protobuf/doc_empty.js" - }, - { - "path": "src/v1p2beta1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1p2beta1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1p2beta1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.json" - }, - { - "path": "protos/google/cloud/asset/v1/assets.proto" - }, - { - "path": "protos/google/cloud/asset/v1/asset_service.proto" - }, - { - "path": "protos/google/cloud/asset/v1beta1/assets.proto" - }, - { - "path": "protos/google/cloud/asset/v1beta1/asset_service.proto" - }, - { - "path": "protos/google/cloud/asset/v1p2beta1/assets.proto" - }, - { - "path": "protos/google/cloud/asset/v1p2beta1/asset_service.proto" - }, - { - "path": "__pycache__/synth.cpython-36.pyc" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/release/common.cfg" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/updateFeed.js" - }, - { - "path": "samples/deleteFeed.js" - }, - { - "path": "samples/createFeed.js" - }, - { - "path": "samples/listFeeds.js" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/getFeed.js" - }, - { - "path": "samples/exportAssets.js" - }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/getBatchAssetHistory.js" - }, - { - "path": "samples/test/sample.test.js" - }, - { - "path": "test/gapic-v1.js" - }, - { - "path": "test/gapic-v1beta1.js" - }, - { - "path": "test/gapic-v1p2beta1.js" - } ] } \ No newline at end of file From 46427cb936022aa5ff0bf5faa3e8a41a7daab356 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 16 Jan 2020 17:23:28 -0800 Subject: [PATCH 161/429] docs: update license header --- packages/google-cloud-asset/src/browser.js | 2 +- .../google-cloud-asset/src/v1/asset_service_client.js | 2 +- .../v1/doc/google/cloud/asset/v1/doc_asset_service.js | 2 +- .../src/v1/doc/google/cloud/asset/v1/doc_assets.js | 2 +- .../src/v1/doc/google/iam/v1/doc_policy.js | 2 +- .../src/v1/doc/google/longrunning/doc_operations.js | 2 +- .../src/v1/doc/google/protobuf/doc_any.js | 2 +- .../src/v1/doc/google/protobuf/doc_empty.js | 2 +- .../src/v1/doc/google/protobuf/doc_field_mask.js | 2 +- .../src/v1/doc/google/protobuf/doc_struct.js | 2 +- .../src/v1/doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1/doc/google/rpc/doc_status.js | 2 +- .../src/v1/doc/google/type/doc_expr.js | 2 +- packages/google-cloud-asset/src/v1/index.js | 2 +- .../src/v1beta1/asset_service_client.js | 2 +- .../google/cloud/asset/v1beta1/doc_asset_service.js | 2 +- .../doc/google/cloud/asset/v1beta1/doc_assets.js | 2 +- .../src/v1beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../v1beta1/doc/google/longrunning/doc_operations.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_any.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_struct.js | 2 +- .../src/v1beta1/doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1beta1/doc/google/rpc/doc_status.js | 2 +- .../src/v1beta1/doc/google/type/doc_expr.js | 2 +- packages/google-cloud-asset/src/v1beta1/index.js | 2 +- .../src/v1p2beta1/asset_service_client.js | 2 +- .../google/cloud/asset/v1p2beta1/doc_asset_service.js | 2 +- .../doc/google/cloud/asset/v1p2beta1/doc_assets.js | 2 +- .../src/v1p2beta1/doc/google/iam/v1/doc_policy.js | 2 +- .../v1p2beta1/doc/google/longrunning/doc_operations.js | 2 +- .../src/v1p2beta1/doc/google/protobuf/doc_any.js | 2 +- .../src/v1p2beta1/doc/google/protobuf/doc_empty.js | 2 +- .../v1p2beta1/doc/google/protobuf/doc_field_mask.js | 2 +- .../src/v1p2beta1/doc/google/protobuf/doc_struct.js | 2 +- .../src/v1p2beta1/doc/google/protobuf/doc_timestamp.js | 2 +- .../src/v1p2beta1/doc/google/rpc/doc_status.js | 2 +- .../src/v1p2beta1/doc/google/type/doc_expr.js | 2 +- packages/google-cloud-asset/src/v1p2beta1/index.js | 2 +- packages/google-cloud-asset/synth.metadata | 10 +++++----- packages/google-cloud-asset/test/gapic-v1.js | 2 +- packages/google-cloud-asset/test/gapic-v1beta1.js | 2 +- packages/google-cloud-asset/test/gapic-v1p2beta1.js | 2 +- packages/google-cloud-asset/webpack.config.js | 2 +- 43 files changed, 47 insertions(+), 47 deletions(-) diff --git a/packages/google-cloud-asset/src/browser.js b/packages/google-cloud-asset/src/browser.js index ddbcd7ecb9a..68dc62d25d6 100644 --- a/packages/google-cloud-asset/src/browser.js +++ b/packages/google-cloud-asset/src/browser.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js index 5d2cabbacb4..4f7841a51ac 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1/asset_service_client.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js index 4101467945d..4fdebc66c6b 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js index 559a0ee2279..3bea7af7cbf 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js index 606cdf98cad..f2ac79a7afa 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js index 5aa806fd340..099e418d620 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js index cdd2fc80e49..813682aa336 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js index 0b446dd9ce4..1e3961d6609 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js index 011207b8626..59e745f36c2 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js index ae7e4ef1ff6..a143b9a6d2d 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js index c457acc0c7d..ad801cc9a10 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js index 432ab6bb928..80ec5037662 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js index 421a7ee9e6a..c185edde52f 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js +++ b/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/index.js b/packages/google-cloud-asset/src/v1/index.js index 11b31911e6a..501c92ee4cf 100644 --- a/packages/google-cloud-asset/src/v1/index.js +++ b/packages/google-cloud-asset/src/v1/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js index 41da17c3fdb..5f534962327 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js index df4afe7bded..cf237147bba 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js index 4b1911b8355..b7ea3599947 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js index 606cdf98cad..f2ac79a7afa 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js index 5aa806fd340..099e418d620 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js index cdd2fc80e49..813682aa336 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js index ae7e4ef1ff6..a143b9a6d2d 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js index c457acc0c7d..ad801cc9a10 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js index 432ab6bb928..80ec5037662 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js index 421a7ee9e6a..c185edde52f 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/index.js b/packages/google-cloud-asset/src/v1beta1/index.js index 11b31911e6a..501c92ee4cf 100644 --- a/packages/google-cloud-asset/src/v1beta1/index.js +++ b/packages/google-cloud-asset/src/v1beta1/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js index 1830f9aabe7..e04ab89f44f 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js index 7782d3b831d..4dcaef87ca5 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js index 39fddb4ad45..03eedbc2aa6 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js index 606cdf98cad..f2ac79a7afa 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js index 5aa806fd340..099e418d620 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js index cdd2fc80e49..813682aa336 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js index 0b446dd9ce4..1e3961d6609 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js index 011207b8626..59e745f36c2 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js index ae7e4ef1ff6..a143b9a6d2d 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js index c457acc0c7d..ad801cc9a10 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js index 432ab6bb928..80ec5037662 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js index 421a7ee9e6a..c185edde52f 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/index.js b/packages/google-cloud-asset/src/v1p2beta1/index.js index 11b31911e6a..501c92ee4cf 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.js +++ b/packages/google-cloud-asset/src/v1p2beta1/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 76c8b82e57f..d5781b413c6 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2020-01-13T12:09:26.166607Z", + "updateTime": "2020-01-15T12:09:35.835824Z", "sources": [ { "generator": { "name": "artman", - "version": "0.43.0", - "dockerImage": "googleapis/artman@sha256:264654a37596a44b0668b8ce6ac41082d713f6ee150b3fc6425fa78cc64e4f20" + "version": "0.44.0", + "dockerImage": "googleapis/artman@sha256:10a6d0342b8d62544810ac5ad86c3b21049ec0696608ac60175da8e513234344" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68", - "internalRef": "289413169" + "sha": "d99df0d67057a233c711187e0689baa4f8e6333d", + "internalRef": "289709813" } }, { diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js index 519f9a53cfd..38624f8f70c 100644 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ b/packages/google-cloud-asset/test/gapic-v1.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-v1beta1.js index d7f8f74405d..a06ab6d3ebc 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1beta1.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-v1p2beta1.js b/packages/google-cloud-asset/test/gapic-v1p2beta1.js index e1fbc7d46dc..8e90dd2a873 100644 --- a/packages/google-cloud-asset/test/gapic-v1p2beta1.js +++ b/packages/google-cloud-asset/test/gapic-v1p2beta1.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js index 12c1d1b4116..03328fdf838 100644 --- a/packages/google-cloud-asset/webpack.config.js +++ b/packages/google-cloud-asset/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. From d6ada26a822da361fdaf59bc97377e8325468b55 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 Jan 2020 16:24:01 -0800 Subject: [PATCH 162/429] chore: clear synth.metadata --- packages/google-cloud-asset/synth.metadata | 59 ---------------------- 1 file changed, 59 deletions(-) delete mode 100644 packages/google-cloud-asset/synth.metadata diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata deleted file mode 100644 index d5781b413c6..00000000000 --- a/packages/google-cloud-asset/synth.metadata +++ /dev/null @@ -1,59 +0,0 @@ -{ - "updateTime": "2020-01-15T12:09:35.835824Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.0", - "dockerImage": "googleapis/artman@sha256:10a6d0342b8d62544810ac5ad86c3b21049ec0696608ac60175da8e513234344" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d99df0d67057a233c711187e0689baa4f8e6333d", - "internalRef": "289709813" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1p2beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" - } - } - ] -} \ No newline at end of file From 26657966268308eba37ab2d86a097f4c157af595 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Jan 2020 21:23:57 -0800 Subject: [PATCH 163/429] chore: regenerate synth.metadata (#249) --- .../src/v1/doc/google/rpc/doc_status.js | 60 +-- .../src/v1beta1/doc/google/rpc/doc_status.js | 60 +-- .../v1p2beta1/doc/google/rpc/doc_status.js | 60 +-- packages/google-cloud-asset/synth.metadata | 454 ++++++++++++++++++ 4 files changed, 472 insertions(+), 162 deletions(-) create mode 100644 packages/google-cloud-asset/synth.metadata diff --git a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js index 80ec5037662..750e0af7689 100644 --- a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js @@ -18,67 +18,19 @@ /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * used by [gRPC](https://github.com/grpc). Each `Status` message contains + * three pieces of data: error code, error message, and error details. * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error - * message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes - * if needed. The error message should be a developer-facing English message - * that helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. + * You can find out more about this error model and how to work with it in the + * [API Design Guide](https://cloud.google.com/apis/design/errors). * * @property {number} code - * The status code, which should be an enum value of - * google.rpc.Code. + * The status code, which should be an enum value of google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized - * by the client. + * google.rpc.Status.details field, or localized by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js index 80ec5037662..750e0af7689 100644 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js @@ -18,67 +18,19 @@ /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * used by [gRPC](https://github.com/grpc). Each `Status` message contains + * three pieces of data: error code, error message, and error details. * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error - * message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes - * if needed. The error message should be a developer-facing English message - * that helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. + * You can find out more about this error model and how to work with it in the + * [API Design Guide](https://cloud.google.com/apis/design/errors). * * @property {number} code - * The status code, which should be an enum value of - * google.rpc.Code. + * The status code, which should be an enum value of google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized - * by the client. + * google.rpc.Status.details field, or localized by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js index 80ec5037662..750e0af7689 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js @@ -18,67 +18,19 @@ /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * used by [gRPC](https://github.com/grpc). Each `Status` message contains + * three pieces of data: error code, error message, and error details. * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error - * message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes - * if needed. The error message should be a developer-facing English message - * that helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. + * You can find out more about this error model and how to work with it in the + * [API Design Guide](https://cloud.google.com/apis/design/errors). * * @property {number} code - * The status code, which should be an enum value of - * google.rpc.Code. + * The status code, which should be an enum value of google.rpc.Code. * * @property {string} message * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized - * by the client. + * google.rpc.Status.details field, or localized by the client. * * @property {Object[]} details * A list of messages that carry the error details. There is a common set of diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata new file mode 100644 index 00000000000..eecf21d263a --- /dev/null +++ b/packages/google-cloud-asset/synth.metadata @@ -0,0 +1,454 @@ +{ + "updateTime": "2020-01-24T12:10:29.719926Z", + "sources": [ + { + "generator": { + "name": "artman", + "version": "0.44.1", + "dockerImage": "googleapis/artman@sha256:5599b61e56a372d21b671969ee915fbca0f6c3a0daaeb898d01f8f685f1bbc8b" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", + "internalRef": "291240093" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1.yaml" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p2beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" + } + } + ], + "newFiles": [ + { + "path": ".eslintignore" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".gitignore" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".nycrc" + }, + { + "path": ".prettierignore" + }, + { + "path": ".prettierrc" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "LICENSE" + }, + { + "path": "README.md" + }, + { + "path": "codecov.yaml" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "package.json" + }, + { + "path": "protos/google/cloud/asset/v1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1/assets.proto" + }, + { + "path": "protos/google/cloud/asset/v1beta1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1beta1/assets.proto" + }, + { + "path": "protos/google/cloud/asset/v1p2beta1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1p2beta1/assets.proto" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.json" + }, + { + "path": "renovate.json" + }, + { + "path": "samples/.eslintrc.yml" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/createFeed.js" + }, + { + "path": "samples/deleteFeed.js" + }, + { + "path": "samples/exportAssets.js" + }, + { + "path": "samples/getBatchAssetHistory.js" + }, + { + "path": "samples/getFeed.js" + }, + { + "path": "samples/listFeeds.js" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/test/sample.test.js" + }, + { + "path": "samples/updateFeed.js" + }, + { + "path": "src/browser.js" + }, + { + "path": "src/index.js" + }, + { + "path": "src/v1/asset_service_client.js" + }, + { + "path": "src/v1/asset_service_client_config.json" + }, + { + "path": "src/v1/asset_service_proto_list.json" + }, + { + "path": "src/v1/doc/google/cloud/asset/v1/doc_asset_service.js" + }, + { + "path": "src/v1/doc/google/cloud/asset/v1/doc_assets.js" + }, + { + "path": "src/v1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_empty.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1/index.js" + }, + { + "path": "src/v1beta1/asset_service_client.js" + }, + { + "path": "src/v1beta1/asset_service_client_config.json" + }, + { + "path": "src/v1beta1/asset_service_proto_list.json" + }, + { + "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js" + }, + { + "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js" + }, + { + "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1beta1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1beta1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1beta1/index.js" + }, + { + "path": "src/v1p2beta1/asset_service_client.js" + }, + { + "path": "src/v1p2beta1/asset_service_client_config.json" + }, + { + "path": "src/v1p2beta1/asset_service_proto_list.json" + }, + { + "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js" + }, + { + "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js" + }, + { + "path": "src/v1p2beta1/doc/google/iam/v1/doc_policy.js" + }, + { + "path": "src/v1p2beta1/doc/google/longrunning/doc_operations.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_any.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_empty.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_field_mask.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_struct.js" + }, + { + "path": "src/v1p2beta1/doc/google/protobuf/doc_timestamp.js" + }, + { + "path": "src/v1p2beta1/doc/google/rpc/doc_status.js" + }, + { + "path": "src/v1p2beta1/doc/google/type/doc_expr.js" + }, + { + "path": "src/v1p2beta1/index.js" + }, + { + "path": "synth.py" + }, + { + "path": "system-test/.eslintrc.yml" + }, + { + "path": "system-test/no-tests.js" + }, + { + "path": "test/gapic-v1.js" + }, + { + "path": "test/gapic-v1beta1.js" + }, + { + "path": "test/gapic-v1p2beta1.js" + }, + { + "path": "webpack.config.js" + } + ] +} \ No newline at end of file From dd7077f441ddaf42f54aa826669e80126f8d31bc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 28 Jan 2020 12:06:52 -0800 Subject: [PATCH 164/429] fix: enum, bytes, and Long types now accept strings --- .../google-cloud-asset/protos/protos.d.ts | 104 +++++++++--------- packages/google-cloud-asset/synth.metadata | 14 ++- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 5b9c16a1843..4b13f0dd1b1 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -210,7 +210,7 @@ export namespace google { assetTypes?: (string[]|null); /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|null); + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); /** ExportAssetsRequest outputConfig */ outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); @@ -235,7 +235,7 @@ export namespace google { public assetTypes: string[]; /** ExportAssetsRequest contentType. */ - public contentType: google.cloud.asset.v1.ContentType; + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); /** ExportAssetsRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); @@ -417,7 +417,7 @@ export namespace google { assetNames?: (string[]|null); /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|null); + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); /** BatchGetAssetsHistoryRequest readTimeWindow */ readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); @@ -439,7 +439,7 @@ export namespace google { public assetNames: string[]; /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: google.cloud.asset.v1.ContentType; + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); /** BatchGetAssetsHistoryRequest readTimeWindow. */ public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); @@ -1668,7 +1668,7 @@ export namespace google { assetTypes?: (string[]|null); /** Feed contentType */ - contentType?: (google.cloud.asset.v1.ContentType|null); + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); /** Feed feedOutputConfig */ feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); @@ -1693,7 +1693,7 @@ export namespace google { public assetTypes: string[]; /** Feed contentType. */ - public contentType: google.cloud.asset.v1.ContentType; + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); /** Feed feedOutputConfig. */ public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); @@ -2284,7 +2284,7 @@ export namespace google { assetTypes?: (string[]|null); /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|null); + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); /** ExportAssetsRequest outputConfig */ outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); @@ -2309,7 +2309,7 @@ export namespace google { public assetTypes: string[]; /** ExportAssetsRequest contentType. */ - public contentType: google.cloud.asset.v1beta1.ContentType; + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); /** ExportAssetsRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); @@ -2491,7 +2491,7 @@ export namespace google { assetNames?: (string[]|null); /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|null); + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); /** BatchGetAssetsHistoryRequest readTimeWindow */ readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); @@ -2513,7 +2513,7 @@ export namespace google { public assetNames: string[]; /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: google.cloud.asset.v1beta1.ContentType; + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); /** BatchGetAssetsHistoryRequest readTimeWindow. */ public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); @@ -3486,7 +3486,7 @@ export namespace google { assetTypes?: (string[]|null); /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|null); + contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); /** ExportAssetsRequest outputConfig */ outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); @@ -3511,7 +3511,7 @@ export namespace google { public assetTypes: string[]; /** ExportAssetsRequest contentType. */ - public contentType: google.cloud.asset.v1p2beta1.ContentType; + public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); /** ExportAssetsRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); @@ -3693,7 +3693,7 @@ export namespace google { assetNames?: (string[]|null); /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|null); + contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); /** BatchGetAssetsHistoryRequest readTimeWindow */ readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); @@ -3715,7 +3715,7 @@ export namespace google { public assetNames: string[]; /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: google.cloud.asset.v1p2beta1.ContentType; + public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); /** BatchGetAssetsHistoryRequest readTimeWindow. */ public readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); @@ -4945,7 +4945,7 @@ export namespace google { assetTypes?: (string[]|null); /** Feed contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|null); + contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); /** Feed feedOutputConfig */ feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); @@ -4970,7 +4970,7 @@ export namespace google { public assetTypes: string[]; /** Feed contentType. */ - public contentType: google.cloud.asset.v1p2beta1.ContentType; + public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); /** Feed feedOutputConfig. */ public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); @@ -5260,7 +5260,7 @@ export namespace google { iamPolicy?: (google.iam.v1.IPolicy|null); /** Asset iamPolicyName */ - iamPolicyName?: (Uint8Array|null); + iamPolicyName?: (Uint8Array|string|null); /** Asset ancestors */ ancestors?: (string[]|null); @@ -5288,7 +5288,7 @@ export namespace google { public iamPolicy?: (google.iam.v1.IPolicy|null); /** Asset iamPolicyName. */ - public iamPolicyName: Uint8Array; + public iamPolicyName: (Uint8Array|string); /** Asset ancestors. */ public ancestors: string[]; @@ -5858,7 +5858,7 @@ export namespace google { nameField?: (string|null); /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); /** ResourceDescriptor plural */ plural?: (string|null); @@ -5886,7 +5886,7 @@ export namespace google { public nameField: string; /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); /** ResourceDescriptor plural. */ public plural: string; @@ -6766,10 +6766,10 @@ export namespace google { number?: (number|null); /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); /** FieldDescriptorProto typeName */ typeName?: (string|null); @@ -6806,10 +6806,10 @@ export namespace google { public number: number; /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); /** FieldDescriptorProto typeName. */ public typeName: string; @@ -7584,7 +7584,7 @@ export namespace google { javaStringCheckUtf8?: (boolean|null); /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); /** FileOptions goPackage */ goPackage?: (string|null); @@ -7660,7 +7660,7 @@ export namespace google { public javaStringCheckUtf8: boolean; /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); /** FileOptions goPackage. */ public goPackage: string; @@ -7909,13 +7909,13 @@ export namespace google { interface IFieldOptions { /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); /** FieldOptions packed */ packed?: (boolean|null); /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); /** FieldOptions lazy */ lazy?: (boolean|null); @@ -7946,13 +7946,13 @@ export namespace google { constructor(properties?: google.protobuf.IFieldOptions); /** FieldOptions ctype. */ - public ctype: google.protobuf.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; + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); /** FieldOptions lazy. */ public lazy: boolean; @@ -8451,7 +8451,7 @@ export namespace google { deprecated?: (boolean|null); /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -8479,7 +8479,7 @@ export namespace google { public deprecated: boolean; /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); /** MethodOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -8575,16 +8575,16 @@ export namespace google { identifierValue?: (string|null); /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); + positiveIntValue?: (number|Long|string|null); /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); + negativeIntValue?: (number|Long|string|null); /** UninterpretedOption doubleValue */ doubleValue?: (number|null); /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); + stringValue?: (Uint8Array|string|null); /** UninterpretedOption aggregateValue */ aggregateValue?: (string|null); @@ -8606,16 +8606,16 @@ export namespace google { public identifierValue: string; /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); + public positiveIntValue: (number|Long|string); /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); + public negativeIntValue: (number|Long|string); /** UninterpretedOption doubleValue. */ public doubleValue: number; /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; + public stringValue: (Uint8Array|string); /** UninterpretedOption aggregateValue. */ public aggregateValue: string; @@ -9205,7 +9205,7 @@ export namespace google { type_url?: (string|null); /** Any value */ - value?: (Uint8Array|null); + value?: (Uint8Array|string|null); } /** Represents an Any. */ @@ -9221,7 +9221,7 @@ export namespace google { public type_url: string; /** Any value. */ - public value: Uint8Array; + public value: (Uint8Array|string); /** * Creates a new Any instance using the specified properties. @@ -9388,7 +9388,7 @@ export namespace google { interface IValue { /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue */ numberValue?: (number|null); @@ -9416,7 +9416,7 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue: google.protobuf.NullValue; + public nullValue: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue); /** Value numberValue. */ public numberValue: number; @@ -9606,7 +9606,7 @@ export namespace google { interface ITimestamp { /** Timestamp seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Timestamp nanos */ nanos?: (number|null); @@ -9622,7 +9622,7 @@ export namespace google { constructor(properties?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Timestamp nanos. */ public nanos: number; @@ -9702,7 +9702,7 @@ export namespace google { interface IDuration { /** Duration seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Duration nanos */ nanos?: (number|null); @@ -9718,7 +9718,7 @@ export namespace google { constructor(properties?: google.protobuf.IDuration); /** Duration seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Duration nanos. */ public nanos: number; @@ -9985,7 +9985,7 @@ export namespace google { bindings?: (google.iam.v1.IBinding[]|null); /** Policy etag */ - etag?: (Uint8Array|null); + etag?: (Uint8Array|string|null); } /** Represents a Policy. */ @@ -10004,7 +10004,7 @@ export namespace google { public bindings: google.iam.v1.IBinding[]; /** Policy etag. */ - public etag: Uint8Array; + public etag: (Uint8Array|string); /** * Creates a new Policy instance using the specified properties. @@ -10279,7 +10279,7 @@ export namespace google { interface IBindingDelta { /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|null); + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); /** BindingDelta role */ role?: (string|null); @@ -10301,7 +10301,7 @@ export namespace google { constructor(properties?: google.iam.v1.IBindingDelta); /** BindingDelta action. */ - public action: google.iam.v1.BindingDelta.Action; + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); /** BindingDelta role. */ public role: string; @@ -10397,7 +10397,7 @@ export namespace google { interface IAuditConfigDelta { /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|null); + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); /** AuditConfigDelta service */ service?: (string|null); @@ -10419,7 +10419,7 @@ export namespace google { constructor(properties?: google.iam.v1.IAuditConfigDelta); /** AuditConfigDelta action. */ - public action: google.iam.v1.AuditConfigDelta.Action; + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); /** AuditConfigDelta service. */ public service: string; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index eecf21d263a..71de83499c7 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-01-24T12:10:29.719926Z", + "updateTime": "2020-01-28T12:09:25.073655Z", "sources": [ { "generator": { "name": "artman", - "version": "0.44.1", - "dockerImage": "googleapis/artman@sha256:5599b61e56a372d21b671969ee915fbca0f6c3a0daaeb898d01f8f685f1bbc8b" + "version": "0.44.3", + "dockerImage": "googleapis/artman@sha256:62b8b29acaae54b06a4183aa772e65b106e92d4bc466eb4db07953ab78bdb90c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", - "internalRef": "291240093" + "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", + "internalRef": "291821782", + "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" } }, { @@ -429,6 +430,9 @@ { "path": "src/v1p2beta1/index.js" }, + { + "path": "synth.metadata" + }, { "path": "synth.py" }, From 94448c67d600b5adb46fbf45c8453adff91aea33 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2020 14:20:21 -0800 Subject: [PATCH 165/429] chore: release 1.6.1 (#252) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 4f19750eb57..79de3c99827 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [1.6.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.6.0...v1.6.1) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([21d58e1](https://www.github.com/googleapis/nodejs-asset/commit/21d58e1398b9af89a632083fa37e29a2157f3992)) + ## [1.6.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.5.0...v1.6.0) (2020-01-06) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 3b91ed0f445..9b8af00a5a8 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.6.0", + "version": "1.6.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index b700c06f935..00cd9a07c37 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.6.0", + "@google-cloud/asset": "^1.6.1", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^15.0.0" From 3b5d06c01db832f4a96db014520cfa4894622e5c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 30 Jan 2020 11:36:37 -0800 Subject: [PATCH 166/429] feat!: converts library to TypeScript adding v1p1beta1 surface (#250) BREAKING CHANGE: removes projectPath helper, instead use "projects/${project}". --- packages/google-cloud-asset/.jsdoc.js | 2 +- packages/google-cloud-asset/README.md | 2 +- packages/google-cloud-asset/package.json | 39 +- .../cloud/asset/v1beta1/asset_service.proto | 47 +- .../google/cloud/asset/v1beta1/assets.proto | 9 +- .../cloud/asset/v1p1beta1/asset_service.proto | 234 + .../google/cloud/asset/v1p1beta1/assets.proto | 78 + .../cloud/asset/v1p2beta1/asset_service.proto | 229 +- .../google/cloud/asset/v1p2beta1/assets.proto | 13 +- .../google/cloud/common_resources.proto | 52 + .../google-cloud-asset/protos/protos.d.ts | 5903 +++++----- packages/google-cloud-asset/protos/protos.js | 9517 ++++++++++------- .../google-cloud-asset/protos/protos.json | 968 +- .../google-cloud-asset/samples/quickstart.js | 2 +- packages/google-cloud-asset/src/index.js | 116 - packages/google-cloud-asset/src/index.ts | 27 + .../src/v1/asset_service_client.js | 868 -- .../src/v1/asset_service_client.ts | 1053 ++ .../src/v1/asset_service_client_config.json | 25 +- .../src/v1/asset_service_proto_list.json | 1 + .../cloud/asset/v1/doc_asset_service.js | 465 - .../doc/google/cloud/asset/v1/doc_assets.js | 156 - .../src/v1/doc/google/iam/v1/doc_policy.js | 167 - .../doc/google/longrunning/doc_operations.js | 63 - .../src/v1/doc/google/protobuf/doc_any.js | 137 - .../src/v1/doc/google/protobuf/doc_empty.js | 34 - .../v1/doc/google/protobuf/doc_field_mask.js | 228 - .../src/v1/doc/google/protobuf/doc_struct.js | 112 - .../v1/doc/google/protobuf/doc_timestamp.js | 117 - .../src/v1/doc/google/rpc/doc_status.js | 47 - .../src/v1/doc/google/type/doc_expr.js | 51 - .../src/{browser.js => v1/index.ts} | 14 +- ...vice_client.js => asset_service_client.ts} | 586 +- .../v1beta1/asset_service_client_config.json | 14 +- .../src/v1beta1/asset_service_proto_list.json | 1 + .../cloud/asset/v1beta1/doc_asset_service.js | 202 - .../google/cloud/asset/v1beta1/doc_assets.js | 148 - .../v1beta1/doc/google/iam/v1/doc_policy.js | 167 - .../doc/google/longrunning/doc_operations.js | 63 - .../v1beta1/doc/google/protobuf/doc_any.js | 137 - .../v1beta1/doc/google/protobuf/doc_struct.js | 112 - .../doc/google/protobuf/doc_timestamp.js | 117 - .../src/v1beta1/doc/google/rpc/doc_status.js | 47 - .../src/v1beta1/doc/google/type/doc_expr.js | 51 - .../{v1p2beta1/index.js => v1beta1/index.ts} | 12 +- .../src/v1p1beta1/asset_service_client.ts | 909 ++ .../asset_service_client_config.json | 46 + .../v1p1beta1/asset_service_proto_list.json | 4 + .../src/{v1/index.js => v1p1beta1/index.ts} | 12 +- .../src/v1p2beta1/asset_service_client.js | 841 -- .../src/v1p2beta1/asset_service_client.ts | 793 ++ .../asset_service_client_config.json | 30 +- .../v1p2beta1/asset_service_proto_list.json | 1 + .../asset/v1p2beta1/doc_asset_service.js | 469 - .../cloud/asset/v1p2beta1/doc_assets.js | 167 - .../v1p2beta1/doc/google/iam/v1/doc_policy.js | 167 - .../doc/google/longrunning/doc_operations.js | 63 - .../v1p2beta1/doc/google/protobuf/doc_any.js | 137 - .../doc/google/protobuf/doc_empty.js | 34 - .../doc/google/protobuf/doc_field_mask.js | 228 - .../doc/google/protobuf/doc_struct.js | 112 - .../doc/google/protobuf/doc_timestamp.js | 117 - .../v1p2beta1/doc/google/rpc/doc_status.js | 47 - .../src/v1p2beta1/doc/google/type/doc_expr.js | 51 - .../{v1beta1/index.js => v1p2beta1/index.ts} | 12 +- packages/google-cloud-asset/synth.metadata | 228 +- packages/google-cloud-asset/synth.py | 44 +- .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 25 + .../google-cloud-asset/system-test/install.ts | 51 + .../system-test/no-tests.js | 15 - ...v1p2beta1.js => gapic-asset_service-v1.ts} | 540 +- ...eta1.js => gapic-asset_service-v1beta1.ts} | 300 +- .../test/gapic-asset_service-v1p1beta1.ts | 298 + .../test/gapic-asset_service-v1p2beta1.ts | 320 + packages/google-cloud-asset/test/gapic-v1.js | 538 - packages/google-cloud-asset/tsconfig.json | 19 + packages/google-cloud-asset/tslint.json | 3 + packages/google-cloud-asset/webpack.config.js | 40 +- 79 files changed, 14137 insertions(+), 14984 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/common_resources.proto delete mode 100644 packages/google-cloud-asset/src/index.js create mode 100644 packages/google-cloud-asset/src/index.ts delete mode 100644 packages/google-cloud-asset/src/v1/asset_service_client.js create mode 100644 packages/google-cloud-asset/src/v1/asset_service_client.ts delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js delete mode 100644 packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js rename packages/google-cloud-asset/src/{browser.js => v1/index.ts} (66%) rename packages/google-cloud-asset/src/v1beta1/{asset_service_client.js => asset_service_client.ts} (53%) delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js delete mode 100644 packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js rename packages/google-cloud-asset/src/{v1p2beta1/index.js => v1beta1/index.ts} (66%) create mode 100644 packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts create mode 100644 packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json create mode 100644 packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json rename packages/google-cloud-asset/src/{v1/index.js => v1p1beta1/index.ts} (66%) delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js create mode 100644 packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js delete mode 100644 packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js rename packages/google-cloud-asset/src/{v1beta1/index.js => v1p2beta1/index.ts} (66%) create mode 100644 packages/google-cloud-asset/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-asset/system-test/install.ts delete mode 100644 packages/google-cloud-asset/system-test/no-tests.js rename packages/google-cloud-asset/test/{gapic-v1p2beta1.js => gapic-asset_service-v1.ts} (54%) rename packages/google-cloud-asset/test/{gapic-v1beta1.js => gapic-asset_service-v1beta1.ts} (52%) create mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts create mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts delete mode 100644 packages/google-cloud-asset/test/gapic-v1.js create mode 100644 packages/google-cloud-asset/tsconfig.json create mode 100644 packages/google-cloud-asset/tslint.json diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index e662e8e8ea1..970aa2e9594 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -31,7 +31,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 145e26c615e..380d1e3aa20 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -62,7 +62,7 @@ npm install @google-cloud/asset async function quickstart() { const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); + const projectResource = `projects/${projectId}`; // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 9b8af00a5a8..a6a79b15b4c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -8,12 +8,10 @@ "node": ">=8.10.0" }, "repository": "googleapis/nodejs-asset", - "main": "src/index.js", + "main": "build/src/index.js", "files": [ - "protos", - "src", - "AUTHORS", - "COPYING" + "build/src", + "build/protos" ], "keywords": [ "google apis client", @@ -29,34 +27,47 @@ "Cloud Asset API" ], "scripts": { - "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", "samples-test": "c8 npm run samples-test-suite", "samples-test-suite": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", - "test": "c8 mocha", - "fix": "eslint --fix '**/*.js'", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^1.7.5", + "google-gax": "^1.14.1", "protobufjs": "^6.8.0" }, "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", + "c8": "^7.0.1", "codecov": "^3.0.4", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", + "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^7.0.0", - "c8": "^7.0.0", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", "power-assert": "^1.6.0", - "prettier": "^1.13.7" + "prettier": "^1.13.7", + "ts-loader": "^6.2.1", + "typescript": "~3.6.4", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" } } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto index 8e2d1b0a387..956c6a7677a 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ syntax = "proto3"; package google.cloud.asset.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/asset/v1beta1/assets.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; @@ -31,6 +34,10 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; // Asset service definition. service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + // Exports assets with time and resource types to a given Cloud Storage // location. The output format is newline-delimited JSON. // This API implements the @@ -49,6 +56,10 @@ service AssetService { body: "*" } }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1beta1.ExportAssetsResponse" + metadata_type: "google.cloud.asset.v1beta1.ExportAssetsRequest" + }; } // Batch gets the update history of assets that overlap a time window. @@ -56,6 +67,8 @@ service AssetService { // non-delete or deleted status. // For IAM_POLICY content, this API outputs history when the asset and its // attached IAM POLICY both exist. This can create gaps in the output history. + // If a specified asset does not exist, this API returns an INVALID_ARGUMENT + // error. rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { @@ -73,7 +86,12 @@ message ExportAssetsRequest { // organization number (such as "organizations/123"), a project ID (such as // "projects/my-project-id"), a project number (such as "projects/12345"), or // a folder number (such as "folders/123"). - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; // Timestamp to take an asset snapshot. This can only be set to a timestamp // between 2018-10-02 UTC (inclusive) and the current time. If not specified, @@ -95,7 +113,7 @@ message ExportAssetsRequest { // Required. Output configuration indicating where the results will be output // to. All results will be in newline delimited JSON format. - OutputConfig output_config = 5; + OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; } // The export asset response. This message is returned by the @@ -117,7 +135,12 @@ message BatchGetAssetsHistoryRequest { // Required. The relative name of the root asset. It can only be an // organization number (such as "organizations/123"), a project ID (such as // "projects/my-project-id")", or a project number (such as "projects/12345"). - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; // A list of the full names of the assets. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. @@ -129,8 +152,8 @@ message BatchGetAssetsHistoryRequest { // size of the asset name list is 100 in one request. repeated string asset_names = 2; - // Required. The content type. - ContentType content_type = 3; + // Optional. The content type. + ContentType content_type = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The time window for the asset history. Both start_time and // end_time are optional and if set, it must be after 2018-10-02 UTC. If @@ -138,7 +161,7 @@ message BatchGetAssetsHistoryRequest { // not set, the snapshot of the assets at end_time will be returned. The // returned results contain all temporal assets whose time window overlap with // read_time_window. - TimeWindow read_time_window = 4; + TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -166,6 +189,16 @@ message GcsDestination { // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. string uri = 1; + + // The uri prefix of all generated Cloud Storage objects. For example: + // "gs://bucket_name/object_name_prefix". Each object uri is in format: + // "gs://bucket_name/object_name_prefix// and only + // contains assets for that type. starts from 0. For example: + // "gs://bucket_name/object_name_prefix/google.compute.disk/0" is the first + // shard of output objects containing all google.compute.disk assets. + // An INVALID_ARGUMENT error will be returned if file with the same name + // "gs://bucket_name/object_name_prefix" already exists. + string uri_prefix = 2; } } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto index 84db977b97d..4bb1438c8d7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ syntax = "proto3"; package google.cloud.asset.v1beta1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/iam/v1/policy.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset"; option java_multiple_files = true; @@ -56,6 +58,11 @@ message TimeWindow { // Cloud asset. This includes all Google Cloud Platform resources, // Cloud IAM policies, and other non-GCP assets. message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + // The full name of the asset. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Resource diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto new file mode 100644 index 00000000000..025adb27fe1 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -0,0 +1,234 @@ +// Copyright 2019 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.asset.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p1beta1/assets.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Searches resources which are accessible with .get permission. + rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/resources:search" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches IAM policies which are accessible with .getIamPolicy permission. + rpc SearchIamPolicies(SearchIamPoliciesRequest) returns (SearchIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/iamPolicies:search" + }; + option (google.api.method_signature) = "scope,query"; + } + + // Searches all the resources under a given accessible CRM scope + // (project/folder/organization). This RPC gives callers + // especially admins the ability to search all the resources under a scope, + // even if they don't have .get permission of all the resources. Callers + // should have cloud.assets.SearchAllResources permission on the requested + // scope, otherwise it will be rejected. + rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{scope=*/*}/resources:searchAll" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches all the IAM policies under a given accessible CRM scope + // (project/folder/organization). This RPC gives callers + // especially admins the ability to search all the IAM policies under a scope, + // even if they don't have .getIamPolicy permission of all the IAM policies. + // Callers should have cloud.assets.SearchAllIamPolicies permission on the + // requested scope, otherwise it will be rejected. + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll" + }; + option (google.api.method_signature) = "scope,query"; + } +} + +// Search resource request. +message SearchResourcesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the supported asset types. + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The value of this field is capped at 2000. If set to the + // zero value, server will pick an appropriate default. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `page_token` must be the value of `next_page_token` from + // the previous response. The values of all other method parameters, must be + // identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search resource response. +message SearchResourcesResponse { + // A list of resource that match the search query. + repeated StandardResourceMetadata results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search IAM policies request. +message SearchIamPoliciesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + // Examples: + // * "policy:myuser@mydomain.com" + // * "policy:(myuser@mydomain.com viewer)" + string query = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The maximum is 2000. If set to the zero value, the server + // will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of all other method parameters must be + // identical to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search IAM policies response. +message SearchIamPoliciesResponse { + // A list of IamPolicy that match the search query. Related information such + // as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; +} + +// Search all resources request. +message SearchAllResourcesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the supported asset types. + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The value of this field is capped at 2000. If set to the + // zero value, server will pick an appropriate default. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `page_token` must be the value of `next_page_token` from + // the previous response. The values of all other method parameters, must be + // identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all resources response. +message SearchAllResourcesResponse { + // A list of resource that match the search query. + repeated StandardResourceMetadata results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search all IAM policies request. +message SearchAllIamPoliciesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + // Examples: + // * "policy:myuser@mydomain.com" + // * "policy:(myuser@mydomain.com viewer)" + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The maximum is 2000. If set to the zero value, the server + // will pick an appropriate default. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of all other method parameters must be + // identical to those in the previous call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all IAM policies response. +message SearchAllIamPoliciesResponse { + // A list of IamPolicy that match the search query. Related information such + // as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto new file mode 100644 index 00000000000..ff0b927b13a --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto @@ -0,0 +1,78 @@ +// Copyright 2019 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.asset.v1p1beta1; + +import "google/iam/v1/policy.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1"; + +// The standard metadata of a cloud resource. +message StandardResourceMetadata { + // The full resource name. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of this resource. + // For example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // The project that this resource belongs to, in the form of + // `projects/{project_number}`. + string project = 3; + + // The display name of this resource. + string display_name = 4; + + // One or more paragraphs of text description of this resource. Maximum length + // could be up to 1M bytes. + string description = 5; + + // Additional searchable attributes of this resource. + // Informational only. The exact set of attributes is subject to change. + // For example: project id, DNS name etc. + repeated string additional_attributes = 10; +} + +// The result for a IAM Policy search. +message IamPolicySearchResult { + // The [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // of the resource associated with this IAM policy. + string resource = 1; + + // The project that the associated GCP resource belongs to, in the form of + // `projects/{project_number}`. If an IAM policy is set on a resource (like VM + // instance, Cloud Storage bucket), the project field will indicate the + // project that contains the resource. If an IAM policy is set on a folder or + // orgnization, the project field will be empty. + string project = 3; + + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. + google.iam.v1.Policy policy = 4; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto index 0d461d0fa81..7925bba6878 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -18,12 +18,14 @@ syntax = "proto3"; package google.cloud.asset.v1p2beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/asset/v1p2beta1/assets.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/client.proto"; option csharp_namespace = "Google.Cloud.Asset.V1p2Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset"; @@ -37,28 +39,6 @@ service AssetService { option (google.api.default_host) = "cloudasset.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - // Exports assets with time and resource types to a given Cloud Storage - // location. The output format is newline-delimited JSON. - // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you - // to keep track of the export. - rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p2beta1/{parent=*/*}:exportAssets" - body: "*" - }; - } - - // Batch gets the update history of assets that overlap a time window. - // For RESOURCE content, this API outputs history with asset in both - // non-delete or deleted status. - // For IAM_POLICY content, this API outputs history when the asset and its - // attached IAM POLICY both exist. This can create gaps in the output history. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { - option (google.api.http) = { - get: "/v1p2beta1/{parent=*/*}:batchGetAssetsHistory" - }; - } - // Creates a feed in a parent project/folder/organization to listen to its // asset updates. rpc CreateFeed(CreateFeedRequest) returns (Feed) { @@ -66,6 +46,7 @@ service AssetService { post: "/v1p2beta1/{parent=*/*}/feeds" body: "*" }; + option (google.api.method_signature) = "parent"; } // Gets details about an asset feed. @@ -73,6 +54,7 @@ service AssetService { option (google.api.http) = { get: "/v1p2beta1/{name=*/*/feeds/*}" }; + option (google.api.method_signature) = "name"; } // Lists all asset feeds in a parent project/folder/organization. @@ -80,6 +62,7 @@ service AssetService { option (google.api.http) = { get: "/v1p2beta1/{parent=*/*}/feeds" }; + option (google.api.method_signature) = "parent"; } // Updates an asset feed configuration. @@ -88,6 +71,7 @@ service AssetService { patch: "/v1p2beta1/{feed.name=*/*/feeds/*}" body: "*" }; + option (google.api.method_signature) = "feed"; } // Deletes an asset feed. @@ -95,88 +79,10 @@ service AssetService { option (google.api.http) = { delete: "/v1p2beta1/{name=*/*/feeds/*}" }; + option (google.api.method_signature) = "name"; } } -// Export asset request. -message ExportAssetsRequest { - // Required. The relative name of the root asset. This can only be an - // organization number (such as "organizations/123"), a project ID (such as - // "projects/my-project-id"), or a project number (such as "projects/12345"). - string parent = 1; - - // Timestamp to take an asset snapshot. This can only be set to a timestamp - // between 2018-10-02 UTC (inclusive) and the current time. If not specified, - // the current time will be used. Due to delays in resource data collection - // and indexing, there is a volatile window during which running the same - // query may get different results. - google.protobuf.Timestamp read_time = 2; - - // A list of asset types of which to take a snapshot for. For example: - // "compute.googleapis.com/Disk". If specified, only matching assets will be - // returned. See [Introduction to Cloud Asset - // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - // for all supported asset types. - repeated string asset_types = 3; - - // Asset content type. If not specified, no content but the asset name will be - // returned. - ContentType content_type = 4; - - // Required. Output configuration indicating where the results will be output - // to. All results will be in newline delimited JSON format. - OutputConfig output_config = 5; -} - -// The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. -message ExportAssetsResponse { - // Time the snapshot was taken. - google.protobuf.Timestamp read_time = 1; - - // Output configuration indicating where the results were output to. - // All results are in JSON format. - OutputConfig output_config = 2; -} - -// Batch get assets history request. -message BatchGetAssetsHistoryRequest { - // Required. The relative name of the root asset. It can only be an - // organization number (such as "organizations/123"), a project ID (such as - // "projects/my-project-id")", or a project number (such as "projects/12345"). - string parent = 1; - - // A list of the full names of the assets. For example: - // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource - // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // and [Resource Name - // Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) - // for more info. - // - // The request becomes a no-op if the asset name list is empty, and the max - // size of the asset name list is 100 in one request. - repeated string asset_names = 2; - - // Required. The content type. - ContentType content_type = 3; - - // Optional. The time window for the asset history. Both start_time and - // end_time are optional and if set, it must be after 2018-10-02 UTC. If - // end_time is not set, it is default to current timestamp. If start_time is - // not set, the snapshot of the assets at end_time will be returned. The - // returned results contain all temporal assets whose time window overlap with - // read_time_window. - TimeWindow read_time_window = 4; -} - -// Batch get assets history response. -message BatchGetAssetsHistoryResponse { - // A list of assets with valid time windows. - repeated TemporalAsset assets = 1; -} - // Create asset feed request. message CreateFeedRequest { // Required. The name of the project/folder/organization where this feed @@ -184,27 +90,32 @@ message CreateFeedRequest { // "organizations/123"), a folder number (such as "folders/123"), a project ID // (such as "projects/my-project-id")", or a project number (such as // "projects/12345"). - string parent = 1; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. This is the client-assigned asset feed identifier and it needs to // be unique under a specific parent project/folder/organization. - string feed_id = 2; + string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // The feed details. The field `name` must be empty and it will be generated + // Required. The feed details. The field `name` must be empty and it will be generated // in the format of: // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id - Feed feed = 3; + Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; } // Get asset feed request. message GetFeedRequest { - // The name of the Feed and it must be in the format of: + // Required. The name of the Feed and it must be in the format of: // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } + ]; } // List asset feeds request. @@ -212,10 +123,9 @@ message ListFeedsRequest { // Required. The parent project/folder/organization whose feeds are to be // listed. It can only be using project/folder/organization number (such as // "folders/12345")", or a project ID (such as "projects/my-project-id"). - string parent = 1; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; } -// List asset feeds response. message ListFeedsResponse { // A list of feeds. repeated Feed feeds = 1; @@ -223,26 +133,30 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // The new values of feed details. It must match an existing feed and the + // Required. The new values of feed details. It must match an existing feed and the // field `name` must be in the format of: // projects/project_number/feeds/feed_id or // folders/folder_number/feeds/feed_id or // organizations/organization_number/feeds/feed_id. - Feed feed = 1; + Feed feed = 1 [(google.api.field_behavior) = REQUIRED]; - // Only updates the `feed` fields indicated by this mask. + // Required. Only updates the `feed` fields indicated by this mask. // The field mask must not be empty, and it must not contain fields that // are immutable or only set by the server. - google.protobuf.FieldMask update_mask = 2; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } -// Delete asset feed request. message DeleteFeedRequest { - // The name of the feed and it must be in the format of: + // Required. The name of the feed and it must be in the format of: // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } + ]; } // Output configuration for export assets destination. @@ -251,12 +165,6 @@ message OutputConfig { oneof destination { // Destination on Cloud Storage. GcsDestination gcs_destination = 1; - - // Destination on Bigquery. The output table stores the fields in asset - // proto as columns in BigQuery. The resource/iam_policy field is converted - // to a record with each field to a column, except metadata to a single JSON - // string. - BigQueryDestination bigquery_destination = 2; } } @@ -270,40 +178,9 @@ message GcsDestination { // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. string uri = 1; - - // The uri prefix of all generated Cloud Storage objects. For example: - // "gs://bucket_name/object_name_prefix". Each object uri is in format: - // "gs://bucket_name/object_name_prefix// and only - // contains assets for that type. starts from 0. For example: - // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - // the first shard of output objects containing all - // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - // returned if file with the same name "gs://bucket_name/object_name_prefix" - // already exists. - string uri_prefix = 2; } } -// A Bigquery destination. -message BigQueryDestination { - // Required. The BigQuery dataset in format - // "projects/projectId/datasets/datasetId", to which the snapshot result - // should be exported. If this dataset does not exist, the export call returns - // an error. - string dataset = 1; - - // Required. The BigQuery table to which the snapshot result should be - // written. If this table does not exist, a new table with the given name - // will be created. - string table = 2; - - // If the destination table already exists and this flag is `TRUE`, the - // table will be overwritten by the contents of assets snapshot. If the flag - // is not set and the destination table already exists, the export call - // returns an error. - bool force = 3; -} - // A Cloud Pubsub destination. message PubsubDestination { // The name of the Cloud Pub/Sub topic to publish to. @@ -311,26 +188,6 @@ message PubsubDestination { string topic = 1; } -// Asset content type. -enum ContentType { - // Unspecified content type. - CONTENT_TYPE_UNSPECIFIED = 0; - - // Resource metadata. - RESOURCE = 1; - - // The actual IAM policy set on a resource. - IAM_POLICY = 2; - - // The IAM policy name for the IAM policy set on a resource. - IAM_POLICY_NAME = 3; - - ORG_POLICY = 4; - - // The Cloud Access context mananger Policy set on an asset. - ACCESS_POLICY = 5; -} - // Output configuration for asset feed destination. message FeedOutputConfig { // Asset feed destination. @@ -346,6 +203,14 @@ message FeedOutputConfig { // folder. Supported destinations are: // Cloud Pub/Sub topics. message Feed { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Feed" + pattern: "projects/{project}/feeds/{feed}" + pattern: "folders/{folder}/feeds/{feed}" + pattern: "organizations/{organization}/feeds/{feed}" + history: ORIGINALLY_SINGLE_PATTERN + }; + // Required. The format will be // projects/{project_number}/feeds/{client-assigned_feed_identifier} or // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or @@ -353,7 +218,7 @@ message Feed { // // The client-assigned feed identifier must be unique within the parent // project/folder/organization. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // A list of the full names of the assets to receive updates. You must specify // either or both of asset_names and asset_types. Only asset updates matching @@ -380,5 +245,17 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5; + FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto index a9cda898a35..8fee229bbc3 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -74,15 +74,10 @@ message Asset { // each resource, there must be at most one Cloud IAM policy set on it. google.iam.v1.Policy iam_policy = 4; - // Cloud IAM policy name of the Cloud IAM policy set on a cloud resource. For - // each resource, there must be at most one Cloud IAM policy name associated - // with it. - bytes iam_policy_name = 5; - // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, // represented as a list of relative resource names. Ancestry path starts with - // the closest CRM ancestor and ending at a visible root. If the asset is a - // CRM project/ folder/organization, this starts from the asset itself. + // the closest CRM ancestor and ends at root. If the asset is a CRM + // project/folder/organization, this starts from the asset itself. // // Example: ["projects/123456789", "folders/5432", "organizations/1234"] repeated string ancestors = 6; @@ -128,8 +123,4 @@ message Resource { // The content of the resource, in which some sensitive fields are scrubbed // away and may not be present. google.protobuf.Struct data = 6; - - // The actual metadata content for the resource, only visible for internal - // users. - google.protobuf.Any internal_data = 7; } diff --git a/packages/google-cloud-asset/protos/google/cloud/common_resources.proto b/packages/google-cloud-asset/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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 file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 4b13f0dd1b1..5c4491999a5 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -26,2176 +26,2176 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** - * Constructs a new AssetService 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); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); - /** - * Creates new AssetService 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): AssetService; + /** TemporalAsset deleted */ + deleted?: (boolean|null); - /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise + * Constructs a new TemporalAsset. + * @param [properties] Properties to set */ - public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance */ - public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @returns Promise + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @returns Promise + * Verifies a TemporalAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset */ - public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @returns Promise + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object */ - public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Converts this TemporalAsset to JSON. + * @returns JSON object */ - public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** 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 { /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @returns Promise + * Constructs a new TimeWindow. + * @param [properties] Properties to set */ - public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; + constructor(properties?: google.cloud.asset.v1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance */ - public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @returns Promise + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; - } - - namespace AssetService { + public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse + * 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 */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. - * @param error Error, if any - * @param [response] Feed + * 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 */ - type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. - * @param error Error, if any - * @param [response] Feed + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. - * @param error Error, if any - * @param [response] ListFeedsResponse + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow */ - type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. - * @param error Error, if any - * @param [response] Feed + * 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 */ - type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. - * @param error Error, if any - * @param [response] Empty + * Converts this TimeWindow to JSON. + * @returns JSON object */ - type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + /** Properties of an Asset. */ + interface IAsset { - /** ExportAssetsRequest parent */ - parent?: (string|null); + /** Asset name */ + name?: (string|null); - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Asset assetType */ + assetType?: (string|null); - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Asset ancestors */ + ancestors?: (string[]|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); + constructor(properties?: google.cloud.asset.v1.IAsset); - /** ExportAssetsRequest parent. */ - public parent: string; + /** Asset name. */ + public name: string; - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Asset assetType. */ + public assetType: string; - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Asset ancestors. */ + public ancestors: string[]; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns Asset * @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.asset.v1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns Asset * @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.asset.v1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; /** - * Verifies an ExportAssetsRequest message. + * Verifies an Asset 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { + /** Properties of a Resource. */ + interface IResource { - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Resource version */ + version?: (string|null); - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1.IResource); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Resource version. */ + public version: string; - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns Resource * @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.asset.v1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns Resource * @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.asset.v1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; /** - * Verifies an ExportAssetsResponse message. + * Verifies a Resource 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { - - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); - - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); - - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); - - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); - } - - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); - - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; - - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; - - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); - - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * Creates new AssetService 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(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; /** - * Verifies a BatchGetAssetsHistoryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static verify(message: { [k: string]: any }): (string|null); + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest - * @param [options] Conversion options - * @returns Plain object + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. - * @returns JSON object + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); - } + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; /** - * Constructs a new BatchGetAssetsHistoryResponse. - * @param [properties] Properties to set + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1.ITemporalAsset[]; + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; + } + + namespace AssetService { /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse - * @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.asset.v1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse - * @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.asset.v1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Verifies a BatchGetAssetsHistoryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static verify(message: { [k: string]: any }): (string|null); + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty */ - public toJSON(): { [k: string]: any }; + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Properties of a CreateFeedRequest. */ - interface ICreateFeedRequest { + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { - /** CreateFeedRequest parent */ + /** ExportAssetsRequest parent */ parent?: (string|null); - /** CreateFeedRequest feedId */ - feedId?: (string|null); + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** CreateFeedRequest feed */ - feed?: (google.cloud.asset.v1.IFeed|null); + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); } - /** Represents a CreateFeedRequest. */ - class CreateFeedRequest implements ICreateFeedRequest { + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { /** - * Constructs a new CreateFeedRequest. + * Constructs a new ExportAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); + constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); - /** CreateFeedRequest parent. */ + /** ExportAssetsRequest parent. */ public parent: string; - /** CreateFeedRequest feedId. */ - public feedId: string; + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** CreateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1.IFeed|null); + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFeedRequest instance + * @returns ExportAssetsRequest instance */ - public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; + public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFeedRequest + * @returns ExportAssetsRequest * @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.asset.v1.CreateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsRequest; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFeedRequest + * @returns ExportAssetsRequest * @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.asset.v1.CreateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsRequest; /** - * Verifies a CreateFeedRequest message. + * Verifies an ExportAssetsRequest 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 CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFeedRequest + * @returns ExportAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. - * @param message CreateFeedRequest + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this ExportAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetFeedRequest. */ - interface IGetFeedRequest { + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { - /** GetFeedRequest name */ - name?: (string|null); + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); } - /** Represents a GetFeedRequest. */ - class GetFeedRequest implements IGetFeedRequest { + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { /** - * Constructs a new GetFeedRequest. + * Constructs a new ExportAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); + constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); - /** GetFeedRequest name. */ - public name: string; + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); /** - * Creates a new GetFeedRequest instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetFeedRequest instance + * @returns ExportAssetsResponse instance */ - public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; + public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetFeedRequest + * @returns ExportAssetsResponse * @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.asset.v1.GetFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsResponse; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetFeedRequest + * @returns ExportAssetsResponse * @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.asset.v1.GetFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsResponse; /** - * Verifies a GetFeedRequest message. + * Verifies an ExportAssetsResponse 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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetFeedRequest + * @returns ExportAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. - * @param message GetFeedRequest + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetFeedRequest to JSON. + * Converts this ExportAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsRequest. */ - interface IListFeedsRequest { + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { - /** ListFeedsRequest parent */ + /** BatchGetAssetsHistoryRequest parent */ parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); } - /** Represents a ListFeedsRequest. */ - class ListFeedsRequest implements IListFeedsRequest { + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { /** - * Constructs a new ListFeedsRequest. + * Constructs a new BatchGetAssetsHistoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); - /** ListFeedsRequest parent. */ + /** BatchGetAssetsHistoryRequest parent. */ public parent: string; + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsRequest instance + * @returns BatchGetAssetsHistoryRequest instance */ - public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsRequest + * @returns BatchGetAssetsHistoryRequest * @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.asset.v1.ListFeedsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsRequest + * @returns BatchGetAssetsHistoryRequest * @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.asset.v1.ListFeedsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Verifies a ListFeedsRequest message. + * Verifies a BatchGetAssetsHistoryRequest 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 ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsRequest + * @returns BatchGetAssetsHistoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. - * @param message ListFeedsRequest + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsResponse. */ - interface IListFeedsResponse { + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { - /** ListFeedsResponse feeds */ - feeds?: (google.cloud.asset.v1.IFeed[]|null); + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); } - /** Represents a ListFeedsResponse. */ - class ListFeedsResponse implements IListFeedsResponse { + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { /** - * Constructs a new ListFeedsResponse. + * Constructs a new BatchGetAssetsHistoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); - /** ListFeedsResponse feeds. */ - public feeds: google.cloud.asset.v1.IFeed[]; + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1.ITemporalAsset[]; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsResponse instance + * @returns BatchGetAssetsHistoryResponse instance */ - public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsResponse + * @returns BatchGetAssetsHistoryResponse * @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.asset.v1.ListFeedsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsResponse + * @returns BatchGetAssetsHistoryResponse * @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.asset.v1.ListFeedsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Verifies a ListFeedsResponse message. + * Verifies a BatchGetAssetsHistoryResponse 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 ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsResponse + * @returns BatchGetAssetsHistoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. - * @param message ListFeedsResponse + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this BatchGetAssetsHistoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateFeedRequest. */ - interface IUpdateFeedRequest { + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { - /** UpdateFeedRequest feed */ - feed?: (google.cloud.asset.v1.IFeed|null); + /** CreateFeedRequest parent */ + parent?: (string|null); - /** UpdateFeedRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); } - /** Represents an UpdateFeedRequest. */ - class UpdateFeedRequest implements IUpdateFeedRequest { + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { /** - * Constructs a new UpdateFeedRequest. + * Constructs a new CreateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); + constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); - /** UpdateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1.IFeed|null); + /** CreateFeedRequest parent. */ + public parent: string; - /** UpdateFeedRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateFeedRequest instance + * @returns CreateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; + public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFeedRequest + * @returns CreateFeedRequest * @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.asset.v1.UpdateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateFeedRequest; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFeedRequest + * @returns CreateFeedRequest * @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.asset.v1.UpdateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateFeedRequest; /** - * Verifies an UpdateFeedRequest message. + * Verifies a CreateFeedRequest 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFeedRequest + * @returns CreateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @param message UpdateFeedRequest + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this CreateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteFeedRequest. */ - interface IDeleteFeedRequest { + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { - /** DeleteFeedRequest name */ + /** GetFeedRequest name */ name?: (string|null); } - /** Represents a DeleteFeedRequest. */ - class DeleteFeedRequest implements IDeleteFeedRequest { + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { /** - * Constructs a new DeleteFeedRequest. + * Constructs a new GetFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); + constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); - /** DeleteFeedRequest name. */ + /** GetFeedRequest name. */ public name: string; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteFeedRequest instance + * @returns GetFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; + public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteFeedRequest + * @returns GetFeedRequest * @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.asset.v1.DeleteFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetFeedRequest; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteFeedRequest + * @returns GetFeedRequest * @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.asset.v1.DeleteFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetFeedRequest; /** - * Verifies a DeleteFeedRequest message. + * Verifies a GetFeedRequest 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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteFeedRequest + * @returns GetFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. - * @param message DeleteFeedRequest + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this GetFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { - - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { - /** OutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** ListFeedsRequest parent */ + parent?: (string|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { /** - * Constructs a new OutputConfig. + * Constructs a new ListFeedsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IOutputConfig); - - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); - - /** OutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); - /** OutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); + /** ListFeedsRequest parent. */ + public parent: string; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns ListFeedsRequest instance */ - public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns ListFeedsRequest * @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.asset.v1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsRequest; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns ListFeedsRequest * @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.asset.v1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsRequest; /** - * Verifies an OutputConfig message. + * Verifies a ListFeedsRequest 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns ListFeedsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this ListFeedsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1.IFeed[]|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { /** - * Constructs a new GcsDestination. + * Constructs a new ListFeedsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** GcsDestination uriPrefix. */ - public uriPrefix: string; + constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1.IFeed[]; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns ListFeedsResponse instance */ - public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns ListFeedsResponse * @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.asset.v1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsResponse; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns ListFeedsResponse * @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.asset.v1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsResponse; /** - * Verifies a GcsDestination message. + * Verifies a ListFeedsResponse 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this ListFeedsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { - /** BigQueryDestination dataset */ - dataset?: (string|null); - - /** BigQueryDestination table */ - table?: (string|null); + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); - /** BigQueryDestination force */ - force?: (boolean|null); + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { /** - * Constructs a new BigQueryDestination. + * Constructs a new UpdateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; + constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); - /** BigQueryDestination table. */ - public table: string; + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); - /** BigQueryDestination force. */ - public force: boolean; + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BigQueryDestination instance + * @returns UpdateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; + public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BigQueryDestination + * @returns UpdateFeedRequest * @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.asset.v1.BigQueryDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateFeedRequest; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BigQueryDestination + * @returns UpdateFeedRequest * @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.asset.v1.BigQueryDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateFeedRequest; /** - * Verifies a BigQueryDestination message. + * Verifies an UpdateFeedRequest 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BigQueryDestination + * @returns UpdateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BigQueryDestination to JSON. + * Converts this UpdateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PubsubDestination. */ - interface IPubsubDestination { + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { - /** PubsubDestination topic */ - topic?: (string|null); + /** DeleteFeedRequest name */ + name?: (string|null); } - /** Represents a PubsubDestination. */ - class PubsubDestination implements IPubsubDestination { + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { /** - * Constructs a new PubsubDestination. + * Constructs a new DeleteFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IPubsubDestination); + constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); - /** PubsubDestination topic. */ - public topic: string; + /** DeleteFeedRequest name. */ + public name: string; /** - * Creates a new PubsubDestination instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PubsubDestination instance + * @returns DeleteFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; + public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PubsubDestination + * @returns DeleteFeedRequest * @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.asset.v1.PubsubDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteFeedRequest; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PubsubDestination + * @returns DeleteFeedRequest * @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.asset.v1.PubsubDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteFeedRequest; /** - * Verifies a PubsubDestination message. + * Verifies a DeleteFeedRequest 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 PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PubsubDestination + * @returns DeleteFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. - * @param message PubsubDestination + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PubsubDestination to JSON. + * Converts this DeleteFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** Properties of a FeedOutputConfig. */ - interface IFeedOutputConfig { + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); - /** FeedOutputConfig pubsubDestination */ - pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); } - /** Represents a FeedOutputConfig. */ - class FeedOutputConfig implements IFeedOutputConfig { + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { /** - * Constructs a new FeedOutputConfig. + * Constructs a new OutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); + constructor(properties?: google.cloud.asset.v1.IOutputConfig); - /** FeedOutputConfig pubsubDestination. */ - public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); - /** FeedOutputConfig destination. */ - public destination?: "pubsubDestination"; + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns FeedOutputConfig instance + * @returns OutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; + public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FeedOutputConfig + * @returns OutputConfig * @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.asset.v1.FeedOutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.OutputConfig; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FeedOutputConfig + * @returns OutputConfig * @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.asset.v1.FeedOutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.OutputConfig; /** - * Verifies a FeedOutputConfig message. + * Verifies an OutputConfig 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 FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FeedOutputConfig + * @returns OutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. - * @param message FeedOutputConfig + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this OutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Feed. */ - interface IFeed { - - /** Feed name */ - name?: (string|null); - - /** Feed assetNames */ - assetNames?: (string[]|null); - - /** Feed assetTypes */ - assetTypes?: (string[]|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { - /** Feed contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + /** GcsDestination uri */ + uri?: (string|null); - /** Feed feedOutputConfig */ - feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } - /** Represents a Feed. */ - class Feed implements IFeed { + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Constructs a new Feed. + * Constructs a new GcsDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IFeed); + constructor(properties?: google.cloud.asset.v1.IGcsDestination); - /** Feed name. */ - public name: string; + /** GcsDestination uri. */ + public uri: string; - /** Feed assetNames. */ - public assetNames: string[]; - - /** Feed assetTypes. */ - public assetTypes: string[]; - - /** Feed contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + /** GcsDestination uriPrefix. */ + public uriPrefix: string; - /** Feed feedOutputConfig. */ - public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); /** - * Creates a new Feed instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @param [properties] Properties to set - * @returns Feed instance + * @returns GcsDestination instance */ - public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; + public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Feed + * @returns GcsDestination * @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.asset.v1.Feed; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GcsDestination; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Feed + * @returns GcsDestination * @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.asset.v1.Feed; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GcsDestination; /** - * Verifies a Feed message. + * Verifies a GcsDestination 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 Feed message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Feed + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. - * @param message Feed + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Feed to JSON. + * Converts this GcsDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); + /** BigQueryDestination dataset */ + dataset?: (string|null); - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** BigQueryDestination table */ + table?: (string|null); - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** BigQueryDestination force */ + force?: (boolean|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { /** - * Constructs a new TemporalAsset. + * Constructs a new BigQueryDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + /** BigQueryDestination dataset. */ + public dataset: string; - /** TemporalAsset deleted. */ - public deleted: boolean; + /** BigQueryDestination table. */ + public table: string; - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + /** BigQueryDestination force. */ + public force: boolean; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new BigQueryDestination instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns BigQueryDestination instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a BigQueryDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns BigQueryDestination * @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.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BigQueryDestination; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns BigQueryDestination * @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.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BigQueryDestination; /** - * Verifies a TemporalAsset message. + * Verifies a BigQueryDestination 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns BigQueryDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this BigQueryDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** PubsubDestination topic */ + topic?: (string|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { /** - * Constructs a new TimeWindow. + * Constructs a new PubsubDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); - - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.asset.v1.IPubsubDestination); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** PubsubDestination topic. */ + public topic: string; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns PubsubDestination instance */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns PubsubDestination * @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.asset.v1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PubsubDestination; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns PubsubDestination * @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.asset.v1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PubsubDestination; /** - * Verifies a TimeWindow message. + * Verifies a PubsubDestination 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. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns PubsubDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this PubsubDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { - /** Asset ancestors */ - ancestors?: (string[]|null); + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { /** - * Constructs a new Asset. + * Constructs a new FeedOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAsset); - - /** Asset name. */ - public name: string; + constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); - /** Asset assetType. */ - public assetType: string; + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset ancestors. */ - public ancestors: string[]; + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; /** - * Creates a new Asset instance using the specified properties. + * Creates a new FeedOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns FeedOutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns FeedOutputConfig * @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.asset.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.FeedOutputConfig; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns FeedOutputConfig * @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.asset.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.FeedOutputConfig; /** - * Verifies an Asset message. + * Verifies a FeedOutputConfig 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns FeedOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this FeedOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); + /** Properties of a Feed. */ + interface IFeed { - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Feed name */ + name?: (string|null); - /** Resource discoveryName */ - discoveryName?: (string|null); + /** Feed assetNames */ + assetNames?: (string[]|null); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** Feed assetTypes */ + assetTypes?: (string[]|null); - /** Resource parent */ - parent?: (string|null); + /** Feed contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents a Feed. */ + class Feed implements IFeed { /** - * Constructs a new Resource. + * Constructs a new Feed. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; + constructor(properties?: google.cloud.asset.v1.IFeed); - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** Feed name. */ + public name: string; - /** Resource discoveryName. */ - public discoveryName: string; + /** Feed assetNames. */ + public assetNames: string[]; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** Feed assetTypes. */ + public assetTypes: string[]; - /** Resource parent. */ - public parent: string; + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); /** - * Creates a new Resource instance using the specified properties. + * Creates a new Feed instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns Feed instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns Feed * @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.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Feed; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns Feed * @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.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Feed; /** - * Verifies a Resource message. + * Verifies a Feed 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns Feed */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this Feed to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2205,1102 +2205,1330 @@ export namespace google { /** Namespace v1beta1. */ namespace v1beta1 { - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1beta1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new AssetService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new TemporalAsset. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1beta1.IAsset|null); /** - * Creates new AssetService 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. + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; + public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; + public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TemporalAsset; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; - } - - namespace AssetService { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TemporalAsset; /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation + * Verifies a TemporalAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; - } - - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; - /** ExportAssetsRequest parent */ - parent?: (string|null); + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - - /** ExportAssetsRequest parent. */ - public parent: string; - - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; + constructor(properties?: google.cloud.asset.v1beta1.ITimeWindow); - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * 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 ExportAssetsRequest + * @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.asset.v1beta1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TimeWindow; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @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.asset.v1beta1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TimeWindow; /** - * Verifies an ExportAssetsRequest message. + * 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 an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TimeWindow; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * 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.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { + /** Properties of an Asset. */ + interface IAsset { - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Asset name */ + name?: (string|null); - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1beta1.IAsset); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Asset name. */ + public name: string; - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns Asset * @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.asset.v1beta1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Asset; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns Asset * @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.asset.v1beta1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Asset; /** - * Verifies an ExportAssetsResponse message. + * Verifies an Asset 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { + /** Properties of a Resource. */ + interface IResource { - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); + /** Resource version */ + version?: (string|null); - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + /** Resource discoveryName */ + discoveryName?: (string|null); - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); + constructor(properties?: google.cloud.asset.v1beta1.IResource); - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; + /** Resource version. */ + public version: string; - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + /** Resource discoveryName. */ + public discoveryName: string; - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest + * @returns Resource * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Resource; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest + * @returns Resource * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Resource; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a Resource 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; } - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + namespace AssetService { /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse + */ + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * @returns ExportAssetsRequest instance */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse + * @returns ExportAssetsRequest * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse + * @returns ExportAssetsRequest * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies an ExportAssetsRequest 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * @returns ExportAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this ExportAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { /** - * Constructs a new OutputConfig. + * Constructs a new ExportAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** OutputConfig destination. */ - public destination?: "gcsDestination"; + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns ExportAssetsResponse instance */ - public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns ExportAssetsResponse * @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.asset.v1beta1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns ExportAssetsResponse * @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.asset.v1beta1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Verifies an OutputConfig message. + * Verifies an ExportAssetsResponse 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns ExportAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this ExportAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { - /** GcsDestination uri */ - uri?: (string|null); + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { /** - * Constructs a new GcsDestination. + * Constructs a new BatchGetAssetsHistoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); - /** GcsDestination uri. */ - public uri: string; + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; - /** GcsDestination objectUri. */ - public objectUri?: "uri"; + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns BatchGetAssetsHistoryRequest instance */ - public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns BatchGetAssetsHistoryRequest * @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.asset.v1beta1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns BatchGetAssetsHistoryRequest * @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.asset.v1beta1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Verifies a GcsDestination message. + * Verifies a BatchGetAssetsHistoryRequest 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns BatchGetAssetsHistoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1beta1.IAsset|null); + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { /** - * Constructs a new TemporalAsset. + * Constructs a new BatchGetAssetsHistoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1beta1.IAsset|null); + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns BatchGetAssetsHistoryResponse instance */ - public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns BatchGetAssetsHistoryResponse * @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.asset.v1beta1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns BatchGetAssetsHistoryResponse * @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.asset.v1beta1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Verifies a TemporalAsset message. + * Verifies a BatchGetAssetsHistoryResponse 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns BatchGetAssetsHistoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this BatchGetAssetsHistoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { /** - * Constructs a new TimeWindow. + * Constructs a new OutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns OutputConfig instance */ - public static create(properties?: google.cloud.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; + public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns OutputConfig * @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.asset.v1beta1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.OutputConfig; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns OutputConfig * @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.asset.v1beta1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.OutputConfig; /** - * Verifies a TimeWindow message. + * Verifies an OutputConfig 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. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns OutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this OutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { - /** Asset resource */ - resource?: (google.cloud.asset.v1beta1.IResource|null); + /** GcsDestination uri */ + uri?: (string|null); - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Constructs a new Asset. + * Constructs a new GcsDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IAsset); - - /** Asset name. */ - public name: string; + constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); - /** Asset assetType. */ - public assetType: string; + /** GcsDestination uri. */ + public uri: string; - /** Asset resource. */ - public resource?: (google.cloud.asset.v1beta1.IResource|null); + /** GcsDestination uriPrefix. */ + public uriPrefix: string; - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); /** - * Creates a new Asset instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns GcsDestination instance */ - public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; + public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns GcsDestination * @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.asset.v1beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.GcsDestination; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns GcsDestination * @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.asset.v1beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.GcsDestination; /** - * Verifies an Asset message. + * Verifies a GcsDestination 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this GcsDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + } - /** Resource version */ - version?: (string|null); + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Properties of a StandardResourceMetadata. */ + interface IStandardResourceMetadata { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** StandardResourceMetadata name */ + name?: (string|null); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** StandardResourceMetadata assetType */ + assetType?: (string|null); - /** Resource parent */ - parent?: (string|null); + /** StandardResourceMetadata project */ + project?: (string|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** StandardResourceMetadata displayName */ + displayName?: (string|null); + + /** StandardResourceMetadata description */ + description?: (string|null); + + /** StandardResourceMetadata additionalAttributes */ + additionalAttributes?: (string[]|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents a StandardResourceMetadata. */ + class StandardResourceMetadata implements IStandardResourceMetadata { /** - * Constructs a new Resource. + * Constructs a new StandardResourceMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IResource); + constructor(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata); - /** Resource version. */ - public version: string; + /** StandardResourceMetadata name. */ + public name: string; - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** StandardResourceMetadata assetType. */ + public assetType: string; - /** Resource discoveryName. */ - public discoveryName: string; + /** StandardResourceMetadata project. */ + public project: string; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** StandardResourceMetadata displayName. */ + public displayName: string; - /** Resource parent. */ - public parent: string; + /** StandardResourceMetadata description. */ + public description: string; - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** StandardResourceMetadata additionalAttributes. */ + public additionalAttributes: string[]; /** - * Creates a new Resource instance using the specified properties. + * Creates a new StandardResourceMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns StandardResourceMetadata instance */ - public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; + public static create(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a StandardResourceMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns StandardResourceMetadata * @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.asset.v1beta1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns StandardResourceMetadata * @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.asset.v1beta1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Verifies a Resource message. + * Verifies a StandardResourceMetadata 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns StandardResourceMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. + * @param message StandardResourceMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.StandardResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this StandardResourceMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v1p2beta1. */ - namespace v1p2beta1 { + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @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.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @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.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } /** Represents an AssetService */ class AssetService extends $protobuf.rpc.Service { @@ -3323,2178 +3551,2765 @@ export namespace google { public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse */ - public exportAssets(request: google.cloud.asset.v1p2beta1.IExportAssetsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ExportAssetsCallback): void; + public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback): void; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object * @returns Promise */ - public exportAssets(request: google.cloud.asset.v1p2beta1.IExportAssetsRequest): Promise; + public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): Promise; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Calls SearchIamPolicies. + * @param request SearchIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse */ - public batchGetAssetsHistory(request: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1p2beta1.AssetService.BatchGetAssetsHistoryCallback): void; + public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback): void; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object + * Calls SearchIamPolicies. + * @param request SearchIamPoliciesRequest message or plain object * @returns Promise */ - public batchGetAssetsHistory(request: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest): Promise; + public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): Promise; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllResourcesResponse */ - public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback): void; + public searchAllResources(request: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback): void; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object * @returns Promise */ - public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest): Promise; + public searchAllResources(request: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest): Promise; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse */ - public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback): void; + public searchAllIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback): void; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object * @returns Promise */ - public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest): Promise; + public searchAllIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest): Promise; + } + + namespace AssetService { /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. + * @param error Error, if any + * @param [response] SearchResourcesResponse */ - public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback): void; + type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchResourcesResponse) => void; /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. + * @param error Error, if any + * @param [response] SearchIamPoliciesResponse */ - public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest): Promise; + type SearchIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) => void; /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed - */ - public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback): void; - - /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @returns Promise - */ - public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): Promise; - - /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback): void; - - /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @returns Promise - */ - public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): Promise; - } - - namespace AssetService { - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse - */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. - * @param error Error, if any - * @param [response] Feed - */ - type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. - * @param error Error, if any - * @param [response] Feed - */ - type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. * @param error Error, if any - * @param [response] ListFeedsResponse - */ - type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. - * @param error Error, if any - * @param [response] Feed + * @param [response] SearchAllResourcesResponse */ - type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. * @param error Error, if any - * @param [response] Empty + * @param [response] SearchAllIamPoliciesResponse */ - type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) => void; } - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + /** Properties of a SearchResourcesRequest. */ + interface ISearchResourcesRequest { - /** ExportAssetsRequest parent */ - parent?: (string|null); + /** SearchResourcesRequest scope */ + scope?: (string|null); - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesRequest query */ + query?: (string|null); - /** ExportAssetsRequest assetTypes */ + /** SearchResourcesRequest assetTypes */ assetTypes?: (string[]|null); - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + /** SearchResourcesRequest pageSize */ + pageSize?: (number|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesRequest pageToken */ + pageToken?: (string|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents a SearchResourcesRequest. */ + class SearchResourcesRequest implements ISearchResourcesRequest { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new SearchResourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest); - /** ExportAssetsRequest parent. */ - public parent: string; + /** SearchResourcesRequest scope. */ + public scope: string; - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesRequest query. */ + public query: string; - /** ExportAssetsRequest assetTypes. */ + /** SearchResourcesRequest assetTypes. */ public assetTypes: string[]; - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + /** SearchResourcesRequest pageSize. */ + public pageSize: number; - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesRequest pageToken. */ + public pageToken: string; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new SearchResourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns SearchResourcesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsRequest): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a SearchResourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns SearchResourcesRequest * @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.asset.v1p2beta1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns SearchResourcesRequest * @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.asset.v1p2beta1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Verifies an ExportAssetsRequest message. + * Verifies a SearchResourcesRequest 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns SearchResourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. + * @param message SearchResourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this SearchResourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { + /** Properties of a SearchResourcesResponse. */ + interface ISearchResourcesResponse { - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents a SearchResourcesResponse. */ + class SearchResourcesResponse implements ISearchResourcesResponse { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new SearchResourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new SearchResourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns SearchResourcesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a SearchResourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns SearchResourcesResponse * @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.asset.v1p2beta1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns SearchResourcesResponse * @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.asset.v1p2beta1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Verifies an ExportAssetsResponse message. + * Verifies a SearchResourcesResponse 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns SearchResourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * @param message SearchResourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this SearchResourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { + /** Properties of a SearchIamPoliciesRequest. */ + interface ISearchIamPoliciesRequest { - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); + /** SearchIamPoliciesRequest scope */ + scope?: (string|null); - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); + /** SearchIamPoliciesRequest query */ + query?: (string|null); - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + /** SearchIamPoliciesRequest pageSize */ + pageSize?: (number|null); - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + /** SearchIamPoliciesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents a SearchIamPoliciesRequest. */ + class SearchIamPoliciesRequest implements ISearchIamPoliciesRequest { /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new SearchIamPoliciesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest); - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; + /** SearchIamPoliciesRequest scope. */ + public scope: string; - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; + /** SearchIamPoliciesRequest query. */ + public query: string; - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + /** SearchIamPoliciesRequest pageSize. */ + public pageSize: number; - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + /** SearchIamPoliciesRequest pageToken. */ + public pageToken: string; /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new SearchIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * @returns SearchIamPoliciesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @param message SearchIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @param message SearchIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest + * @returns SearchIamPoliciesRequest * @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.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest + * @returns SearchIamPoliciesRequest * @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.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a SearchIamPoliciesRequest 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * @returns SearchIamPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest + * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchIamPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this SearchIamPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + /** Properties of a SearchIamPoliciesResponse. */ + interface ISearchIamPoliciesResponse { - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1p2beta1.ITemporalAsset[]|null); + /** SearchIamPoliciesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); + + /** SearchIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + /** Represents a SearchIamPoliciesResponse. */ + class SearchIamPoliciesResponse implements ISearchIamPoliciesResponse { /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Constructs a new SearchIamPoliciesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse); - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1p2beta1.ITemporalAsset[]; + /** SearchIamPoliciesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; + + /** SearchIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new SearchIamPoliciesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * @returns SearchIamPoliciesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @param message SearchIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @param message SearchIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse + * @returns SearchIamPoliciesResponse * @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.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse + * @returns SearchIamPoliciesResponse * @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.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies a SearchIamPoliciesResponse 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * @returns SearchIamPoliciesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse + * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchIamPoliciesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this SearchIamPoliciesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateFeedRequest. */ - interface ICreateFeedRequest { + /** Properties of a SearchAllResourcesRequest. */ + interface ISearchAllResourcesRequest { - /** CreateFeedRequest parent */ - parent?: (string|null); + /** SearchAllResourcesRequest scope */ + scope?: (string|null); - /** CreateFeedRequest feedId */ - feedId?: (string|null); + /** SearchAllResourcesRequest query */ + query?: (string|null); - /** CreateFeedRequest feed */ - feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** SearchAllResourcesRequest assetTypes */ + assetTypes?: (string[]|null); + + /** SearchAllResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllResourcesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a CreateFeedRequest. */ - class CreateFeedRequest implements ICreateFeedRequest { + /** Represents a SearchAllResourcesRequest. */ + class SearchAllResourcesRequest implements ISearchAllResourcesRequest { /** - * Constructs a new CreateFeedRequest. + * Constructs a new SearchAllResourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest); - /** CreateFeedRequest parent. */ - public parent: string; + /** SearchAllResourcesRequest scope. */ + public scope: string; - /** CreateFeedRequest feedId. */ - public feedId: string; + /** SearchAllResourcesRequest query. */ + public query: string; - /** CreateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** SearchAllResourcesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchAllResourcesRequest pageToken. */ + public pageToken: string; /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFeedRequest instance + * @returns SearchAllResourcesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest): google.cloud.asset.v1p2beta1.CreateFeedRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFeedRequest + * @returns SearchAllResourcesRequest * @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.asset.v1p2beta1.CreateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFeedRequest + * @returns SearchAllResourcesRequest * @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.asset.v1p2beta1.CreateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Verifies a CreateFeedRequest message. + * Verifies a SearchAllResourcesRequest 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 CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFeedRequest + * @returns SearchAllResourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.CreateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. - * @param message CreateFeedRequest + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @param message SearchAllResourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetFeedRequest. */ - interface IGetFeedRequest { + /** Properties of a SearchAllResourcesResponse. */ + interface ISearchAllResourcesResponse { - /** GetFeedRequest name */ - name?: (string|null); + /** SearchAllResourcesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); + + /** SearchAllResourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetFeedRequest. */ - class GetFeedRequest implements IGetFeedRequest { + /** Represents a SearchAllResourcesResponse. */ + class SearchAllResourcesResponse implements ISearchAllResourcesResponse { /** - * Constructs a new GetFeedRequest. + * Constructs a new SearchAllResourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse); - /** GetFeedRequest name. */ - public name: string; + /** SearchAllResourcesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; + + /** SearchAllResourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetFeedRequest instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetFeedRequest instance + * @returns SearchAllResourcesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest): google.cloud.asset.v1p2beta1.GetFeedRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetFeedRequest + * @returns SearchAllResourcesResponse * @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.asset.v1p2beta1.GetFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetFeedRequest + * @returns SearchAllResourcesResponse * @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.asset.v1p2beta1.GetFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Verifies a GetFeedRequest message. + * Verifies a SearchAllResourcesResponse 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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetFeedRequest + * @returns SearchAllResourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GetFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. - * @param message GetFeedRequest + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @param message SearchAllResourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetFeedRequest to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsRequest. */ - interface IListFeedsRequest { + /** Properties of a SearchAllIamPoliciesRequest. */ + interface ISearchAllIamPoliciesRequest { - /** ListFeedsRequest parent */ - parent?: (string|null); + /** SearchAllIamPoliciesRequest scope */ + scope?: (string|null); + + /** SearchAllIamPoliciesRequest query */ + query?: (string|null); + + /** SearchAllIamPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllIamPoliciesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a ListFeedsRequest. */ - class ListFeedsRequest implements IListFeedsRequest { + /** Represents a SearchAllIamPoliciesRequest. */ + class SearchAllIamPoliciesRequest implements ISearchAllIamPoliciesRequest { /** - * Constructs a new ListFeedsRequest. + * Constructs a new SearchAllIamPoliciesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest); - /** ListFeedsRequest parent. */ - public parent: string; + /** SearchAllIamPoliciesRequest scope. */ + public scope: string; + + /** SearchAllIamPoliciesRequest query. */ + public query: string; + + /** SearchAllIamPoliciesRequest pageSize. */ + public pageSize: number; + + /** SearchAllIamPoliciesRequest pageToken. */ + public pageToken: string; /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsRequest instance + * @returns SearchAllIamPoliciesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest): google.cloud.asset.v1p2beta1.ListFeedsRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsRequest + * @returns SearchAllIamPoliciesRequest * @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.asset.v1p2beta1.ListFeedsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsRequest + * @returns SearchAllIamPoliciesRequest * @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.asset.v1p2beta1.ListFeedsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Verifies a ListFeedsRequest message. + * Verifies a SearchAllIamPoliciesRequest 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 ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsRequest + * @returns SearchAllIamPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. - * @param message ListFeedsRequest + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this SearchAllIamPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsResponse. */ - interface IListFeedsResponse { + /** Properties of a SearchAllIamPoliciesResponse. */ + interface ISearchAllIamPoliciesResponse { - /** ListFeedsResponse feeds */ - feeds?: (google.cloud.asset.v1p2beta1.IFeed[]|null); + /** SearchAllIamPoliciesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); + + /** SearchAllIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a ListFeedsResponse. */ - class ListFeedsResponse implements IListFeedsResponse { + /** Represents a SearchAllIamPoliciesResponse. */ + class SearchAllIamPoliciesResponse implements ISearchAllIamPoliciesResponse { /** - * Constructs a new ListFeedsResponse. + * Constructs a new SearchAllIamPoliciesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse); - /** ListFeedsResponse feeds. */ - public feeds: google.cloud.asset.v1p2beta1.IFeed[]; + /** SearchAllIamPoliciesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; + + /** SearchAllIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsResponse instance + * @returns SearchAllIamPoliciesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse): google.cloud.asset.v1p2beta1.ListFeedsResponse; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsResponse + * @returns SearchAllIamPoliciesResponse * @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.asset.v1p2beta1.ListFeedsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsResponse + * @returns SearchAllIamPoliciesResponse * @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.asset.v1p2beta1.ListFeedsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Verifies a ListFeedsResponse message. + * Verifies a SearchAllIamPoliciesResponse 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 ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsResponse + * @returns SearchAllIamPoliciesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. - * @param message ListFeedsResponse + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this SearchAllIamPoliciesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an UpdateFeedRequest. */ - interface IUpdateFeedRequest { + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { - /** UpdateFeedRequest feed */ - feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** UpdateFeedRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1p2beta1.IAsset|null); } - /** Represents an UpdateFeedRequest. */ - class UpdateFeedRequest implements IUpdateFeedRequest { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new UpdateFeedRequest. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest); + constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); - /** UpdateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - /** UpdateFeedRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateFeedRequest instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFeedRequest + * @returns TemporalAsset * @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.asset.v1p2beta1.UpdateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFeedRequest + * @returns TemporalAsset * @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.asset.v1p2beta1.UpdateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Verifies an UpdateFeedRequest message. + * Verifies a TemporalAsset 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFeedRequest + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @param message UpdateFeedRequest + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteFeedRequest. */ - interface IDeleteFeedRequest { + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** DeleteFeedRequest name */ - name?: (string|null); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteFeedRequest. */ - class DeleteFeedRequest implements IDeleteFeedRequest { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new DeleteFeedRequest. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest); + constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); - /** DeleteFeedRequest name. */ - public name: string; + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteFeedRequest instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * 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 DeleteFeedRequest + * @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.asset.v1p2beta1.DeleteFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteFeedRequest + * @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.asset.v1p2beta1.DeleteFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Verifies a DeleteFeedRequest message. + * 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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteFeedRequest + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. - * @param message DeleteFeedRequest + * 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.asset.v1p2beta1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of an Asset. */ + interface IAsset { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + /** Asset name */ + name?: (string|null); - /** OutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1p2beta1.IBigQueryDestination|null); - } + /** Asset assetType */ + assetType?: (string|null); - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Asset resource */ + resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new OutputConfig. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IOutputConfig); + constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + /** Asset name. */ + public name: string; - /** OutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1p2beta1.IBigQueryDestination|null); + /** Asset assetType. */ + public assetType: string; - /** OutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors. */ + public ancestors: string[]; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IOutputConfig): google.cloud.asset.v1p2beta1.OutputConfig; + public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns Asset * @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.asset.v1p2beta1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Asset; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns Asset * @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.asset.v1p2beta1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Asset; /** - * Verifies an OutputConfig message. + * Verifies an Asset 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of a Resource. */ + interface IResource { - /** GcsDestination uri */ - uri?: (string|null); + /** Resource version */ + version?: (string|null); - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new GcsDestination. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IGcsDestination); + constructor(properties?: google.cloud.asset.v1p2beta1.IResource); - /** GcsDestination uri. */ - public uri: string; + /** Resource version. */ + public version: string; - /** GcsDestination uriPrefix. */ - public uriPrefix: string; + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IGcsDestination): google.cloud.asset.v1p2beta1.GcsDestination; + public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns Resource * @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.asset.v1p2beta1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Resource; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns Resource * @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.asset.v1p2beta1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Resource; /** - * Verifies a GcsDestination message. + * Verifies a Resource 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { - - /** BigQueryDestination dataset */ - dataset?: (string|null); - - /** BigQueryDestination table */ - table?: (string|null); - - /** BigQueryDestination force */ - force?: (boolean|null); - } - - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new BigQueryDestination. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1p2beta1.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; - - /** BigQueryDestination table. */ - public table: string; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** BigQueryDestination force. */ - public force: boolean; + /** + * Creates new AssetService 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): AssetService; /** - * Creates a new BigQueryDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryDestination instance + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static create(properties?: google.cloud.asset.v1p2beta1.IBigQueryDestination): google.cloud.asset.v1p2beta1.BigQueryDestination; + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback): void; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.asset.v1p2beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest): Promise; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback): void; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.BigQueryDestination; + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest): Promise; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.BigQueryDestination; + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback): void; /** - * Verifies a BigQueryDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest): Promise; /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryDestination + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BigQueryDestination; + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback): void; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.asset.v1p2beta1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): Promise; /** - * Converts this BigQueryDestination to JSON. - * @returns JSON object + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public toJSON(): { [k: string]: any }; + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback): void; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise + */ + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): Promise; } - /** Properties of a PubsubDestination. */ - interface IPubsubDestination { + namespace AssetService { - /** PubsubDestination topic */ - topic?: (string|null); + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse + */ + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Represents a PubsubDestination. */ - class PubsubDestination implements IPubsubDestination { + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { + + /** CreateFeedRequest parent */ + parent?: (string|null); + + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + } + + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { /** - * Constructs a new PubsubDestination. + * Constructs a new CreateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination); + constructor(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest); - /** PubsubDestination topic. */ - public topic: string; + /** CreateFeedRequest parent. */ + public parent: string; + + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); /** - * Creates a new PubsubDestination instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PubsubDestination instance + * @returns CreateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination): google.cloud.asset.v1p2beta1.PubsubDestination; + public static create(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PubsubDestination + * @returns CreateFeedRequest * @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.asset.v1p2beta1.PubsubDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PubsubDestination + * @returns CreateFeedRequest * @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.asset.v1p2beta1.PubsubDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Verifies a PubsubDestination message. + * Verifies a CreateFeedRequest 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 PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PubsubDestination + * @returns CreateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.PubsubDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. - * @param message PubsubDestination + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PubsubDestination to JSON. + * Converts this CreateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - IAM_POLICY_NAME = 3, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } - - /** Properties of a FeedOutputConfig. */ - interface IFeedOutputConfig { + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { - /** FeedOutputConfig pubsubDestination */ - pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + /** GetFeedRequest name */ + name?: (string|null); } - /** Represents a FeedOutputConfig. */ - class FeedOutputConfig implements IFeedOutputConfig { + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { /** - * Constructs a new FeedOutputConfig. + * Constructs a new GetFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig); - - /** FeedOutputConfig pubsubDestination. */ - public pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + constructor(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest); - /** FeedOutputConfig destination. */ - public destination?: "pubsubDestination"; + /** GetFeedRequest name. */ + public name: string; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns FeedOutputConfig instance + * @returns GetFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig): google.cloud.asset.v1p2beta1.FeedOutputConfig; + public static create(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FeedOutputConfig + * @returns GetFeedRequest * @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.asset.v1p2beta1.FeedOutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FeedOutputConfig + * @returns GetFeedRequest * @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.asset.v1p2beta1.FeedOutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Verifies a FeedOutputConfig message. + * Verifies a GetFeedRequest 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 FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FeedOutputConfig + * @returns GetFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.FeedOutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. - * @param message FeedOutputConfig + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this GetFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Feed. */ - interface IFeed { - - /** Feed name */ - name?: (string|null); - - /** Feed assetNames */ - assetNames?: (string[]|null); - - /** Feed assetTypes */ - assetTypes?: (string[]|null); - - /** Feed contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { - /** Feed feedOutputConfig */ - feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + /** ListFeedsRequest parent */ + parent?: (string|null); } - /** Represents a Feed. */ - class Feed implements IFeed { + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { /** - * Constructs a new Feed. + * Constructs a new ListFeedsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IFeed); - - /** Feed name. */ - public name: string; - - /** Feed assetNames. */ - public assetNames: string[]; - - /** Feed assetTypes. */ - public assetTypes: string[]; - - /** Feed contentType. */ - public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest); - /** Feed feedOutputConfig. */ - public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + /** ListFeedsRequest parent. */ + public parent: string; /** - * Creates a new Feed instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Feed instance + * @returns ListFeedsRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IFeed): google.cloud.asset.v1p2beta1.Feed; + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Feed + * @returns ListFeedsRequest * @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.asset.v1p2beta1.Feed; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Feed + * @returns ListFeedsRequest * @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.asset.v1p2beta1.Feed; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Verifies a Feed message. + * Verifies a ListFeedsRequest 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 Feed message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Feed + * @returns ListFeedsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Feed; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. - * @param message Feed + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Feed to JSON. + * Converts this ListFeedsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1p2beta1.IFeed[]|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { /** - * Constructs a new TemporalAsset. + * Constructs a new ListFeedsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse); - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1p2beta1.IFeed[]; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns ListFeedsResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns ListFeedsResponse * @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.asset.v1p2beta1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns ListFeedsResponse * @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.asset.v1p2beta1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Verifies a TemporalAsset message. + * Verifies a ListFeedsResponse 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this ListFeedsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { /** - * Constructs a new TimeWindow. + * Constructs a new UpdateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns UpdateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; + public static create(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns UpdateFeedRequest * @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.asset.v1p2beta1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns UpdateFeedRequest * @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.asset.v1p2beta1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Verifies a TimeWindow message. + * Verifies an UpdateFeedRequest 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. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns UpdateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this UpdateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { - /** Asset name */ + /** DeleteFeedRequest name */ name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1p2beta1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset iamPolicyName */ - iamPolicyName?: (Uint8Array|string|null); - - /** Asset ancestors */ - ancestors?: (string[]|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { /** - * Constructs a new Asset. + * Constructs a new DeleteFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); + constructor(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest); - /** Asset name. */ + /** DeleteFeedRequest name. */ public name: string; - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1p2beta1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset iamPolicyName. */ - public iamPolicyName: (Uint8Array|string); - - /** Asset ancestors. */ - public ancestors: string[]; + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns DeleteFeedRequest * @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.asset.v1p2beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns DeleteFeedRequest * @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.asset.v1p2beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Verifies an Asset message. + * Verifies a DeleteFeedRequest 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns DeleteFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this DeleteFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** Resource version */ - version?: (string|null); + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + } - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IOutputConfig); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); - /** Resource parent */ - parent?: (string|null); + /** OutputConfig destination. */ + public destination?: "gcsDestination"; - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IOutputConfig): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource internalData */ - internalData?: (google.protobuf.IAny|null); - } + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Resource. */ - class Resource implements IResource { + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Constructs a new Resource. - * @param [properties] Properties to set + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.cloud.asset.v1p2beta1.IResource); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource version. */ - public version: string; + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @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.asset.v1p2beta1.OutputConfig; - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** + * Verifies an OutputConfig 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); - /** Resource discoveryName. */ - public discoveryName: string; + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Resource parent. */ - public parent: string; + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } - /** Resource internalData. */ - public internalData?: (google.protobuf.IAny|null); + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Creates a new Resource instance using the specified properties. + * Constructs a new GcsDestination. * @param [properties] Properties to set - * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; + constructor(properties?: google.cloud.asset.v1p2beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination objectUri. */ + public objectUri?: "uri"; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IGcsDestination): google.cloud.asset.v1p2beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns GcsDestination * @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.asset.v1p2beta1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GcsDestination; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns GcsDestination * @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.asset.v1p2beta1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GcsDestination; /** - * Verifies a Resource message. + * Verifies a GcsDestination 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GcsDestination; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubDestination + * @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.asset.v1p2beta1.PubsubDestination; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubDestination + * @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.asset.v1p2beta1.PubsubDestination; + + /** + * Verifies a PubsubDestination 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 PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { + + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + } + + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { + + /** + * Constructs a new FeedOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig); + + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedOutputConfig + * @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.asset.v1p2beta1.FeedOutputConfig; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedOutputConfig + * @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.asset.v1p2beta1.FeedOutputConfig; + + /** + * Verifies a FeedOutputConfig 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 FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Feed. */ + interface IFeed { + + /** Feed name */ + name?: (string|null); + + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + } + + /** Represents a Feed. */ + class Feed implements IFeed { + + /** + * Constructs a new Feed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeed); + + /** Feed name. */ + public name: string; + + /** Feed assetNames. */ + public assetNames: string[]; + + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + + /** + * Creates a new Feed instance using the specified properties. + * @param [properties] Properties to set + * @returns Feed instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeed): google.cloud.asset.v1p2beta1.Feed; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feed + * @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.asset.v1p2beta1.Feed; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feed + * @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.asset.v1p2beta1.Feed; + + /** + * Verifies a Feed 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 Feed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Feed; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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; - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } + /** + * 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 }; - /** Namespace api. */ - namespace api { + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } /** Properties of a Http. */ interface IHttp { @@ -5844,232 +6659,6 @@ export namespace google { 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. */ @@ -7929,11 +8518,11 @@ export namespace google { /** 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); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); } /** Represents a FieldOptions. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index f311118aeb2..f8039941e01 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -66,6 +66,1074 @@ */ var v1 = {}; + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.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.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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 && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("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.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.ancestors = []; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + v1.AssetService = (function() { /** @@ -4092,24 +5160,36 @@ return Feed; })(); - v1.TemporalAsset = (function() { + return v1; + })(); + + asset.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1beta1 = {}; + + v1beta1.TemporalAsset = (function() { /** * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset */ /** * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents a TemporalAsset. * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set */ function TemporalAsset(properties) { if (properties) @@ -4120,8 +5200,8 @@ /** * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset + * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ TemporalAsset.prototype.window = null; @@ -4129,15 +5209,15 @@ /** * TemporalAsset deleted. * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ TemporalAsset.prototype.deleted = false; /** * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ TemporalAsset.prototype.asset = null; @@ -4145,21 +5225,21 @@ /** * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance */ TemporalAsset.create = function create(properties) { return new TemporalAsset(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4167,20 +5247,20 @@ if (!writer) writer = $Writer.create(); if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.deleted != null && message.hasOwnProperty("deleted")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4191,29 +5271,29 @@ /** * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TemporalAsset.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.asset.v1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); break; case 2: message.deleted = reader.bool(); break; case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4226,10 +5306,10 @@ /** * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4242,7 +5322,7 @@ /** * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4251,7 +5331,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); if (error) return "window." + error; } @@ -4259,7 +5339,7 @@ if (typeof message.deleted !== "boolean") return "deleted: boolean expected"; if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); if (error) return "asset." + error; } @@ -4269,26 +5349,26 @@ /** * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset */ TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); + var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); if (object.window != null) { if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); } if (object.deleted != null) message.deleted = Boolean(object.deleted); if (object.asset != null) { if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); } return message; }; @@ -4296,9 +5376,9 @@ /** * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4312,18 +5392,18 @@ object.asset = null; } if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); if (message.deleted != null && message.hasOwnProperty("deleted")) object.deleted = message.deleted; if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); return object; }; /** * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance * @returns {Object.} JSON object */ @@ -4334,11 +5414,11 @@ return TemporalAsset; })(); - v1.TimeWindow = (function() { + v1beta1.TimeWindow = (function() { /** * Properties of a TimeWindow. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface ITimeWindow * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime @@ -4346,11 +5426,11 @@ /** * Constructs a new TimeWindow. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents a TimeWindow. * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set */ function TimeWindow(properties) { if (properties) @@ -4362,7 +5442,7 @@ /** * TimeWindow startTime. * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance */ TimeWindow.prototype.startTime = null; @@ -4370,7 +5450,7 @@ /** * TimeWindow endTime. * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance */ TimeWindow.prototype.endTime = null; @@ -4378,21 +5458,21 @@ /** * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance */ TimeWindow.create = function create(properties) { return new TimeWindow(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4407,11 +5487,11 @@ }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4422,18 +5502,18 @@ /** * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.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.asset.v1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4454,10 +5534,10 @@ /** * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4470,7 +5550,7 @@ /** * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4494,23 +5574,23 @@ /** * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow */ TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); + var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); if (object.startTime != null) { if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.startTime: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.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.asset.v1.TimeWindow.endTime: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } return message; @@ -4519,9 +5599,9 @@ /** * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1beta1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4543,7 +5623,7 @@ /** * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance * @returns {Object.} JSON object */ @@ -4554,29 +5634,27 @@ return TimeWindow; })(); - v1.Asset = (function() { + v1beta1.Asset = (function() { /** * Properties of an Asset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface IAsset * @property {string|null} [name] Asset name * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [ancestors] Asset ancestors */ /** * Constructs a new Asset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents an Asset. * @implements IAsset * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set */ function Asset(properties) { - this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4586,7 +5664,7 @@ /** * Asset name. * @member {string} name - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.name = ""; @@ -4594,15 +5672,15 @@ /** * Asset assetType. * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.assetType = ""; /** * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset + * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.resource = null; @@ -4610,37 +5688,29 @@ /** * Asset iamPolicy. * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.iamPolicy = null; - /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.ancestors = $util.emptyArray; - /** * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Asset} Asset instance */ Asset.create = function create(properties) { return new Asset(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4652,21 +5722,18 @@ if (message.assetType != null && message.hasOwnProperty("assetType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4677,18 +5744,18 @@ /** * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Asset.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.asset.v1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4699,16 +5766,11 @@ message.assetType = reader.string(); break; case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); break; case 4: message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; default: reader.skipType(tag & 7); break; @@ -4720,10 +5782,10 @@ /** * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4736,7 +5798,7 @@ /** * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4751,7 +5813,7 @@ if (!$util.isString(message.assetType)) return "assetType: string expected"; if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); if (error) return "resource." + error; } @@ -4760,58 +5822,44 @@ if (error) return "iamPolicy." + error; } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; - } return null; }; /** * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.Asset} Asset */ Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) + if (object instanceof $root.google.cloud.asset.v1beta1.Asset) return object; - var message = new $root.google.cloud.asset.v1.Asset(); + var message = new $root.google.cloud.asset.v1beta1.Asset(); if (object.name != null) message.name = String(object.name); if (object.assetType != null) message.assetType = String(object.assetType); if (object.resource != null) { if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); } if (object.iamPolicy != null) { if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } return message; }; /** * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.Asset} message Asset + * @param {google.cloud.asset.v1beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4819,8 +5867,6 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.ancestors = []; if (options.defaults) { object.name = ""; object.assetType = ""; @@ -4832,21 +5878,16 @@ if (message.assetType != null && message.hasOwnProperty("assetType")) object.assetType = message.assetType; if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; - } return object; }; /** * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance * @returns {Object.} JSON object */ @@ -4857,11 +5898,11 @@ return Asset; })(); - v1.Resource = (function() { + v1beta1.Resource = (function() { /** * Properties of a Resource. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface IResource * @property {string|null} [version] Resource version * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri @@ -4873,11 +5914,11 @@ /** * Constructs a new Resource. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents a Resource. * @implements IResource * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set */ function Resource(properties) { if (properties) @@ -4889,7 +5930,7 @@ /** * Resource version. * @member {string} version - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.version = ""; @@ -4897,7 +5938,7 @@ /** * Resource discoveryDocumentUri. * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.discoveryDocumentUri = ""; @@ -4905,7 +5946,7 @@ /** * Resource discoveryName. * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.discoveryName = ""; @@ -4913,7 +5954,7 @@ /** * Resource resourceUrl. * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.resourceUrl = ""; @@ -4921,7 +5962,7 @@ /** * Resource parent. * @member {string} parent - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.parent = ""; @@ -4929,7 +5970,7 @@ /** * Resource data. * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.data = null; @@ -4937,21 +5978,21 @@ /** * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Resource} Resource instance */ Resource.create = function create(properties) { return new Resource(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4974,11 +6015,11 @@ }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4989,18 +6030,18 @@ /** * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Resource.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.asset.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5033,10 +6074,10 @@ /** * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -5049,7 +6090,7 @@ /** * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -5083,15 +6124,15 @@ /** * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.Resource} Resource */ Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) + if (object instanceof $root.google.cloud.asset.v1beta1.Resource) return object; - var message = new $root.google.cloud.asset.v1.Resource(); + var message = new $root.google.cloud.asset.v1beta1.Resource(); if (object.version != null) message.version = String(object.version); if (object.discoveryDocumentUri != null) @@ -5104,7 +6145,7 @@ message.parent = String(object.parent); if (object.data != null) { if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; @@ -5113,9 +6154,9 @@ /** * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.Resource} message Resource + * @param {google.cloud.asset.v1beta1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -5149,7 +6190,7 @@ /** * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance * @returns {Object.} JSON object */ @@ -5160,18 +6201,6 @@ return Resource; })(); - return v1; - })(); - - asset.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1beta1 = {}; - v1beta1.AssetService = (function() { /** @@ -6534,6 +7563,7 @@ * @memberof google.cloud.asset.v1beta1 * @interface IGcsDestination * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix */ /** @@ -6559,17 +7589,25 @@ */ GcsDestination.prototype.uri = ""; + /** + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * GcsDestination objectUri. - * @member {"uri"|undefined} objectUri + * @member {"uri"|"uriPrefix"|undefined} objectUri * @memberof google.cloud.asset.v1beta1.GcsDestination * @instance */ Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), set: $util.oneOfSetter($oneOfFields) }); @@ -6599,6 +7637,8 @@ writer = $Writer.create(); if (message.uri != null && message.hasOwnProperty("uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; @@ -6636,6 +7676,9 @@ case 1: message.uri = reader.string(); break; + case 2: + message.uriPrefix = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -6677,6 +7720,13 @@ if (!$util.isString(message.uri)) return "uri: string expected"; } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } return null; }; @@ -6694,6 +7744,8 @@ var message = new $root.google.cloud.asset.v1beta1.GcsDestination(); if (object.uri != null) message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); return message; }; @@ -6715,6 +7767,11 @@ if (options.oneofs) object.objectUri = "uri"; } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } return object; }; @@ -6748,26 +7805,42 @@ return values; })(); - v1beta1.TemporalAsset = (function() { + return v1beta1; + })(); + + asset.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.StandardResourceMetadata = (function() { /** - * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset + * Properties of a StandardResourceMetadata. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IStandardResourceMetadata + * @property {string|null} [name] StandardResourceMetadata name + * @property {string|null} [assetType] StandardResourceMetadata assetType + * @property {string|null} [project] StandardResourceMetadata project + * @property {string|null} [displayName] StandardResourceMetadata displayName + * @property {string|null} [description] StandardResourceMetadata description + * @property {Array.|null} [additionalAttributes] StandardResourceMetadata additionalAttributes */ /** - * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * Constructs a new StandardResourceMetadata. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a StandardResourceMetadata. + * @implements IStandardResourceMetadata * @constructor - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set */ - function TemporalAsset(properties) { + function StandardResourceMetadata(properties) { + this.additionalAttributes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6775,101 +7848,143 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * StandardResourceMetadata name. + * @member {string} name + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - TemporalAsset.prototype.window = null; + StandardResourceMetadata.prototype.name = ""; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * StandardResourceMetadata assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - TemporalAsset.prototype.deleted = false; + StandardResourceMetadata.prototype.assetType = ""; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * StandardResourceMetadata project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - TemporalAsset.prototype.asset = null; + StandardResourceMetadata.prototype.project = ""; /** - * Creates a new TemporalAsset instance using the specified properties. + * StandardResourceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.displayName = ""; + + /** + * StandardResourceMetadata description. + * @member {string} description + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.description = ""; + + /** + * StandardResourceMetadata additionalAttributes. + * @member {Array.} additionalAttributes + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.additionalAttributes = $util.emptyArray; + + /** + * Creates a new StandardResourceMetadata instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + StandardResourceMetadata.create = function create(properties) { + return new StandardResourceMetadata(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + StandardResourceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.additionalAttributes != null && message.additionalAttributes.length) + for (var i = 0; i < message.additionalAttributes.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.additionalAttributes[i]); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + StandardResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a StandardResourceMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + StandardResourceMetadata.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.asset.v1beta1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.deleted = reader.bool(); + message.assetType = reader.string(); break; case 3: - message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); + message.project = reader.string(); + break; + case 4: + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 10: + if (!(message.additionalAttributes && message.additionalAttributes.length)) + message.additionalAttributes = []; + message.additionalAttributes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -6880,135 +7995,163 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + StandardResourceMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies a StandardResourceMetadata message. * @function verify - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + StandardResourceMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + if (!Array.isArray(message.additionalAttributes)) + return "additionalAttributes: array expected"; + for (var i = 0; i < message.additionalAttributes.length; ++i) + if (!$util.isString(message.additionalAttributes[i])) + return "additionalAttributes: string[] expected"; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) + StandardResourceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata) return object; - var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); + var message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.additionalAttributes) { + if (!Array.isArray(object.additionalAttributes)) + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.additionalAttributes: array expected"); + message.additionalAttributes = []; + for (var i = 0; i < object.additionalAttributes.length; ++i) + message.additionalAttributes[i] = String(object.additionalAttributes[i]); } return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1p1beta1.StandardResourceMetadata} message StandardResourceMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + StandardResourceMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalAttributes = []; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.additionalAttributes && message.additionalAttributes.length) { + object.additionalAttributes = []; + for (var j = 0; j < message.additionalAttributes.length; ++j) + object.additionalAttributes[j] = message.additionalAttributes[j]; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this StandardResourceMetadata to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + StandardResourceMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return StandardResourceMetadata; })(); - v1beta1.TimeWindow = (function() { + v1p1beta1.IamPolicySearchResult = (function() { /** - * Properties of a TimeWindow. - * @memberof google.cloud.asset.v1beta1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy */ /** - * Constructs a new TimeWindow. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult * @constructor - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set */ - function TimeWindow(properties) { + function IamPolicySearchResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7016,88 +8159,101 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1beta1.TimeWindow + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance */ - TimeWindow.prototype.startTime = null; + IamPolicySearchResult.prototype.resource = ""; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1beta1.TimeWindow + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance */ - TimeWindow.prototype.endTime = null; + IamPolicySearchResult.prototype.project = ""; /** - * Creates a new TimeWindow instance using the specified properties. + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + IamPolicySearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.policy != null && message.hasOwnProperty("policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an IamPolicySearchResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult * @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) { + IamPolicySearchResult.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.asset.v1beta1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.resource = reader.string(); break; - case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 3: + message.project = reader.string(); + break; + case 4: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7108,129 +8264,301 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult * @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) { + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies an IamPolicySearchResult message. * @function verify - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @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) { + IamPolicySearchResult.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 (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); if (error) - return "endTime." + error; + return "policy." + error; } return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.TimeWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow - */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) - return object; - var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult} message IamPolicySearchResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + IamPolicySearchResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.resource = ""; + object.project = ""; + object.policy = 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); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this IamPolicySearchResult to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + IamPolicySearchResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return IamPolicySearchResult; })(); - v1beta1.Asset = (function() { + v1p1beta1.AssetService = (function() { /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} [response] SearchResourcesResponse + */ + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchResources = function searchResources(request, callback) { + return this.rpcCall(searchResources, $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse, request, callback); + }, "name", { value: "SearchResources" }); + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} [response] SearchIamPoliciesResponse + */ + + /** + * Calls SearchIamPolicies. + * @function searchIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchIamPolicies = function searchIamPolicies(request, callback) { + return this.rpcCall(searchIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, request, callback); + }, "name", { value: "SearchIamPolicies" }); + + /** + * Calls SearchIamPolicies. + * @function searchIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse + */ + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { + return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, request, callback); + }, "name", { value: "SearchAllResources" }); + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse + */ + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { + return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, request, callback); + }, "name", { value: "SearchAllIamPolicies" }); + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p1beta1.SearchResourcesRequest = (function() { + + /** + * Properties of a SearchResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchResourcesRequest + * @property {string|null} [scope] SearchResourcesRequest scope + * @property {string|null} [query] SearchResourcesRequest query + * @property {Array.|null} [assetTypes] SearchResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchResourcesRequest pageSize + * @property {string|null} [pageToken] SearchResourcesRequest pageToken + */ + + /** + * Constructs a new SearchResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchResourcesRequest. + * @implements ISearchResourcesRequest * @constructor - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set */ - function Asset(properties) { + function SearchResourcesRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7238,114 +8566,130 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.name = ""; + SearchResourcesRequest.prototype.scope = ""; /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.assetType = ""; + SearchResourcesRequest.prototype.query = ""; /** - * Asset resource. - * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.resource = null; + SearchResourcesRequest.prototype.assetTypes = $util.emptyArray; /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.iamPolicy = null; + SearchResourcesRequest.prototype.pageSize = 0; /** - * Creates a new Asset instance using the specified properties. + * SearchResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Asset} Asset instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest instance */ - Asset.create = function create(properties) { - return new Asset(properties); + SearchResourcesRequest.create = function create(properties) { + return new SearchResourcesRequest(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + SearchResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a SearchResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + SearchResourcesRequest.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.asset.v1beta1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.scope = reader.string(); break; case 2: - message.assetType = reader.string(); + message.query = reader.string(); break; case 3: - message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); break; case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -7356,147 +8700,155 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a SearchResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + SearchResourcesRequest.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: 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 an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Asset) + SearchResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); } + 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 an Asset message. Also converts values to other types if specified. + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.Asset} message Asset + * @param {google.cloud.asset.v1p1beta1.SearchResourcesRequest} message SearchResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + SearchResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this Asset to JSON. + * Converts this SearchResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + SearchResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return SearchResourcesRequest; })(); - v1beta1.Resource = (function() { + v1p1beta1.SearchResourcesResponse = (function() { /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data + * Properties of a SearchResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchResourcesResponse + * @property {Array.|null} [results] SearchResourcesResponse results + * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken */ /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a Resource. - * @implements IResource + * Constructs a new SearchResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchResourcesResponse. + * @implements ISearchResourcesResponse * @constructor - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set */ - function Resource(properties) { + function SearchResourcesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7504,140 +8856,91 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; - - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.Resource + * SearchResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance */ - Resource.prototype.parent = ""; + SearchResourcesResponse.prototype.results = $util.emptyArray; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1beta1.Resource + * SearchResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance */ - Resource.prototype.data = null; + SearchResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new Resource instance using the specified properties. + * Creates a new SearchResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Resource} Resource instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse instance */ - Resource.create = function create(properties) { - return new Resource(properties); + SearchResourcesResponse.create = function create(properties) { + return new SearchResourcesResponse(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + SearchResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a SearchResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + SearchResourcesResponse.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.asset.v1beta1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); break; case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -7648,435 +8951,622 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a SearchResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + SearchResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Resource) + SearchResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.Resource} message Resource + * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} message SearchResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + SearchResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Resource to JSON. + * Converts this SearchResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + SearchResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return SearchResourcesResponse; })(); - return v1beta1; - })(); - - asset.v1p2beta1 = (function() { - - /** - * Namespace v1p2beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1p2beta1 = {}; + v1p1beta1.SearchIamPoliciesRequest = (function() { - v1p2beta1.AssetService = (function() { + /** + * Properties of a SearchIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchIamPoliciesRequest + * @property {string|null} [scope] SearchIamPoliciesRequest scope + * @property {string|null} [query] SearchIamPoliciesRequest query + * @property {number|null} [pageSize] SearchIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchIamPoliciesRequest pageToken + */ /** - * Constructs a new AssetService service. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an AssetService - * @extends $protobuf.rpc.Service + * Constructs a new SearchIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchIamPoliciesRequest. + * @implements ISearchIamPoliciesRequest * @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 + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set */ - function AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function SearchIamPoliciesRequest(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]]; } - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + /** + * SearchIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.scope = ""; /** - * Creates new AssetService service using the specified rpc implementation. + * SearchIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.query = ""; + + /** + * SearchIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.pageSize = 0; + + /** + * SearchIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.AssetService + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest instance */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + SearchIamPoliciesRequest.create = function create(properties) { + return new SearchIamPoliciesRequest(properties); }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#exportAssets}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef ExportAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + SearchIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scope); + return writer; + }; /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { - return this.rpcCall(exportAssets, $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportAssets" }); + SearchIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SearchIamPoliciesRequest.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.asset.v1p1beta1.SearchIamPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.scope = reader.string(); + break; + case 1: + message.query = 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; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#batchGetAssetsHistory}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef BatchGetAssetsHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SearchIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - * @returns {undefined} - * @variation 1 + * Verifies a SearchIamPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { - return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, request, callback); - }, "name", { value: "BatchGetAssetsHistory" }); + SearchIamPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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; + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest */ + SearchIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef CreateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} message SearchIamPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + SearchIamPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.scope = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + return object; + }; /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * Converts this SearchIamPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { - return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "CreateFeed" }); + SearchIamPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchIamPoliciesRequest; + })(); + + v1p1beta1.SearchIamPoliciesResponse = (function() { /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a SearchIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchIamPoliciesResponse + * @property {Array.|null} [results] SearchIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchIamPoliciesResponse nextPageToken */ /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef GetFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Constructs a new SearchIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchIamPoliciesResponse. + * @implements ISearchIamPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set */ + function SearchIamPoliciesResponse(properties) { + this.results = []; + 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]]; + } /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * SearchIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { - return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "GetFeed" }); + SearchIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * SearchIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + SearchIamPoliciesResponse.prototype.nextPageToken = ""; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef ListFeedsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse + * Creates a new SearchIamPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse instance */ + SearchIamPoliciesResponse.create = function create(properties) { + return new SearchIamPoliciesResponse(properties); + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { - return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); - }, "name", { value: "ListFeeds" }); + SearchIamPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + SearchIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef UpdateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SearchIamPoliciesResponse.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.asset.v1p1beta1.SearchIamPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { - return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "UpdateFeed" }); + SearchIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a SearchIamPoliciesResponse message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + SearchIamPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef DeleteFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse */ + SearchIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} message SearchIamPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { - return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteFeed" }); + SearchIamPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * Converts this SearchIamPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + SearchIamPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AssetService; + return SearchIamPoliciesResponse; })(); - v1p2beta1.ExportAssetsRequest = (function() { + v1p1beta1.SearchAllResourcesRequest = (function() { /** - * Properties of an ExportAssetsRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IExportAssetsRequest - * @property {string|null} [parent] ExportAssetsRequest parent - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime - * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] ExportAssetsRequest contentType - * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * Properties of a SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllResourcesRequest + * @property {string|null} [scope] SearchAllResourcesRequest scope + * @property {string|null} [query] SearchAllResourcesRequest query + * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize + * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken */ /** - * Constructs a new ExportAssetsRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an ExportAssetsRequest. - * @implements IExportAssetsRequest + * Constructs a new SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllResourcesRequest. + * @implements ISearchAllResourcesRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set */ - function ExportAssetsRequest(properties) { + function SearchAllResourcesRequest(properties) { this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -8085,119 +9575,119 @@ } /** - * ExportAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.parent = ""; + SearchAllResourcesRequest.prototype.scope = ""; /** - * ExportAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.readTime = null; + SearchAllResourcesRequest.prototype.query = ""; /** - * ExportAssetsRequest assetTypes. + * SearchAllResourcesRequest assetTypes. * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; /** - * ExportAssetsRequest contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.contentType = 0; + SearchAllResourcesRequest.prototype.pageSize = 0; /** - * ExportAssetsRequest outputConfig. - * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.outputConfig = null; + SearchAllResourcesRequest.prototype.pageToken = ""; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest instance */ - ExportAssetsRequest.create = function create(properties) { - return new ExportAssetsRequest(properties); + SearchAllResourcesRequest.create = function create(properties) { + return new SearchAllResourcesRequest(properties); }; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encode = function encode(message, writer) { + SearchAllResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decode = function decode(reader, length) { + SearchAllResourcesRequest.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.asset.v1p2beta1.ExportAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.scope = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.query = reader.string(); break; case 3: if (!(message.assetTypes && message.assetTypes.length)) @@ -8205,10 +9695,10 @@ message.assetTypes.push(reader.string()); break; case 4: - message.contentType = reader.int32(); + message.pageSize = reader.int32(); break; case 5: - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8219,40 +9709,38 @@ }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsRequest message. + * Verifies a SearchAllResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsRequest.verify = function verify(message) { + SearchAllResourcesRequest.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.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { if (!Array.isArray(message.assetTypes)) return "assetTypes: array expected"; @@ -8260,156 +9748,116 @@ if (!$util.isString(message.assetTypes[i])) return "assetTypes: string[] expected"; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + 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"; return null; }; /** - * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest */ - ExportAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest) + SearchAllResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); if (object.assetTypes) { if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.assetTypes: array expected"); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.assetTypes: array expected"); message.assetTypes = []; for (var i = 0; i < object.assetTypes.length; ++i) message.assetTypes[i] = String(object.assetTypes[i]); } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "IAM_POLICY_NAME": - case 3: - message.contentType = 3; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); - } + 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 an ExportAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.ExportAssetsRequest} message ExportAssetsRequest + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} message SearchAllResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsRequest.toObject = function toObject(message, options) { + SearchAllResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.assetTypes = []; if (options.defaults) { - object.parent = ""; - object.readTime = null; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.outputConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; if (message.assetTypes && message.assetTypes.length) { object.assetTypes = []; for (var j = 0; j < message.assetTypes.length; ++j) object.assetTypes[j] = message.assetTypes[j]; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance * @returns {Object.} JSON object */ - ExportAssetsRequest.prototype.toJSON = function toJSON() { + SearchAllResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsRequest; + return SearchAllResourcesRequest; })(); - v1p2beta1.ExportAssetsResponse = (function() { + v1p1beta1.SearchAllResourcesResponse = (function() { /** - * Properties of an ExportAssetsResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IExportAssetsResponse - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime - * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * Properties of a SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllResourcesResponse + * @property {Array.|null} [results] SearchAllResourcesResponse results + * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken */ /** - * Constructs a new ExportAssetsResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an ExportAssetsResponse. - * @implements IExportAssetsResponse + * Constructs a new SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllResourcesResponse. + * @implements ISearchAllResourcesResponse * @constructor - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set */ - function ExportAssetsResponse(properties) { + function SearchAllResourcesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8417,88 +9865,91 @@ } /** - * ExportAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * SearchAllResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance */ - ExportAssetsResponse.prototype.readTime = null; + SearchAllResourcesResponse.prototype.results = $util.emptyArray; /** - * ExportAssetsResponse outputConfig. - * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * SearchAllResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance */ - ExportAssetsResponse.prototype.outputConfig = null; + SearchAllResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse instance */ - ExportAssetsResponse.create = function create(properties) { - return new ExportAssetsResponse(properties); + SearchAllResourcesResponse.create = function create(properties) { + return new SearchAllResourcesResponse(properties); }; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encode = function encode(message, writer) { + SearchAllResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decode = function decode(reader, length) { + SearchAllResourcesResponse.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.asset.v1p2beta1.ExportAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); break; case 2: - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8509,130 +9960,136 @@ }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsResponse message. + * Verifies a SearchAllResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsResponse.verify = function verify(message) { + SearchAllResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse */ - ExportAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse) + SearchAllResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} message SearchAllResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsResponse.toObject = function toObject(message, options) { + SearchAllResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.readTime = null; - object.outputConfig = null; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance * @returns {Object.} JSON object */ - ExportAssetsResponse.prototype.toJSON = function toJSON() { + SearchAllResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsResponse; + return SearchAllResourcesResponse; })(); - v1p2beta1.BatchGetAssetsHistoryRequest = (function() { + v1p1beta1.SearchAllIamPoliciesRequest = (function() { /** - * Properties of a BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IBatchGetAssetsHistoryRequest - * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent - * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType - * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + * Properties of a SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllIamPoliciesRequest + * @property {string|null} [scope] SearchAllIamPoliciesRequest scope + * @property {string|null} [query] SearchAllIamPoliciesRequest query + * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken */ /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a BatchGetAssetsHistoryRequest. - * @implements IBatchGetAssetsHistoryRequest + * Constructs a new SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllIamPoliciesRequest. + * @implements ISearchAllIamPoliciesRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set */ - function BatchGetAssetsHistoryRequest(properties) { - this.assetNames = []; + function SearchAllIamPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8640,117 +10097,114 @@ } /** - * BatchGetAssetsHistoryRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.parent = ""; + SearchAllIamPoliciesRequest.prototype.scope = ""; /** - * BatchGetAssetsHistoryRequest assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + SearchAllIamPoliciesRequest.prototype.query = ""; /** - * BatchGetAssetsHistoryRequest contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.contentType = 0; + SearchAllIamPoliciesRequest.prototype.pageSize = 0; /** - * BatchGetAssetsHistoryRequest readTimeWindow. - * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} readTimeWindow - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + SearchAllIamPoliciesRequest.prototype.pageToken = ""; /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance */ - BatchGetAssetsHistoryRequest.create = function create(properties) { - return new BatchGetAssetsHistoryRequest(properties); + SearchAllIamPoliciesRequest.create = function create(properties) { + return new SearchAllIamPoliciesRequest(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + SearchAllIamPoliciesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decode = function decode(reader, length) { + SearchAllIamPoliciesRequest.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.asset.v1p2beta1.BatchGetAssetsHistoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.scope = reader.string(); break; case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); + message.query = reader.string(); break; case 3: - message.contentType = reader.int32(); + message.pageSize = reader.int32(); break; case 4: - message.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8761,184 +10215,134 @@ }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a SearchAllIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryRequest.verify = function verify(message) { + SearchAllIamPoliciesRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { - var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.readTimeWindow); - if (error) - return "readTimeWindow." + error; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest */ - BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest) + SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "IAM_POLICY_NAME": - case 3: - message.contentType = 3; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.readTimeWindow != null) { - if (typeof object.readTimeWindow !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); - message.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.readTimeWindow); - } + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + 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 BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetNames = []; if (options.defaults) { - object.parent = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.readTimeWindow = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - object.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.readTimeWindow, options); + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this SearchAllIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryRequest; + return SearchAllIamPoliciesRequest; })(); - v1p2beta1.BatchGetAssetsHistoryResponse = (function() { + v1p1beta1.SearchAllIamPoliciesResponse = (function() { /** - * Properties of a BatchGetAssetsHistoryResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IBatchGetAssetsHistoryResponse - * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + * Properties of a SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllIamPoliciesResponse + * @property {Array.|null} [results] SearchAllIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken */ /** - * Constructs a new BatchGetAssetsHistoryResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a BatchGetAssetsHistoryResponse. - * @implements IBatchGetAssetsHistoryResponse + * Constructs a new SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllIamPoliciesResponse. + * @implements ISearchAllIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set */ - function BatchGetAssetsHistoryResponse(properties) { - this.assets = []; + function SearchAllIamPoliciesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8946,78 +10350,91 @@ } /** - * BatchGetAssetsHistoryResponse assets. - * @member {Array.} assets - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * SearchAllIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance */ - BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * SearchAllIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @instance + */ + SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance */ - BatchGetAssetsHistoryResponse.create = function create(properties) { - return new BatchGetAssetsHistoryResponse(properties); + SearchAllIamPoliciesResponse.create = function create(properties) { + return new SearchAllIamPoliciesResponse(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + SearchAllIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.assets != null && message.assets.length) - for (var i = 0; i < message.assets.length; ++i) - $root.google.cloud.asset.v1p2beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decode = function decode(reader, length) { + SearchAllIamPoliciesResponse.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.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1p2beta1.TemporalAsset.decode(reader, reader.uint32())); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9028,126 +10445,147 @@ }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies a SearchAllIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryResponse.verify = function verify(message) { + SearchAllIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.assets != null && message.hasOwnProperty("assets")) { - if (!Array.isArray(message.assets)) - return "assets: array expected"; - for (var i = 0; i < message.assets.length; ++i) { - var error = $root.google.cloud.asset.v1p2beta1.TemporalAsset.verify(message.assets[i]); + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); if (error) - return "assets." + error; + return "results." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse */ - BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) + SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); - if (object.assets) { - if (!Array.isArray(object.assets)) - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: array expected"); - message.assets = []; - for (var i = 0; i < object.assets.length; ++i) { - if (typeof object.assets[i] !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: object expected"); - message.assets[i] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.fromObject(object.assets[i]); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.assets = []; - if (message.assets && message.assets.length) { - object.assets = []; - for (var j = 0; j < message.assets.length; ++j) - object.assets[j] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.toObject(message.assets[j], options); - } + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this SearchAllIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryResponse; + return SearchAllIamPoliciesResponse; })(); - v1p2beta1.CreateFeedRequest = (function() { + return v1p1beta1; + })(); + + asset.v1p2beta1 = (function() { + + /** + * Namespace v1p2beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p2beta1 = {}; + + v1p2beta1.TemporalAsset = (function() { /** - * Properties of a CreateFeedRequest. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1p2beta1 - * @interface ICreateFeedRequest - * @property {string|null} [parent] CreateFeedRequest parent - * @property {string|null} [feedId] CreateFeedRequest feedId - * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed + * @interface ITemporalAsset + * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset */ /** - * Constructs a new CreateFeedRequest. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a CreateFeedRequest. - * @implements ICreateFeedRequest + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set */ - function CreateFeedRequest(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9155,101 +10593,101 @@ } /** - * CreateFeedRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * TemporalAsset window. + * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - CreateFeedRequest.prototype.parent = ""; + TemporalAsset.prototype.window = null; /** - * CreateFeedRequest feedId. - * @member {string} feedId - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - CreateFeedRequest.prototype.feedId = ""; + TemporalAsset.prototype.deleted = false; /** - * CreateFeedRequest feed. - * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * TemporalAsset asset. + * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - CreateFeedRequest.prototype.feed = null; + TemporalAsset.prototype.asset = null; /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance */ - CreateFeedRequest.create = function create(properties) { - return new CreateFeedRequest(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.feedId != null && message.hasOwnProperty("feedId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decode = function decode(reader, length) { + TemporalAsset.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.asset.v1p2beta1.CreateFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); break; case 2: - message.feedId = reader.string(); + message.deleted = reader.bool(); break; case 3: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9260,129 +10698,135 @@ }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFeedRequest message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFeedRequest.verify = function verify(message) { + TemporalAsset.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.feedId != null && message.hasOwnProperty("feedId")) - if (!$util.isString(message.feedId)) - return "feedId: string expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); if (error) - return "feed." + error; + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; } return null; }; /** - * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset */ - CreateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.feedId != null) - message.feedId = String(object.feedId); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); } return message; }; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest + * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFeedRequest.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.feedId = ""; - object.feed = null; + object.window = null; + object.deleted = false; + object.asset = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.feedId != null && message.hasOwnProperty("feedId")) - object.feedId = message.feedId; - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance * @returns {Object.} JSON object */ - CreateFeedRequest.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFeedRequest; + return TemporalAsset; })(); - v1p2beta1.GetFeedRequest = (function() { + v1p2beta1.TimeWindow = (function() { /** - * Properties of a GetFeedRequest. + * Properties of a TimeWindow. * @memberof google.cloud.asset.v1p2beta1 - * @interface IGetFeedRequest - * @property {string|null} [name] GetFeedRequest name + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime */ /** - * Constructs a new GetFeedRequest. + * Constructs a new TimeWindow. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a GetFeedRequest. - * @implements IGetFeedRequest + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set */ - function GetFeedRequest(properties) { + function TimeWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9390,75 +10834,88 @@ } /** - * GetFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @instance */ - GetFeedRequest.prototype.name = ""; + TimeWindow.prototype.startTime = null; /** - * Creates a new GetFeedRequest instance using the specified properties. + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance */ - GetFeedRequest.create = function create(properties) { - return new GetFeedRequest(properties); + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); }; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encode = function encode(message, writer) { + TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decode = function decode(reader, length) { + 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.asset.v1p2beta1.GetFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + 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); @@ -9469,107 +10926,131 @@ }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + TimeWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetFeedRequest message. + * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetFeedRequest.verify = function verify(message) { + TimeWindow.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.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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow */ - GetFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) return object; - var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest + * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFeedRequest.toObject = function toObject(message, options) { + TimeWindow.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; + 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 GetFeedRequest to JSON. + * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @instance * @returns {Object.} JSON object */ - GetFeedRequest.prototype.toJSON = function toJSON() { + TimeWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetFeedRequest; + return TimeWindow; })(); - v1p2beta1.ListFeedsRequest = (function() { + v1p2beta1.Asset = (function() { /** - * Properties of a ListFeedsRequest. + * Properties of an Asset. * @memberof google.cloud.asset.v1p2beta1 - * @interface IListFeedsRequest - * @property {string|null} [parent] ListFeedsRequest parent + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors */ /** - * Constructs a new ListFeedsRequest. + * Constructs a new Asset. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a ListFeedsRequest. - * @implements IListFeedsRequest + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set */ - function ListFeedsRequest(properties) { + function Asset(properties) { + this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9577,75 +11058,130 @@ } /** - * ListFeedsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance */ - ListFeedsRequest.prototype.parent = ""; + Asset.prototype.name = ""; /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance */ - ListFeedsRequest.create = function create(properties) { - return new ListFeedsRequest(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decode = function decode(reader, length) { + Asset.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.asset.v1p2beta1.ListFeedsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Asset(); 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.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -9656,108 +11192,168 @@ }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsRequest message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsRequest.verify = function verify(message) { + Asset.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } return null; }; /** - * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset */ - ListFeedsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.asset.v1p2beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } return message; }; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest + * @param {google.cloud.asset.v1p2beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsRequest.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } return object; }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance * @returns {Object.} JSON object */ - ListFeedsRequest.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsRequest; + return Asset; })(); - v1p2beta1.ListFeedsResponse = (function() { + v1p2beta1.Resource = (function() { /** - * Properties of a ListFeedsResponse. + * Properties of a Resource. * @memberof google.cloud.asset.v1p2beta1 - * @interface IListFeedsResponse - * @property {Array.|null} [feeds] ListFeedsResponse feeds + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data */ /** - * Constructs a new ListFeedsResponse. + * Constructs a new Resource. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a ListFeedsResponse. - * @implements IListFeedsResponse + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set */ - function ListFeedsResponse(properties) { - this.feeds = []; + function Resource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9765,78 +11361,140 @@ } /** - * ListFeedsResponse feeds. - * @member {Array.} feeds - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - ListFeedsResponse.prototype.feeds = $util.emptyArray; + Resource.prototype.version = ""; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance */ - ListFeedsResponse.create = function create(properties) { - return new ListFeedsResponse(properties); + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feeds != null && message.feeds.length) - for (var i = 0; i < message.feeds.length; ++i) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decode = function decode(reader, length) { + Resource.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.asset.v1p2beta1.ListFeedsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9847,344 +11505,355 @@ }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsResponse message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsResponse.verify = function verify(message) { + Resource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.feeds != null && message.hasOwnProperty("feeds")) { - if (!Array.isArray(message.feeds)) - return "feeds: array expected"; - for (var i = 0; i < message.feeds.length; ++i) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); - if (error) - return "feeds." + error; - } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; } return null; }; /** - * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource */ - ListFeedsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); - if (object.feeds) { - if (!Array.isArray(object.feeds)) - throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); - message.feeds = []; - for (var i = 0; i < object.feeds.length; ++i) { - if (typeof object.feeds[i] !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); - message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); - } + var message = new $root.google.cloud.asset.v1p2beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; }; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse + * @param {google.cloud.asset.v1p2beta1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsResponse.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.feeds = []; - if (message.feeds && message.feeds.length) { - object.feeds = []; - for (var j = 0; j < message.feeds.length; ++j) - object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); return object; }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance * @returns {Object.} JSON object */ - ListFeedsResponse.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsResponse; + return Resource; })(); - v1p2beta1.UpdateFeedRequest = (function() { + v1p2beta1.AssetService = (function() { /** - * Properties of an UpdateFeedRequest. + * Constructs a new AssetService service. * @memberof google.cloud.asset.v1p2beta1 - * @interface IUpdateFeedRequest - * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; /** - * Constructs a new UpdateFeedRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an UpdateFeedRequest. - * @implements IUpdateFeedRequest - * @constructor - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. */ - function UpdateFeedRequest(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]]; - } + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * UpdateFeedRequest feed. - * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.prototype.feed = null; + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); /** - * UpdateFeedRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.prototype.updateMask = null; /** - * Creates a new UpdateFeedRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed */ - UpdateFeedRequest.create = function create(properties) { - return new UpdateFeedRequest(properties); - }; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "GetFeed" }); /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest - * @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.asset.v1p2beta1.AssetService#listFeeds}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse */ - UpdateFeedRequest.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.asset.v1p2beta1.UpdateFeedRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.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 UpdateFeedRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); /** - * Verifies an UpdateFeedRequest message. - * @function verify - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); - if (error) - return "feed." + 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - UpdateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) - return object; - var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.feed = null; - object.updateMask = null; - } - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); /** - * Converts this UpdateFeedRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return UpdateFeedRequest; + return AssetService; })(); - v1p2beta1.DeleteFeedRequest = (function() { + v1p2beta1.CreateFeedRequest = (function() { /** - * Properties of a DeleteFeedRequest. + * Properties of a CreateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IDeleteFeedRequest - * @property {string|null} [name] DeleteFeedRequest name + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed */ /** - * Constructs a new DeleteFeedRequest. + * Constructs a new CreateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a DeleteFeedRequest. - * @implements IDeleteFeedRequest + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set */ - function DeleteFeedRequest(properties) { + function CreateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10192,75 +11861,101 @@ } /** - * DeleteFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance */ - DeleteFeedRequest.prototype.name = ""; + CreateFeedRequest.prototype.parent = ""; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feedId = ""; + + /** + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feed = null; + + /** + * Creates a new CreateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance */ - DeleteFeedRequest.create = function create(properties) { - return new DeleteFeedRequest(properties); + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); }; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encode = function encode(message, writer) { + CreateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && message.hasOwnProperty("feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decode = function decode(reader, length) { + CreateFeedRequest.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.asset.v1p2beta1.DeleteFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10271,108 +11966,129 @@ }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteFeedRequest message. + * Verifies a CreateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteFeedRequest.verify = function verify(message) { + CreateFeedRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } return null; }; /** - * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest */ - DeleteFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } return message; }; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest + * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFeedRequest.toObject = function toObject(message, options) { + CreateFeedRequest.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; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); return object; }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this CreateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance * @returns {Object.} JSON object */ - DeleteFeedRequest.prototype.toJSON = function toJSON() { + CreateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteFeedRequest; + return CreateFeedRequest; })(); - v1p2beta1.OutputConfig = (function() { + v1p2beta1.GetFeedRequest = (function() { /** - * Properties of an OutputConfig. + * Properties of a GetFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination - * @property {google.cloud.asset.v1p2beta1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name */ /** - * Constructs a new OutputConfig. + * Constructs a new GetFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set */ - function OutputConfig(properties) { + function GetFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10380,102 +12096,75 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig - * @instance - */ - OutputConfig.prototype.gcsDestination = null; - - /** - * OutputConfig bigqueryDestination. - * @member {google.cloud.asset.v1p2beta1.IBigQueryDestination|null|undefined} bigqueryDestination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig - * @instance - */ - OutputConfig.prototype.bigqueryDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OutputConfig destination. - * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetFeedRequest.prototype.name = ""; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + GetFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) - $root.google.cloud.asset.v1p2beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + GetFeedRequest.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.asset.v1p2beta1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); - break; - case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -10486,138 +12175,107 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a GetFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + GetFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - if (properties.destination === 1) - return "destination: multiple values"; - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.verify(message.bigqueryDestination); - if (error) - return "bigqueryDestination." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); - } - if (object.bigqueryDestination != null) { - if (typeof object.bigqueryDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.bigqueryDestination: object expected"); - message.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.fromObject(object.bigqueryDestination); - } + var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig + * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + GetFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - object.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); - if (options.oneofs) - object.destination = "bigqueryDestination"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this GetFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + GetFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return GetFeedRequest; })(); - v1p2beta1.GcsDestination = (function() { + v1p2beta1.ListFeedsRequest = (function() { /** - * Properties of a GcsDestination. + * Properties of a ListFeedsRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - * @property {string|null} [uriPrefix] GcsDestination uriPrefix + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent */ /** - * Constructs a new GcsDestination. + * Constructs a new ListFeedsRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set */ - function GcsDestination(properties) { + function ListFeedsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10625,102 +12283,75 @@ } /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1p2beta1.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * GcsDestination uriPrefix. - * @member {string} uriPrefix - * @memberof google.cloud.asset.v1p2beta1.GcsDestination - * @instance - */ - GcsDestination.prototype.uriPrefix = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GcsDestination objectUri. - * @member {"uri"|"uriPrefix"|undefined} objectUri - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @instance */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListFeedsRequest.prototype.parent = ""; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encode = function encode(message, writer) { + ListFeedsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decode = function decode(reader, length) { + ListFeedsRequest.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.asset.v1p2beta1.GcsDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); - break; - case 2: - message.uriPrefix = reader.string(); + message.parent = reader.string(); break; default: reader.skipType(tag & 7); @@ -10731,127 +12362,108 @@ }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsDestination message. + * Verifies a ListFeedsRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsDestination.verify = function verify(message) { + ListFeedsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - if (properties.objectUri === 1) - return "objectUri: multiple values"; - properties.objectUri = 1; - if (!$util.isString(message.uriPrefix)) - return "uriPrefix: string expected"; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; return null; }; /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.uriPrefix != null) - message.uriPrefix = String(object.uriPrefix); + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); return message; }; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination + * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsDestination.toObject = function toObject(message, options) { + ListFeedsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - object.uriPrefix = message.uriPrefix; - if (options.oneofs) - object.objectUri = "uriPrefix"; - } + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this GcsDestination to JSON. + * Converts this ListFeedsRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @instance * @returns {Object.} JSON object */ - GcsDestination.prototype.toJSON = function toJSON() { + ListFeedsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsDestination; + return ListFeedsRequest; })(); - v1p2beta1.BigQueryDestination = (function() { + v1p2beta1.ListFeedsResponse = (function() { /** - * Properties of a BigQueryDestination. + * Properties of a ListFeedsResponse. * @memberof google.cloud.asset.v1p2beta1 - * @interface IBigQueryDestination - * @property {string|null} [dataset] BigQueryDestination dataset - * @property {string|null} [table] BigQueryDestination table - * @property {boolean|null} [force] BigQueryDestination force + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds */ /** - * Constructs a new BigQueryDestination. + * Constructs a new ListFeedsResponse. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a BigQueryDestination. - * @implements IBigQueryDestination + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse * @constructor - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set */ - function BigQueryDestination(properties) { + function ListFeedsResponse(properties) { + this.feeds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10859,101 +12471,78 @@ } /** - * BigQueryDestination dataset. - * @member {string} dataset - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.dataset = ""; - - /** - * BigQueryDestination table. - * @member {string} table - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.table = ""; - - /** - * BigQueryDestination force. - * @member {boolean} force - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @instance */ - BigQueryDestination.prototype.force = false; + ListFeedsResponse.prototype.feeds = $util.emptyArray; /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance */ - BigQueryDestination.create = function create(properties) { - return new BigQueryDestination(properties); + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); }; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encode = function encode(message, writer) { + ListFeedsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && message.hasOwnProperty("dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.table != null && message.hasOwnProperty("table")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); - if (message.force != null && message.hasOwnProperty("force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decode = function decode(reader, length) { + ListFeedsResponse.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.asset.v1p2beta1.BigQueryDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataset = reader.string(); - break; - case 2: - message.table = reader.string(); - break; - case 3: - message.force = reader.bool(); + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -10964,124 +12553,125 @@ }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQueryDestination message. + * Verifies a ListFeedsResponse message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BigQueryDestination.verify = function verify(message) { + ListFeedsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } return null; }; /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse */ - BigQueryDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.BigQueryDestination) + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) return object; - var message = new $root.google.cloud.asset.v1p2beta1.BigQueryDestination(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.table != null) - message.table = String(object.table); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); + } + } return message; }; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.BigQueryDestination} message BigQueryDestination + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQueryDestination.toObject = function toObject(message, options) { + ListFeedsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.dataset = ""; - object.table = ""; - object.force = false; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this BigQueryDestination to JSON. + * Converts this ListFeedsResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @instance * @returns {Object.} JSON object */ - BigQueryDestination.prototype.toJSON = function toJSON() { + ListFeedsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BigQueryDestination; + return ListFeedsResponse; })(); - v1p2beta1.PubsubDestination = (function() { + v1p2beta1.UpdateFeedRequest = (function() { /** - * Properties of a PubsubDestination. + * Properties of an UpdateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IPubsubDestination - * @property {string|null} [topic] PubsubDestination topic + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask */ /** - * Constructs a new PubsubDestination. + * Constructs a new UpdateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a PubsubDestination. - * @implements IPubsubDestination + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set */ - function PubsubDestination(properties) { + function UpdateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11089,75 +12679,88 @@ } /** - * PubsubDestination topic. - * @member {string} topic - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance */ - PubsubDestination.prototype.topic = ""; + UpdateFeedRequest.prototype.feed = null; /** - * Creates a new PubsubDestination instance using the specified properties. + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance */ - PubsubDestination.create = function create(properties) { - return new PubsubDestination(properties); + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); }; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encode = function encode(message, writer) { + UpdateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decode = function decode(reader, length) { + UpdateFeedRequest.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.asset.v1p2beta1.PubsubDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = reader.string(); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11168,129 +12771,126 @@ }; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubsubDestination message. + * Verifies an UpdateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubsubDestination.verify = function verify(message) { + UpdateFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + 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 a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest */ - PubsubDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); - if (object.topic != null) - message.topic = String(object.topic); + var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination + * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubsubDestination.toObject = function toObject(message, options) { + UpdateFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; + if (options.defaults) { + object.feed = null; + object.updateMask = null; + } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this PubsubDestination to JSON. + * Converts this UpdateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance * @returns {Object.} JSON object */ - PubsubDestination.prototype.toJSON = function toJSON() { + UpdateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubsubDestination; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1p2beta1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} IAM_POLICY_NAME=3 IAM_POLICY_NAME value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1p2beta1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[3] = "IAM_POLICY_NAME"] = 3; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; + return UpdateFeedRequest; })(); - v1p2beta1.FeedOutputConfig = (function() { + v1p2beta1.DeleteFeedRequest = (function() { /** - * Properties of a FeedOutputConfig. + * Properties of a DeleteFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IFeedOutputConfig - * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name */ /** - * Constructs a new FeedOutputConfig. + * Constructs a new DeleteFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a FeedOutputConfig. - * @implements IFeedOutputConfig + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set */ - function FeedOutputConfig(properties) { + function DeleteFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11298,89 +12898,75 @@ } /** - * FeedOutputConfig pubsubDestination. - * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig - * @instance - */ - FeedOutputConfig.prototype.pubsubDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * FeedOutputConfig destination. - * @member {"pubsubDestination"|undefined} destination - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @instance */ - Object.defineProperty(FeedOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteFeedRequest.prototype.name = ""; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance */ - FeedOutputConfig.create = function create(properties) { - return new FeedOutputConfig(properties); + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); }; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encode = function encode(message, writer) { + DeleteFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) - $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decode = function decode(reader, length) { + DeleteFeedRequest.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.asset.v1p2beta1.FeedOutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -11391,123 +12977,107 @@ }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FeedOutputConfig message. + * Verifies a DeleteFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FeedOutputConfig.verify = function verify(message) { + DeleteFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); - if (error) - return "pubsubDestination." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest */ - FeedOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); - if (object.pubsubDestination != null) { - if (typeof object.pubsubDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); - } + var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeedOutputConfig.toObject = function toObject(message, options) { + DeleteFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); - if (options.oneofs) - object.destination = "pubsubDestination"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this DeleteFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @instance * @returns {Object.} JSON object */ - FeedOutputConfig.prototype.toJSON = function toJSON() { + DeleteFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FeedOutputConfig; + return DeleteFeedRequest; })(); - v1p2beta1.Feed = (function() { + v1p2beta1.OutputConfig = (function() { /** - * Properties of a Feed. + * Properties of an OutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @interface IFeed - * @property {string|null} [name] Feed name - * @property {Array.|null} [assetNames] Feed assetNames - * @property {Array.|null} [assetTypes] Feed assetTypes - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType - * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + * @interface IOutputConfig + * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination */ /** - * Constructs a new Feed. + * Constructs a new OutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a Feed. - * @implements IFeed + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig * @constructor - * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set */ - function Feed(properties) { - this.assetNames = []; - this.assetTypes = []; + function OutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11515,133 +13085,89 @@ } /** - * Feed name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.Feed - * @instance - */ - Feed.prototype.name = ""; - - /** - * Feed assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1p2beta1.Feed - * @instance - */ - Feed.prototype.assetNames = $util.emptyArray; - - /** - * Feed assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p2beta1.Feed + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance */ - Feed.prototype.assetTypes = $util.emptyArray; + OutputConfig.prototype.gcsDestination = null; - /** - * Feed contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.Feed - * @instance - */ - Feed.prototype.contentType = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Feed feedOutputConfig. - * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig - * @memberof google.cloud.asset.v1p2beta1.Feed + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance */ - Feed.prototype.feedOutputConfig = null; + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Feed instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance */ - Feed.create = function create(properties) { - return new Feed(properties); + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); }; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encode = function encode(message, writer) { + OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encodeDelimited = function encodeDelimited(message, writer) { + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decode = function decode(reader, length) { + OutputConfig.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.asset.v1p2beta1.Feed(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11652,206 +13178,117 @@ }; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decodeDelimited = function decodeDelimited(reader) { + OutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Feed message. + * Verifies an OutputConfig message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Feed.verify = function verify(message) { + OutputConfig.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; } - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); - if (error) - return "feedOutputConfig." + error; } return null; }; /** - * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig */ - Feed.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Feed(); - if (object.name != null) - message.name = String(object.name); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "IAM_POLICY_NAME": - case 3: - message.contentType = 3; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.feedOutputConfig != null) { - if (typeof object.feedOutputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); + var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); } return message; }; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.Feed} message Feed + * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Feed.toObject = function toObject(message, options) { + OutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.assetNames = []; - object.assetTypes = []; - } - if (options.defaults) { - object.name = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.feedOutputConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; - } - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this Feed to JSON. + * Converts this OutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance * @returns {Object.} JSON object */ - Feed.prototype.toJSON = function toJSON() { + OutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Feed; + return OutputConfig; })(); - v1p2beta1.TemporalAsset = (function() { + v1p2beta1.GcsDestination = (function() { /** - * Properties of a TemporalAsset. + * Properties of a GcsDestination. * @memberof google.cloud.asset.v1p2beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri */ /** - * Constructs a new TemporalAsset. + * Constructs a new GcsDestination. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination * @constructor - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set */ - function TemporalAsset(properties) { + function GcsDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11859,101 +13296,89 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance */ - TemporalAsset.prototype.window = null; + GcsDestination.prototype.uri = ""; - /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.deleted = false; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * GcsDestination objectUri. + * @member {"uri"|undefined} objectUri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance */ - TemporalAsset.prototype.asset = null; + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + GcsDestination.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.asset.v1p2beta1.TemporalAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); break; default: reader.skipType(tag & 7); @@ -11964,135 +13389,111 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + GcsDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies a GcsDestination message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + GcsDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) return object; - var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); - } + var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + GcsDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this GcsDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + GcsDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return GcsDestination; })(); - v1p2beta1.TimeWindow = (function() { + v1p2beta1.PubsubDestination = (function() { /** - * Properties of a TimeWindow. + * Properties of a PubsubDestination. * @memberof google.cloud.asset.v1p2beta1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic */ /** - * Constructs a new TimeWindow. + * Constructs a new PubsubDestination. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination * @constructor - * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set */ - function TimeWindow(properties) { + function PubsubDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12100,88 +13501,75 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1p2beta1.TimeWindow - * @instance - */ - TimeWindow.prototype.startTime = null; - - /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @instance */ - TimeWindow.prototype.endTime = null; + PubsubDestination.prototype.topic = ""; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + PubsubDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination * @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) { + PubsubDestination.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.asset.v1p2beta1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); 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()); + message.topic = reader.string(); break; default: reader.skipType(tag & 7); @@ -12192,132 +13580,107 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination * @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) { + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies a PubsubDestination message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @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) { + PubsubDestination.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; - } + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) return object; - var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } + var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + PubsubDestination.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); + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this PubsubDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + PubsubDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return PubsubDestination; })(); - v1p2beta1.Asset = (function() { + v1p2beta1.FeedOutputConfig = (function() { /** - * Properties of an Asset. + * Properties of a FeedOutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Uint8Array|null} [iamPolicyName] Asset iamPolicyName - * @property {Array.|null} [ancestors] Asset ancestors + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination */ /** - * Constructs a new Asset. + * Constructs a new FeedOutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig * @constructor - * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set */ - function Asset(properties) { - this.ancestors = []; + function FeedOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12325,143 +13688,89 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.assetType = ""; - - /** - * Asset resource. - * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.resource = null; - - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1p2beta1.Asset + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance */ - Asset.prototype.iamPolicy = null; + FeedOutputConfig.prototype.pubsubDestination = null; - /** - * Asset iamPolicyName. - * @member {Uint8Array} iamPolicyName - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.iamPolicyName = $util.newBuffer([]); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1p2beta1.Asset + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance */ - Asset.prototype.ancestors = $util.emptyArray; + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Asset instance using the specified properties. + * Creates a new FeedOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance */ - Asset.create = function create(properties) { - return new Asset(properties); + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.iamPolicyName); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + FeedOutputConfig.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.asset.v1p2beta1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 5: - message.iamPolicyName = reader.bytes(); - break; - case 6: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12472,186 +13781,123 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a FeedOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + FeedOutputConfig.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) - if (!(message.iamPolicyName && typeof message.iamPolicyName.length === "number" || $util.isString(message.iamPolicyName))) - return "iamPolicyName: buffer expected"; - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.iamPolicyName != null) - if (typeof object.iamPolicyName === "string") - $util.base64.decode(object.iamPolicyName, message.iamPolicyName = $util.newBuffer($util.base64.length(object.iamPolicyName)), 0); - else if (object.iamPolicyName.length) - message.iamPolicyName = object.iamPolicyName; - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } - return message; - }; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Asset - * @static - * @param {google.cloud.asset.v1p2beta1.Asset} message Asset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Asset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ancestors = []; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - if (options.bytes === String) - object.iamPolicyName = ""; - else { - object.iamPolicyName = []; - if (options.bytes !== Array) - object.iamPolicyName = $util.newBuffer(object.iamPolicyName); - } - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) - object.iamPolicyName = options.bytes === String ? $util.base64.encode(message.iamPolicyName, 0, message.iamPolicyName.length) : options.bytes === Array ? Array.prototype.slice.call(message.iamPolicyName) : message.iamPolicyName; - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; + var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); + } + return message; + }; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeedOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; } return object; }; /** - * Converts this Asset to JSON. + * Converts this FeedOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + FeedOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return FeedOutputConfig; })(); - v1p2beta1.Resource = (function() { + v1p2beta1.Feed = (function() { /** - * Properties of a Resource. + * Properties of a Feed. * @memberof google.cloud.asset.v1p2beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - * @property {google.protobuf.IAny|null} [internalData] Resource internalData + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig */ /** - * Constructs a new Resource. + * Constructs a new Feed. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a Resource. - * @implements IResource + * @classdesc Represents a Feed. + * @implements IFeed * @constructor - * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set */ - function Resource(properties) { + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12659,153 +13905,133 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.discoveryName = ""; + Feed.prototype.name = ""; /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.resourceUrl = ""; + Feed.prototype.assetNames = $util.emptyArray; /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.parent = ""; + Feed.prototype.assetTypes = $util.emptyArray; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.data = null; + Feed.prototype.contentType = 0; /** - * Resource internalData. - * @member {google.protobuf.IAny|null|undefined} internalData - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.internalData = null; + Feed.prototype.feedOutputConfig = null; /** - * Creates a new Resource instance using the specified properties. + * Creates a new Feed instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance */ - Resource.create = function create(properties) { - return new Resource(properties); + Feed.create = function create(properties) { + return new Feed(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.internalData != null && message.hasOwnProperty("internalData")) - $root.google.protobuf.Any.encode(message.internalData, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + Feed.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + Feed.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.asset.v1p2beta1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Feed(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + message.name = reader.string(); break; case 2: - message.discoveryDocumentUri = reader.string(); + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); break; case 3: - message.discoveryName = reader.string(); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); break; case 4: - message.resourceUrl = reader.string(); + message.contentType = reader.int32(); break; case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 7: - message.internalData = $root.google.protobuf.Any.decode(reader, reader.uint32()); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12816,146 +14042,185 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + Feed.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a Feed message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + Feed.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; } - if (message.internalData != null && message.hasOwnProperty("internalData")) { - var error = $root.google.protobuf.Any.verify(message.internalData); + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); if (error) - return "internalData." + error; + return "feedOutputConfig." + error; } return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1p2beta1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); } - if (object.internalData != null) { - if (typeof object.internalData !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Resource.internalData: object expected"); - message.internalData = $root.google.protobuf.Any.fromObject(object.internalData); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); } return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a Feed message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.Resource} message Resource + * @param {google.cloud.asset.v1p2beta1.Feed} message Feed * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + Feed.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + } if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - object.internalData = null; + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - if (message.internalData != null && message.hasOwnProperty("internalData")) - object.internalData = $root.google.protobuf.Any.toObject(message.internalData, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this Feed to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + Feed.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return Feed; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p2beta1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1p2beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; })(); return v1p2beta1; @@ -12976,26 +14241,30 @@ */ var api = {}; - api.Http = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @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 Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13003,91 +14272,143 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * 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.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + 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); @@ -13098,353 +14419,285 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + ResourceDescriptor.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.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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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]); - } + 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.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + 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 Http message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.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); + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + 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 Http to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + ResourceDescriptor.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 + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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 */ - HttpRule.prototype.patch = ""; + 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; + })(); - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ - HttpRule.prototype.body = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set */ - HttpRule.prototype.responseBody = ""; + 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]]; + } /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = 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())); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -13455,240 +14708,118 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + ResourceReference.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; - } - } + 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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]); - } - } + 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 HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.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); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + api.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13696,88 +14827,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -13788,144 +14922,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + Http.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + 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.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @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 + * @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 ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13933,143 +15066,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = ""; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = ""; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = ""; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = ""; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = ""; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * 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.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + 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); @@ -14080,196 +15279,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.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"; + 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.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.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.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"; + } + 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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]); + 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.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.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]); + } } - 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. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pattern = []; + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - 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.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.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; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @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; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14277,88 +15520,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -14369,96 +15612,118 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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; })(); return api; @@ -19671,8 +20936,8 @@ * @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 + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** @@ -19749,20 +21014,20 @@ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** * Creates a new FieldOptions instance using the specified properties. @@ -19868,6 +21133,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -19878,9 +21146,6 @@ } 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; @@ -19955,6 +21220,11 @@ return "uninterpretedOption." + error; } } + 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; + } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -19971,11 +21241,6 @@ 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; }; @@ -20037,6 +21302,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + 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"]); + } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -20070,11 +21340,6 @@ 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; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 1773e244ac6..4568a83f1ea 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -8,15 +8,100 @@ "nested": { "v1": { "options": { + "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.Asset.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1;asset", "java_multiple_files": true, - "java_outer_classname": "AssetProto", + "java_outer_classname": "AssetServiceProto", "java_package": "com.google.cloud.asset.v1", - "php_namespace": "Google\\Cloud\\Asset\\V1", - "cc_enable_arenas": true + "php_namespace": "Google\\Cloud\\Asset\\V1" }, "nested": { + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + }, "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -385,7 +470,20 @@ } } } - }, + } + } + }, + "v1beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1beta1" + }, + "nested": { "TemporalAsset": { "fields": { "window": { @@ -435,11 +533,6 @@ "iamPolicy": { "type": "google.iam.v1.Policy", "id": 4 - }, - "ancestors": { - "rule": "repeated", - "type": "string", - "id": 10 } } }, @@ -470,20 +563,12 @@ "id": 6 } } - } - } - }, - "v1beta1": { - "options": { - "csharp_namespace": "Google.Cloud.Asset.V1Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetProto", - "java_package": "com.google.cloud.asset.v1beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1beta1" - }, - "nested": { + }, "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, "methods": { "ExportAssets": { "requestType": "ExportAssetsRequest", @@ -492,7 +577,9 @@ "(google.api.http).post": "/v1beta1/{parent=projects/*}:exportAssets", "(google.api.http).body": "*", "(google.api.http).additional_bindings.post": "/v1beta1/{parent=organizations/*}:exportAssets", - "(google.api.http).additional_bindings.body": "*" + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1beta1.ExportAssetsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1beta1.ExportAssetsRequest" } }, "BatchGetAssetsHistory": { @@ -509,7 +596,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } }, "readTime": { "type": "google.protobuf.Timestamp", @@ -526,7 +617,10 @@ }, "outputConfig": { "type": "OutputConfig", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -546,7 +640,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } }, "assetNames": { "rule": "repeated", @@ -555,11 +653,17 @@ }, "contentType": { "type": "ContentType", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "readTimeWindow": { "type": "TimeWindow", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -591,7 +695,8 @@ "oneofs": { "objectUri": { "oneof": [ - "uri" + "uri", + "uriPrefix" ] } }, @@ -599,6 +704,10 @@ "uri": { "type": "string", "id": 1 + }, + "uriPrefix": { + "type": "string", + "id": 2 } } }, @@ -608,36 +717,21 @@ "RESOURCE": 1, "IAM_POLICY": 2 } - }, - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { + } + } + }, + "v1p1beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1p1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1" + }, + "nested": { + "StandardResourceMetadata": { "fields": { "name": { "type": "string", @@ -647,181 +741,418 @@ "type": "string", "id": 2 }, - "resource": { - "type": "Resource", + "project": { + "type": "string", "id": 3 }, - "iamPolicy": { - "type": "google.iam.v1.Policy", + "displayName": { + "type": "string", "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "additionalAttributes": { + "rule": "repeated", + "type": "string", + "id": 10 } } }, - "Resource": { + "IamPolicySearchResult": { "fields": { - "version": { + "resource": { "type": "string", "id": 1 }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { + "project": { "type": "string", "id": 3 }, - "resourceUrl": { - "type": "string", + "policy": { + "type": "google.iam.v1.Policy", "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 } } - } - } - }, - "v1p2beta1": { - "options": { - "csharp_namespace": "Google.Cloud.Asset.v1p2beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetProto", - "java_package": "com.google.cloud.asset.v1p2beta1", - "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", - "cc_enable_arenas": true - }, - "nested": { + }, "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "ExportAssets": { - "requestType": "ExportAssetsRequest", - "responseType": "google.longrunning.Operation", + "SearchResources": { + "requestType": "SearchResourcesRequest", + "responseType": "SearchResourcesResponse", "options": { - "(google.api.http).post": "/v1p2beta1/{parent=*/*}:exportAssets", - "(google.api.http).body": "*" + "(google.api.http).get": "/v1p1beta1/resources:search", + "(google.api.method_signature)": "scope,query,asset_types" } }, - "BatchGetAssetsHistory": { - "requestType": "BatchGetAssetsHistoryRequest", - "responseType": "BatchGetAssetsHistoryResponse", + "SearchIamPolicies": { + "requestType": "SearchIamPoliciesRequest", + "responseType": "SearchIamPoliciesResponse", "options": { - "(google.api.http).get": "/v1p2beta1/{parent=*/*}:batchGetAssetsHistory" + "(google.api.http).get": "/v1p1beta1/iamPolicies:search", + "(google.api.method_signature)": "scope,query" } }, - "CreateFeed": { - "requestType": "CreateFeedRequest", - "responseType": "Feed", + "SearchAllResources": { + "requestType": "SearchAllResourcesRequest", + "responseType": "SearchAllResourcesResponse", "options": { - "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", - "(google.api.http).body": "*" + "(google.api.http).get": "/v1p1beta1/{scope=*/*}/resources:searchAll", + "(google.api.method_signature)": "scope,query,asset_types" } }, - "GetFeed": { - "requestType": "GetFeedRequest", - "responseType": "Feed", + "SearchAllIamPolicies": { + "requestType": "SearchAllIamPoliciesRequest", + "responseType": "SearchAllIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll", + "(google.api.method_signature)": "scope,query" + } + } + } + }, + "SearchResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, "options": { - "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}" + "(google.api.field_behavior)": "REQUIRED" } }, - "ListFeeds": { - "requestType": "ListFeedsRequest", - "responseType": "ListFeedsResponse", + "query": { + "type": "string", + "id": 2, "options": { - "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds" + "(google.api.field_behavior)": "OPTIONAL" } }, - "UpdateFeed": { - "requestType": "UpdateFeedRequest", - "responseType": "Feed", + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3, "options": { - "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", - "(google.api.http).body": "*" + "(google.api.field_behavior)": "OPTIONAL" } }, - "DeleteFeed": { - "requestType": "DeleteFeedRequest", - "responseType": "google.protobuf.Empty", + "pageSize": { + "type": "int32", + "id": 4, "options": { - "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ExportAssetsRequest": { + "SearchResourcesResponse": { "fields": { - "parent": { + "results": { + "rule": "repeated", + "type": "StandardResourceMetadata", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", "id": 1 }, - "readTime": { - "type": "google.protobuf.Timestamp", + "nextPageToken": { + "type": "string", "id": 2 + } + } + }, + "SearchAllResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "assetTypes": { "rule": "repeated", "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "contentType": { - "type": "ContentType", - "id": 4 + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "outputConfig": { - "type": "OutputConfig", - "id": 5 + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "ExportAssetsResponse": { + "SearchAllResourcesResponse": { "fields": { - "readTime": { + "results": { + "rule": "repeated", + "type": "StandardResourceMetadata", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchAllIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "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" + } + } + } + }, + "SearchAllIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + } + } + }, + "v1p2beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1p2Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p2Beta1" + }, + "nested": { + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { "type": "google.protobuf.Timestamp", "id": 1 }, - "outputConfig": { - "type": "OutputConfig", + "endTime": { + "type": "google.protobuf.Timestamp", "id": 2 } } }, - "BatchGetAssetsHistoryRequest": { + "Asset": { "fields": { - "parent": { + "name": { "type": "string", "id": 1 }, - "assetNames": { - "rule": "repeated", + "assetType": { "type": "string", "id": 2 }, - "contentType": { - "type": "ContentType", + "resource": { + "type": "Resource", "id": 3 }, - "readTimeWindow": { - "type": "TimeWindow", + "iamPolicy": { + "type": "google.iam.v1.Policy", "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 } } }, - "BatchGetAssetsHistoryResponse": { + "Resource": { "fields": { - "assets": { - "rule": "repeated", - "type": "TemporalAsset", + "version": { + "type": "string", "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + }, + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateFeed": { + "requestType": "CreateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + } + }, + "GetFeed": { + "requestType": "GetFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + } + }, + "ListFeeds": { + "requestType": "ListFeedsRequest", + "responseType": "ListFeedsResponse", + "options": { + "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.method_signature)": "parent" + } + }, + "UpdateFeed": { + "requestType": "UpdateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "feed" + } + }, + "DeleteFeed": { + "requestType": "DeleteFeedRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + } } } }, @@ -829,15 +1160,24 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "feedId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "feed": { "type": "Feed", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -845,7 +1185,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } } } }, @@ -853,7 +1197,10 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -870,11 +1217,17 @@ "fields": { "feed": { "type": "Feed", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -882,7 +1235,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } } } }, @@ -890,8 +1247,7 @@ "oneofs": { "destination": { "oneof": [ - "gcsDestination", - "bigqueryDestination" + "gcsDestination" ] } }, @@ -899,10 +1255,6 @@ "gcsDestination": { "type": "GcsDestination", "id": 1 - }, - "bigqueryDestination": { - "type": "BigQueryDestination", - "id": 2 } } }, @@ -910,35 +1262,14 @@ "oneofs": { "objectUri": { "oneof": [ - "uri", - "uriPrefix" + "uri" ] - } - }, - "fields": { - "uri": { - "type": "string", - "id": 1 - }, - "uriPrefix": { - "type": "string", - "id": 2 - } - } - }, - "BigQueryDestination": { + } + }, "fields": { - "dataset": { + "uri": { "type": "string", "id": 1 - }, - "table": { - "type": "string", - "id": 2 - }, - "force": { - "type": "bool", - "id": 3 } } }, @@ -950,16 +1281,6 @@ } } }, - "ContentType": { - "values": { - "CONTENT_TYPE_UNSPECIFIED": 0, - "RESOURCE": 1, - "IAM_POLICY": 2, - "IAM_POLICY_NAME": 3, - "ORG_POLICY": 4, - "ACCESS_POLICY": 5 - } - }, "FeedOutputConfig": { "oneofs": { "destination": { @@ -976,10 +1297,18 @@ } }, "Feed": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Feed", + "(google.api.resource).pattern": "organizations/{organization}/feeds/{feed}", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "assetNames": { "rule": "repeated", @@ -997,97 +1326,18 @@ }, "feedOutputConfig": { "type": "FeedOutputConfig", - "id": 5 - } - } - }, - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "assetType": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - }, - "iamPolicy": { - "type": "google.iam.v1.Policy", - "id": 4 - }, - "iamPolicyName": { - "type": "bytes", - "id": 5 - }, - "ancestors": { - "rule": "repeated", - "type": "string", - "id": 6 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "Resource": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { - "type": "string", - "id": 3 - }, - "resourceUrl": { - "type": "string", - "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 - }, - "internalData": { - "type": "google.protobuf.Any", - "id": 7 - } + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2 } } } @@ -1098,14 +1348,80 @@ }, "api": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ResourceProto", + "java_outer_classname": "FieldBehaviorProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { + "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 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -1224,72 +1540,6 @@ "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 - } - } } } }, diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 20103990aa3..11bc75706db 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -28,7 +28,7 @@ async function main(assetNames) { async function quickstart() { const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); + const projectResource = `projects/${projectId}`; // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js deleted file mode 100644 index d9d674733a4..00000000000 --- a/packages/google-cloud-asset/src/index.js +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2018 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. - -/** - * @namespace google - */ -/** - * @namespace google.cloud - */ -/** - * @namespace google.cloud.asset - */ -/** - * @namespace google.cloud.asset.v1beta1 - */ -/** - * @namespace google.cloud.asset.v1 - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.type - */ -/** - * @namespace google.iam.v1 - */ -/** - * @namespace google.longrunning - */ -/** - * @namespace google.cloud.asset.v1p2beta1 - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v1beta1: require('./v1beta1'), - v1: require('./v1'), - v1p2beta1: require('./v1p2beta1'), -}); - -/** - * The `asset` package has the following named exports: - * - * - `AssetServiceClient` - Reference to - * {@link v1beta1.AssetServiceClient} - * - `v1beta1` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `AssetServiceClient` - Reference to - * {@link v1beta1.AssetServiceClient} - * - * @module {object} asset - * @alias nodejs-asset - * - * @example Install the client library with npm: - * npm install --save @google-cloud/asset - * - * @example Import the client library: - * const asset = require('@google-cloud/asset'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new asset.AssetServiceClient(); - * - * @example Create a client with explicit credentials: - * const client = new asset.AssetServiceClient({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1beta1.AssetServiceClient} - */ -module.exports = gapic.v1; - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1beta1.AssetServiceClient} - */ -module.exports.v1p2beta1 = gapic.v1p2beta1; - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1beta1.AssetServiceClient} - */ -module.exports.v1beta1 = gapic.v1beta1; - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1.AssetServiceClient} - */ -module.exports.v1 = gapic.v1; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts new file mode 100644 index 00000000000..41201327fc4 --- /dev/null +++ b/packages/google-cloud-asset/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2019 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 v1 from './v1'; +import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; +import * as v1p2beta1 from './v1p2beta1'; +const AssetServiceClient = v1.AssetServiceClient; +export {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js deleted file mode 100644 index 4f7841a51ac..00000000000 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ /dev/null @@ -1,868 +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 -// -// 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. - -'use strict'; - -const gapicConfig = require('./asset_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Asset service definition. - * - * @class - * @memberof v1 - */ -class AssetServiceClient { - /** - * Construct an instance of AssetServiceClient. - * - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - 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' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? 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 = { - feedPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/feeds/{feed}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // 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 = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const exportAssetsResponse = protoFilesRoot.lookup( - 'google.cloud.asset.v1.ExportAssetsResponse' - ); - const exportAssetsMetadata = protoFilesRoot.lookup( - 'google.cloud.asset.v1.ExportAssetsRequest' - ); - - this._descriptors.longrunning = { - exportAssets: new gaxModule.LongrunningDescriptor( - this.operationsClient, - exportAssetsResponse.decode.bind(exportAssetsResponse), - exportAssetsMetadata.decode.bind(exportAssetsMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.asset.v1.AssetService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.asset.v1.AssetService. - const assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.cloud.asset.v1.AssetService') - : protos.google.cloud.asset.v1.AssetService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const assetServiceStubMethods = [ - 'exportAssets', - 'batchGetAssetsHistory', - 'createFeed', - 'getFeed', - 'listFeeds', - 'updateFeed', - 'deleteFeed', - ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = assetServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'cloudasset.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'cloudasset.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']; - } - - /** - * 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) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the google.longrunning.Operation API allowing you - * to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"), - * or a folder number (such as "folders/123"). - * @param {Object} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} - * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) - * for all supported asset types. - * @param {number} [request.contentType] - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * @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/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.exportAssets(request); - * - * const [response] = await operation.promise(); - */ - exportAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.exportAssets(request, options, callback); - } - - /** - * Batch gets the update history of assets that overlap a time window. - * For RESOURCE content, this API outputs history with asset in both - * non-delete or deleted status. - * For IAM_POLICY content, this API outputs history when the asset and its - * attached IAM POLICY both exist. This can create gaps in the output history. - * If a specified asset does not exist, this API returns an INVALID_ARGUMENT - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {number} request.contentType - * Optional. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * @param {Object} request.readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} - * @param {string[]} [request.assetNames] - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * @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/interfaces/CallOptions.html} 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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * const readTimeWindow = {}; - * const request = { - * parent: parent, - * contentType: contentType, - * readTimeWindow: readTimeWindow, - * }; - * client.batchGetAssetsHistory(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - batchGetAssetsHistory(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.batchGetAssetsHistory( - request, - options, - callback - ); - } - - /** - * Creates a feed in a parent project/folder/organization to listen to its - * asset updates. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * @param {string} request.feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * @param {Object} request.feed - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const feedId = ''; - * const feed = {}; - * const request = { - * parent: parent, - * feedId: feedId, - * feed: feed, - * }; - * client.createFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.createFeed(request, options, callback); - } - - /** - * Gets details about an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.getFeed({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.getFeed(request, options, callback); - } - - /** - * Lists all asset feeds in a parent project/folder/organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * @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/interfaces/CallOptions.html} 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 [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * client.listFeeds({parent: parent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - listFeeds(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.listFeeds(request, options, callback); - } - - /** - * Updates an asset feed configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * @param {Object} request.updateMask - * Required. Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const feed = {}; - * const updateMask = {}; - * const request = { - * feed: feed, - * updateMask: updateMask, - * }; - * client.updateFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feed.name': request.feed.name, - }); - - return this._innerApiCalls.updateFeed(request, options, callback); - } - - /** - * Deletes an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.deleteFeed({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.deleteFeed(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified feed resource name string. - * - * @param {String} project - * @param {String} feed - * @returns {String} - */ - feedPath(project, feed) { - return this._pathTemplates.feedPathTemplate.render({ - project: project, - feed: feed, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).project; - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the feed. - */ - matchFeedFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).feed; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts new file mode 100644 index 00000000000..611eaf99c74 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -0,0 +1,1053 @@ +// Copyright 2019 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + assetServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @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 AssetServiceClient; + 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; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? 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 = { + assetPathTemplate: new gaxModule.PathTemplate('*'), + projectFeedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), + folderFeedPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/feeds/{feed}' + ), + organizationFeedPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/feeds/{feed}' + ), + }; + + // 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 + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const exportAssetsResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportAssetsResponse' + ) as gax.protobuf.Type; + const exportAssetsMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportAssetsRequest' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + exportAssets: new gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1.AssetService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1.AssetService. + this.assetServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1.AssetService, + 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 assetServiceStubMethods = [ + 'exportAssets', + 'batchGetAssetsHistory', + 'createFeed', + 'getFeed', + 'listFeeds', + 'updateFeed', + 'deleteFeed', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.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 -- + // ------------------- + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + >; + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): void; + /** + * Batch gets the update history of assets that overlap a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * @param {string[]} request.assetNames + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * and [Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more info. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * @param {google.cloud.asset.v1.ContentType} [request.contentType] + * Optional. The content type. + * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | 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 || '', + }); + return this._innerApiCalls.batchGetAssetsHistory( + request, + options, + callback + ); + } + createFeed( + request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + ] + >; + createFeed( + request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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 [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createFeed( + request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | 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 || '', + }); + return this._innerApiCalls.createFeed(request, options, callback); + } + getFeed( + request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + ] + >; + getFeed( + request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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 [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getFeed( + request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | 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 || '', + }); + return this._innerApiCalls.getFeed(request, options, callback); + } + listFeeds( + request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + ] + >; + listFeeds( + request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + > + ): void; + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @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 [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listFeeds( + request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | 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 || '', + }); + return this._innerApiCalls.listFeeds(request, options, callback); + } + updateFeed( + request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + ] + >; + updateFeed( + request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @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 [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFeed( + request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | 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({ + 'feed.name': request.feed!.name || '', + }); + return this._innerApiCalls.updateFeed(request, options, callback); + } + deleteFeed( + request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + ] + >; + deleteFeed( + request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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. + */ + deleteFeed( + request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | 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 || '', + }); + return this._innerApiCalls.deleteFeed(request, options, callback); + } + + exportAssets( + request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportAssets( + request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Exports assets with time and resource types to a given Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you + * to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * @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. + */ + exportAssets( + request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.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 || '', + }); + return this._innerApiCalls.exportAssets(request, options, callback); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified asset resource name string. + * + * @returns {string} Resource name string. + */ + assetPath() { + return this._pathTemplates.assetPathTemplate.render({}); + } + + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project: string, feed: string) { + return this._pathTemplates.projectFeedPathTemplate.render({ + project, + feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .feed; + } + + /** + * Return a fully-qualified folderFeed resource name string. + * + * @param {string} folder + * @param {string} feed + * @returns {string} Resource name string. + */ + folderFeedPath(folder: string, feed: string) { + return this._pathTemplates.folderFeedPathTemplate.render({ + folder, + feed, + }); + } + + /** + * Parse the folder from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .folder; + } + + /** + * Parse the feed from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .feed; + } + + /** + * Return a fully-qualified organizationFeed resource name string. + * + * @param {string} organization + * @param {string} feed + * @returns {string} Resource name string. + */ + organizationFeedPath(organization: string, feed: string) { + return this._pathTemplates.organizationFeedPathTemplate.render({ + organization, + feed, + }); + } + + /** + * Parse the organization from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).organization; + } + + /** + * Parse the feed from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).feed; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index dc56b109a4c..a58073cc047 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -2,57 +2,52 @@ "interfaces": { "google.cloud.asset.v1.AssetService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ExportAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateFeed": { - "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListFeeds": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateFeed": { - "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 53ef75b9756..3f8fd209c29 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/asset/v1/assets.proto", "../../protos/google/cloud/asset/v1/asset_service.proto" ] diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js deleted file mode 100644 index 4fdebc66c6b..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js +++ /dev/null @@ -1,465 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Export asset request. - * - * @property {string} parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"), - * or a folder number (such as "folders/123"). - * - * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * - * @property {Object} outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} - * - * @typedef ExportAssetsRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ExportAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation method in the returned - * google.longrunning.Operation.response field. - * - * @property {Object} readTime - * Time the snapshot was taken. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} outputConfig - * Output configuration indicating where the results were output to. - * All results are in JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} - * - * @typedef ExportAssetsResponse - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ExportAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history request. - * - * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * - * @property {string[]} assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * - * @property {number} contentType - * Optional. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * - * @property {Object} readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} - * - * @typedef BatchGetAssetsHistoryRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const BatchGetAssetsHistoryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history response. - * - * @property {Object[]} assets - * A list of assets with valid time windows. - * - * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1.TemporalAsset} - * - * @typedef BatchGetAssetsHistoryResponse - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const BatchGetAssetsHistoryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Create asset feed request. - * - * @property {string} parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * - * @property {string} feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * - * @property {Object} feed - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * - * @typedef CreateFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.CreateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const CreateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Get asset feed request. - * - * @property {string} name - * Required. The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef GetFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.GetFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const GetFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * List asset feeds request. - * - * @property {string} parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * - * @typedef ListFeedsRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ListFeedsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ListFeedsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * @property {Object[]} feeds - * A list of feeds. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * - * @typedef ListFeedsResponse - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ListFeedsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ListFeedsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Update asset feed request. - * - * @property {Object} feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * - * @property {Object} updateMask - * Required. Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.UpdateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const UpdateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * @property {string} name - * Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef DeleteFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.DeleteFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const DeleteFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for export assets destination. - * - * @property {Object} gcsDestination - * Destination on Cloud Storage. - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1.GcsDestination} - * - * @property {Object} bigqueryDestination - * Destination on BigQuery. The output table stores the fields in asset - * proto as columns in BigQuery. The resource/iam_policy field is converted - * to a record with each field to a column, except metadata to a single JSON - * string. - * - * This object should have the same structure as [BigQueryDestination]{@link google.cloud.asset.v1.BigQueryDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Storage location. - * - * @property {string} uri - * The uri of the Cloud Storage object. It's the same uri that is used by - * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - * Editing Object - * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - * for more information. - * - * @property {string} uriPrefix - * The uri prefix of all generated Cloud Storage objects. For example: - * "gs://bucket_name/object_name_prefix". Each object uri is in format: - * "gs://bucket_name/object_name_prefix// and only - * contains assets for that type. starts from 0. For example: - * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - * the first shard of output objects containing all - * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - * returned if file with the same name "gs://bucket_name/object_name_prefix" - * already exists. - * - * @typedef GcsDestination - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A BigQuery destination. - * - * @property {string} dataset - * Required. The BigQuery dataset in format - * "projects/projectId/datasets/datasetId", to which the snapshot result - * should be exported. If this dataset does not exist, the export call returns - * an error. - * - * @property {string} table - * Required. The BigQuery table to which the snapshot result should be - * written. If this table does not exist, a new table with the given name - * will be created. - * - * @property {boolean} force - * If the destination table already exists and this flag is `TRUE`, the - * table will be overwritten by the contents of assets snapshot. If the flag - * is not set and the destination table already exists, the export call - * returns an error. - * - * @typedef BigQueryDestination - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.BigQueryDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const BigQueryDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Pubsub destination. - * - * @property {string} topic - * The name of the Cloud Pub/Sub topic to publish to. - * For example: `projects/PROJECT_ID/topics/TOPIC_ID`. - * - * @typedef PubsubDestination - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.PubsubDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const PubsubDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for asset feed destination. - * - * @property {Object} pubsubDestination - * Destination on Cloud Pubsub. - * - * This object should have the same structure as [PubsubDestination]{@link google.cloud.asset.v1.PubsubDestination} - * - * @typedef FeedOutputConfig - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.FeedOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const FeedOutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An asset feed used to export asset updates to a destinations. - * An asset feed filter controls what updates are exported. - * The asset feed must be created within a project, organization, or - * folder. Supported destinations are: - * Cloud Pub/Sub topics. - * - * @property {string} name - * Required. The format will be - * projects/{project_number}/feeds/{client-assigned_feed_identifier} or - * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or - * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} - * - * The client-assigned feed identifier must be unique within the parent - * project/folder/organization. - * - * @property {string[]} assetNames - * A list of the full names of the assets to receive updates. You must specify - * either or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. For - * example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * @property {string[]} assetTypes - * A list of types of the assets to receive updates. You must specify either - * or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. - * For example: - * "compute.googleapis.com/Disk" See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name and - * type will be returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * - * @property {Object} feedOutputConfig - * Required. Feed output configuration defining where the asset updates are - * published to. - * - * This object should have the same structure as [FeedOutputConfig]{@link google.cloud.asset.v1.FeedOutputConfig} - * - * @typedef Feed - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.Feed definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const Feed = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Asset content type. - * - * @enum {number} - * @memberof google.cloud.asset.v1 - */ -const ContentType = { - - /** - * Unspecified content type. - */ - CONTENT_TYPE_UNSPECIFIED: 0, - - /** - * Resource metadata. - */ - RESOURCE: 1, - - /** - * The actual IAM policy set on a resource. - */ - IAM_POLICY: 2, - - /** - * The Cloud Organization Policy set on an asset. - */ - ORG_POLICY: 4, - - /** - * The Cloud Access context mananger Policy set on an asset. - */ - ACCESS_POLICY: 5 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js deleted file mode 100644 index 3bea7af7cbf..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js +++ /dev/null @@ -1,156 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Temporal asset. In addition to the asset, the temporal asset includes the - * status of the asset and valid from and to time of it. - * - * @property {Object} window - * The time window when the asset data and state was observed. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} - * - * @property {boolean} deleted - * If the asset is deleted or not. - * - * @property {Object} asset - * Asset. - * - * This object should have the same structure as [Asset]{@link google.cloud.asset.v1.Asset} - * - * @typedef TemporalAsset - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const TemporalAsset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A time window of (start_time, end_time]. - * - * @property {Object} startTime - * Start time of the time window (exclusive). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * End time of the time window (inclusive). - * Current timestamp if not specified. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeWindow - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const TimeWindow = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud asset. This includes all Google Cloud Platform resources, - * Cloud IAM policies, and other non-GCP assets. - * - * @property {string} name - * The full name of the asset. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * @property {string} assetType - * Type of the asset. Example: "compute.googleapis.com/Disk". - * - * @property {Object} resource - * Representation of the resource. - * - * This object should have the same structure as [Resource]{@link google.cloud.asset.v1.Resource} - * - * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy set on it. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @property {string[]} ancestors - * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, - * represented as a list of relative resource names. Ancestry path starts with - * the closest CRM ancestor and ends at root. If the asset is a CRM - * project/folder/organization, this starts from the asset itself. - * - * Example: ["projects/123456789", "folders/5432", "organizations/1234"] - * - * @typedef Asset - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Representation of a cloud resource. - * - * @property {string} version - * The API version. Example: "v1". - * - * @property {string} discoveryDocumentUri - * The URL of the discovery document containing the resource's JSON schema. - * For example: - * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). - * It will be left unspecified for resources without a discovery-based API, - * such as Cloud Bigtable. - * - * @property {string} discoveryName - * The JSON schema name listed in the discovery document. - * Example: "Project". It will be left unspecified for resources (such as - * Cloud Bigtable) without a discovery-based API. - * - * @property {string} resourceUrl - * The REST URL for accessing the resource. An HTTP GET operation using this - * URL returns the resource itself. - * Example: - * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - * It will be left unspecified for resources without a REST API. - * - * @property {string} parent - * The full name of the immediate parent of this resource. See - * [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * For GCP assets, it is the parent resource defined in the [Cloud IAM policy - * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: - * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - * - * For third-party assets, it is up to the users to define. - * - * @property {Object} data - * The content of the resource, in which some sensitive fields are scrubbed - * away and may not be present. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @typedef Resource - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const Resource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d6609..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/browser.js b/packages/google-cloud-asset/src/v1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/browser.js rename to packages/google-cloud-asset/src/v1/index.ts index 68dc62d25d6..6890c43379a 100644 --- a/packages/google-cloud-asset/src/browser.js +++ b/packages/google-cloud-asset/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,11 +11,9 @@ // 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'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts similarity index 53% rename from packages/google-cloud-asset/src/v1beta1/asset_service_client.js rename to packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 5f534962327..b123bc3bac6 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,22 +11,41 @@ // 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'; - -const gapicConfig = require('./asset_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; +// +// ** 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; /** - * Asset service definition. - * + * Asset service definition. * @class * @memberof v1beta1 */ -class AssetServiceClient { +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + assetServiceStub: Promise<{[name: string]: Function}>; + /** * Construct an instance of AssetServiceClient. * @@ -54,58 +73,55 @@ class AssetServiceClient { * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AssetServiceClient; + 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; + opts.clientConfig = opts.clientConfig || {}; + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = this.constructor.scopes; + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; + this.auth = gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = []; - + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); } - clientHeader.push(`gapic/${VERSION}`); 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. @@ -125,27 +141,28 @@ class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + assetPathTemplate: new gaxModule.PathTemplate('*'), }; - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - // 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 = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const exportAssetsResponse = protoFilesRoot.lookup( - 'google.cloud.asset.v1beta1.ExportAssetsResponse' - ); + '.google.cloud.asset.v1beta1.ExportAssetsResponse' + ) as gax.protobuf.Type; const exportAssetsMetadata = protoFilesRoot.lookup( - 'google.cloud.asset.v1beta1.ExportAssetsRequest' - ); + '.google.cloud.asset.v1beta1.ExportAssetsRequest' + ) as gax.protobuf.Type; this._descriptors.longrunning = { exportAssets: new gaxModule.LongrunningDescriptor( @@ -158,8 +175,8 @@ class AssetServiceClient { // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( 'google.cloud.asset.v1beta1.AssetService', - gapicConfig, - opts.clientConfig, + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')} ); @@ -170,30 +187,48 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1beta1.AssetService. - const assetServiceStub = gaxGrpc.createStub( + this.assetServiceStub = gaxGrpc.createStub( opts.fallback - ? protos.lookupService('google.cloud.asset.v1beta1.AssetService') - : protos.google.cloud.asset.v1beta1.AssetService, + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1beta1.AssetService, 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 assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; + for (const methodName of assetServiceStubMethods) { - const innerCallPromise = assetServiceStub.then( - stub => (...args) => { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, - err => () => { + (err: Error | null | undefined) => () => { throw err; } ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( + + const apiCall = gaxModule.createApiCall( innerCallPromise, defaults[methodName], - this._descriptors.longrunning[methodName] + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; } } @@ -227,169 +262,57 @@ class AssetServiceClient { 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) { - return this.auth.getProjectId(callback); + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); } // ------------------- // -- Service calls -- // ------------------- - - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the - * google.longrunning.Operation API allowing - * you to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), a project number (such as "projects/12345"), or - * a folder number (such as "folders/123"). - * @param {Object} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} - * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. For example: - * "google.compute.Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * @param {number} [request.contentType] - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * @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/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1beta1'); - * - * const client = new asset.v1beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.exportAssets(request); - * - * const [response] = await operation.promise(); - */ - exportAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.exportAssets(request, options, callback); - } - + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + >; + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): void; /** * Batch gets the update history of assets that overlap a time window. * For RESOURCE content, this API outputs history with asset in both * non-delete or deleted status. * For IAM_POLICY content, this API outputs history when the asset and its * attached IAM POLICY both exist. This can create gaps in the output history. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. * * @param {Object} request * The request object that will be sent. @@ -397,20 +320,7 @@ class AssetServiceClient { * Required. The relative name of the root asset. It can only be an * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {number} request.contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * @param {Object} request.readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} - * @param {string[]} [request.assetNames] + * @param {string[]} request.assetNames * A list of the full names of the assets. For example: * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. * See [Resource @@ -419,57 +329,63 @@ class AssetServiceClient { * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. - * @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/interfaces/CallOptions.html} 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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. + * @param {google.cloud.asset.v1beta1.ContentType} [request.contentType] + * Optional. The content type. + * @param {google.cloud.asset.v1beta1.TimeWindow} [request.readTimeWindow] + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1beta1'); - * - * const client = new asset.v1beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * const readTimeWindow = {}; - * const request = { - * parent: formattedParent, - * contentType: contentType, - * readTimeWindow: readTimeWindow, - * }; - * client.batchGetAssetsHistory(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - batchGetAssetsHistory(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - 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, + parent: request.parent || '', }); - return this._innerApiCalls.batchGetAssetsHistory( request, options, @@ -477,32 +393,142 @@ class AssetServiceClient { ); } + exportAssets( + request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportAssets( + request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Exports assets with time and resource types to a given Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API allowing + * you to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), a project number (such as "projects/12345"), or + * a folder number (such as "folders/123"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "google.compute.Disk". If specified, only matching assets will be returned. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @param {google.cloud.asset.v1beta1.OutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * @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. + */ + exportAssets( + request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.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 || '', + }); + return this._innerApiCalls.exportAssets(request, options, callback); + } // -------------------- // -- Path templates -- // -------------------- /** - * Return a fully-qualified project resource name string. + * Return a fully-qualified asset resource name string. * - * @param {String} project - * @returns {String} + * @returns {string} Resource name string. */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); + assetPath() { + return this._pathTemplates.assetPathTemplate.render({}); } /** - * Parse the projectName from a project resource. + * Terminate the GRPC channel and close the client. * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. + * The client will no longer be usable and all future behavior is undefined. */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); } } - -module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json index 412e8028be3..dc9c90c255f 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json @@ -2,31 +2,31 @@ "interfaces": { "google.cloud.asset.v1beta1.AssetService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ExportAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json index 499bd902e39..e843e78ee54 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/asset/v1beta1/assets.proto", "../../protos/google/cloud/asset/v1beta1/asset_service.proto" ] diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js deleted file mode 100644 index cf237147bba..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ /dev/null @@ -1,202 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Export asset request. - * - * @property {string} parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), a project number (such as "projects/12345"), or - * a folder number (such as "folders/123"). - * - * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "google.compute.Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * - * @property {Object} outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} - * - * @typedef ExportAssetsRequest - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const ExportAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation - * method in the returned - * google.longrunning.Operation.response - * field. - * - * @property {Object} readTime - * Time the snapshot was taken. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} outputConfig - * Output configuration indicating where the results were output to. - * All results are in JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} - * - * @typedef ExportAssetsResponse - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const ExportAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history request. - * - * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * - * @property {string[]} assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * - * @property {number} contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * - * @property {Object} readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} - * - * @typedef BatchGetAssetsHistoryRequest - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history response. - * - * @property {Object[]} assets - * A list of assets with valid time windows. - * - * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1beta1.TemporalAsset} - * - * @typedef BatchGetAssetsHistoryResponse - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for export assets destination. - * - * @property {Object} gcsDestination - * Destination on Cloud Storage. - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1beta1.GcsDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Storage location. - * - * @property {string} uri - * The uri of the Cloud Storage object. It's the same uri that is used by - * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - * Editing Object - * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - * for more information. - * - * @typedef GcsDestination - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Asset content type. - * - * @enum {number} - * @memberof google.cloud.asset.v1beta1 - */ -const ContentType = { - - /** - * Unspecified content type. - */ - CONTENT_TYPE_UNSPECIFIED: 0, - - /** - * Resource metadata. - */ - RESOURCE: 1, - - /** - * The actual IAM policy set on a resource. - */ - IAM_POLICY: 2 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js deleted file mode 100644 index b7ea3599947..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ /dev/null @@ -1,148 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Temporal asset. In addition to the asset, the temporal asset includes the - * status of the asset and valid from and to time of it. - * - * @property {Object} window - * The time window when the asset data and state was observed. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} - * - * @property {boolean} deleted - * If the asset is deleted or not. - * - * @property {Object} asset - * Asset. - * - * This object should have the same structure as [Asset]{@link google.cloud.asset.v1beta1.Asset} - * - * @typedef TemporalAsset - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const TemporalAsset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A time window of (start_time, end_time]. - * - * @property {Object} startTime - * Start time of the time window (exclusive). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * End time of the time window (inclusive). - * Current timestamp if not specified. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeWindow - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const TimeWindow = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud asset. This includes all Google Cloud Platform resources, - * Cloud IAM policies, and other non-GCP assets. - * - * @property {string} name - * The full name of the asset. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * @property {string} assetType - * Type of the asset. Example: "google.compute.Disk". - * - * @property {Object} resource - * Representation of the resource. - * - * This object should have the same structure as [Resource]{@link google.cloud.asset.v1beta1.Resource} - * - * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy set on it. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @typedef Asset - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Representation of a cloud resource. - * - * @property {string} version - * The API version. Example: "v1". - * - * @property {string} discoveryDocumentUri - * The URL of the discovery document containing the resource's JSON schema. - * For example: - * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). - * It will be left unspecified for resources without a discovery-based API, - * such as Cloud Bigtable. - * - * @property {string} discoveryName - * The JSON schema name listed in the discovery document. - * Example: "Project". It will be left unspecified for resources (such as - * Cloud Bigtable) without a discovery-based API. - * - * @property {string} resourceUrl - * The REST URL for accessing the resource. An HTTP GET operation using this - * URL returns the resource itself. - * Example: - * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - * It will be left unspecified for resources without a REST API. - * - * @property {string} parent - * The full name of the immediate parent of this resource. See - * [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * For GCP assets, it is the parent resource defined in the [Cloud IAM policy - * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: - * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - * - * For third-party assets, it is up to the users to define. - * - * @property {Object} data - * The content of the resource, in which some sensitive fields are scrubbed - * away and may not be present. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @typedef Resource - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const Resource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/index.js b/packages/google-cloud-asset/src/v1beta1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/v1p2beta1/index.js rename to packages/google-cloud-asset/src/v1beta1/index.ts index 501c92ee4cf..6890c43379a 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.js +++ b/packages/google-cloud-asset/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // 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 AssetServiceClient = require('./asset_service_client'); - -module.exports.AssetServiceClient = AssetServiceClient; +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts new file mode 100644 index 00000000000..01acc772832 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -0,0 +1,909 @@ +// Copyright 2019 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p1beta1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _terminated = false; + auth: gax.GoogleAuth; + assetServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @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 AssetServiceClient; + 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; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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 = { + searchResources: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchIamPolicies: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchAllResources: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchAllIamPolicies: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1p1beta1.AssetService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1p1beta1.AssetService. + this.assetServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p1beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1p1beta1.AssetService, + 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 assetServiceStubMethods = [ + 'searchResources', + 'searchIamPolicies', + 'searchAllResources', + 'searchAllIamPolicies', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.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 -- + // ------------------- + + searchResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + ] + >; + searchResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + > + ): void; + /** + * Searches resources which are accessible with .get permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. + * 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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} 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 [SearchResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchResourcesRequest} + * 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 + * [SearchResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchResourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + return this._innerApiCalls.searchResources(request, options, callback); + } + + /** + * Equivalent to {@link searchResources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchResources} 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.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. + */ + searchResourcesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchResources.createStream( + this._innerApiCalls.searchResources as gax.GaxCall, + request, + callSettings + ); + } + searchIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + ] + >; + searchIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + > + ): void; + /** + * Searches IAM policies which are accessible with .getIamPolicy permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. + * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} 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 [SearchIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} + * 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 + * [SearchIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + return this._innerApiCalls.searchIamPolicies(request, options, callback); + } + + /** + * Equivalent to {@link searchIamPolicies}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchIamPolicies} 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.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. + */ + searchIamPoliciesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchIamPolicies.createStream( + this._innerApiCalls.searchIamPolicies as gax.GaxCall, + request, + callSettings + ); + } + searchAllResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ] + >; + searchAllResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + > + ): void; + /** + * Searches all the resources under a given accessible CRM scope + * (project/folder/organization). This RPC gives callers + * especially admins the ability to search all the resources under a scope, + * even if they don't have .get permission of all the resources. Callers + * should have cloud.assets.SearchAllResources permission on the requested + * scope, otherwise it will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. + * 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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} 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 [SearchAllResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} + * 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 + * [SearchAllResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAllResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ] + > | 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({ + scope: request.scope || '', + }); + return this._innerApiCalls.searchAllResources(request, options, callback); + } + + /** + * Equivalent to {@link searchAllResources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAllResources} 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.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. + */ + searchAllResourcesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchAllResources.createStream( + this._innerApiCalls.searchAllResources as gax.GaxCall, + request, + callSettings + ); + } + searchAllIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ] + >; + searchAllIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + > + ): void; + /** + * Searches all the IAM policies under a given accessible CRM scope + * (project/folder/organization). This RPC gives callers + * especially admins the ability to search all the IAM policies under a scope, + * even if they don't have .getIamPolicy permission of all the IAM policies. + * Callers should have cloud.assets.SearchAllIamPolicies permission on the + * requested scope, otherwise it will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. + * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} 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 [SearchAllIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} + * 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 + * [SearchAllIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAllIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ] + > | 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({ + scope: request.scope || '', + }); + return this._innerApiCalls.searchAllIamPolicies(request, options, callback); + } + + /** + * Equivalent to {@link searchAllIamPolicies}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAllIamPolicies} 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.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. + */ + searchAllIamPoliciesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchAllIamPolicies.createStream( + this._innerApiCalls.searchAllIamPolicies as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json new file mode 100644 index 00000000000..d033cf28f2b --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.asset.v1p1beta1.AssetService": { + "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": { + "SearchResources": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchIamPolicies": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllResources": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllIamPolicies": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..31c1cf27e9d --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/asset/v1p1beta1/assets.proto", + "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto" +] diff --git a/packages/google-cloud-asset/src/v1/index.js b/packages/google-cloud-asset/src/v1p1beta1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/v1/index.js rename to packages/google-cloud-asset/src/v1p1beta1/index.ts index 501c92ee4cf..6890c43379a 100644 --- a/packages/google-cloud-asset/src/v1/index.js +++ b/packages/google-cloud-asset/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // 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 AssetServiceClient = require('./asset_service_client'); - -module.exports.AssetServiceClient = AssetServiceClient; +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js deleted file mode 100644 index e04ab89f44f..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js +++ /dev/null @@ -1,841 +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 -// -// 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. - -'use strict'; - -const gapicConfig = require('./asset_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Asset service definition. - * - * @class - * @memberof v1p2beta1 - */ -class AssetServiceClient { - /** - * Construct an instance of AssetServiceClient. - * - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - 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' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? 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 = { - feedPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/feeds/{feed}' - ), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // 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 = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const exportAssetsResponse = protoFilesRoot.lookup( - 'google.cloud.asset.v1p2beta1.ExportAssetsResponse' - ); - const exportAssetsMetadata = protoFilesRoot.lookup( - 'google.cloud.asset.v1p2beta1.ExportAssetsRequest' - ); - - this._descriptors.longrunning = { - exportAssets: new gaxModule.LongrunningDescriptor( - this.operationsClient, - exportAssetsResponse.decode.bind(exportAssetsResponse), - exportAssetsMetadata.decode.bind(exportAssetsMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.asset.v1p2beta1.AssetService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.asset.v1p2beta1.AssetService. - const assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.cloud.asset.v1p2beta1.AssetService') - : protos.google.cloud.asset.v1p2beta1.AssetService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const assetServiceStubMethods = [ - 'exportAssets', - 'batchGetAssetsHistory', - 'createFeed', - 'getFeed', - 'listFeeds', - 'updateFeed', - 'deleteFeed', - ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = assetServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'cloudasset.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'cloudasset.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']; - } - - /** - * 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) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the google.longrunning.Operation API allowing you - * to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"). - * @param {Object} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} - * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * @param {number} [request.contentType] - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * @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/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.exportAssets(request); - * - * const [response] = await operation.promise(); - */ - exportAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.exportAssets(request, options, callback); - } - - /** - * Batch gets the update history of assets that overlap a time window. - * For RESOURCE content, this API outputs history with asset in both - * non-delete or deleted status. - * For IAM_POLICY content, this API outputs history when the asset and its - * attached IAM POLICY both exist. This can create gaps in the output history. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {string[]} request.assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * @param {number} request.contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * @param {Object} [request.readTimeWindow] - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} - * @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/interfaces/CallOptions.html} 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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const assetNames = []; - * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * const request = { - * parent: parent, - * assetNames: assetNames, - * contentType: contentType, - * }; - * client.batchGetAssetsHistory(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - batchGetAssetsHistory(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.batchGetAssetsHistory( - request, - options, - callback - ); - } - - /** - * Creates a feed in a parent project/folder/organization to listen to its - * asset updates. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * @param {string} request.feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * @param {Object} request.feed - * The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const feedId = ''; - * const feed = {}; - * const request = { - * parent: parent, - * feedId: feedId, - * feed: feed, - * }; - * client.createFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.createFeed(request, options, callback); - } - - /** - * Gets details about an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.getFeed({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.getFeed(request, options, callback); - } - - /** - * Lists all asset feeds in a parent project/folder/organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * @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/interfaces/CallOptions.html} 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 [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * client.listFeeds({parent: parent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - listFeeds(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.listFeeds(request, options, callback); - } - - /** - * Updates an asset feed configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.feed - * The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * @param {Object} request.updateMask - * Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @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/interfaces/CallOptions.html} 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const feed = {}; - * const updateMask = {}; - * const request = { - * feed: feed, - * updateMask: updateMask, - * }; - * client.updateFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feed.name': request.feed.name, - }); - - return this._innerApiCalls.updateFeed(request, options, callback); - } - - /** - * Deletes an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.deleteFeed({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.deleteFeed(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified feed resource name string. - * - * @param {String} project - * @param {String} feed - * @returns {String} - */ - feedPath(project, feed) { - return this._pathTemplates.feedPathTemplate.render({ - project: project, - feed: feed, - }); - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).project; - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the feed. - */ - matchFeedFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).feed; - } -} - -module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts new file mode 100644 index 00000000000..b57241e9943 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -0,0 +1,793 @@ +// Copyright 2019 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p2beta1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + assetServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @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 AssetServiceClient; + 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; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? 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 = { + projectFeedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), + folderFeedPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/feeds/{feed}' + ), + organizationFeedPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/feeds/{feed}' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1p2beta1.AssetService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1p2beta1.AssetService. + this.assetServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p2beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1p2beta1.AssetService, + 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 assetServiceStubMethods = [ + 'createFeed', + 'getFeed', + 'listFeeds', + 'updateFeed', + 'deleteFeed', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.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 -- + // ------------------- + createFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + ] + >; + createFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + | protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | 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 || '', + }); + return this._innerApiCalls.createFeed(request, options, callback); + } + getFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + ] + >; + getFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | 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 || '', + }); + return this._innerApiCalls.getFeed(request, options, callback); + } + listFeeds( + request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + ] + >; + listFeeds( + request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + > + ): void; + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @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 [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listFeeds( + request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + | protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | 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 || '', + }); + return this._innerApiCalls.listFeeds(request, options, callback); + } + updateFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + ] + >; + updateFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + | protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | 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({ + 'feed.name': request.feed!.name || '', + }); + return this._innerApiCalls.updateFeed(request, options, callback); + } + deleteFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + ] + >; + deleteFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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. + */ + deleteFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | 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 || '', + }); + return this._innerApiCalls.deleteFeed(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project: string, feed: string) { + return this._pathTemplates.projectFeedPathTemplate.render({ + project, + feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .feed; + } + + /** + * Return a fully-qualified folderFeed resource name string. + * + * @param {string} folder + * @param {string} feed + * @returns {string} Resource name string. + */ + folderFeedPath(folder: string, feed: string) { + return this._pathTemplates.folderFeedPathTemplate.render({ + folder, + feed, + }); + } + + /** + * Parse the folder from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .folder; + } + + /** + * Parse the feed from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .feed; + } + + /** + * Return a fully-qualified organizationFeed resource name string. + * + * @param {string} organization + * @param {string} feed + * @returns {string} Resource name string. + */ + organizationFeedPath(organization: string, feed: string) { + return this._pathTemplates.organizationFeedPathTemplate.render({ + organization, + feed, + }); + } + + /** + * Parse the organization from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).organization; + } + + /** + * Parse the feed from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).feed; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json index 11133174190..aa7547b8a79 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json @@ -2,56 +2,46 @@ "interfaces": { "google.cloud.asset.v1p2beta1.AssetService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { - "ExportAssets": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchGetAssetsHistory": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, "CreateFeed": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "timeout_millis": 10000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFeeds": { - "timeout_millis": 10000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFeed": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json index ac74955ea29..33e15d2df28 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/asset/v1p2beta1/assets.proto", "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto" ] diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js deleted file mode 100644 index 4dcaef87ca5..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js +++ /dev/null @@ -1,469 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Export asset request. - * - * @property {string} parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"). - * - * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * - * @property {Object} outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} - * - * @typedef ExportAssetsRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ExportAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation method in the returned - * google.longrunning.Operation.response field. - * - * @property {Object} readTime - * Time the snapshot was taken. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} outputConfig - * Output configuration indicating where the results were output to. - * All results are in JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} - * - * @typedef ExportAssetsResponse - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ExportAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history request. - * - * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * - * @property {string[]} assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * - * @property {number} contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * - * @property {Object} readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} - * - * @typedef BatchGetAssetsHistoryRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history response. - * - * @property {Object[]} assets - * A list of assets with valid time windows. - * - * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1p2beta1.TemporalAsset} - * - * @typedef BatchGetAssetsHistoryResponse - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Create asset feed request. - * - * @property {string} parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * - * @property {string} feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * - * @property {Object} feed - * The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * - * @typedef CreateFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.CreateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const CreateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Get asset feed request. - * - * @property {string} name - * The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef GetFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.GetFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const GetFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * List asset feeds request. - * - * @property {string} parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * - * @typedef ListFeedsRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ListFeedsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ListFeedsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * List asset feeds response. - * - * @property {Object[]} feeds - * A list of feeds. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * - * @typedef ListFeedsResponse - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ListFeedsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ListFeedsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Update asset feed request. - * - * @property {Object} feed - * The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * - * @property {Object} updateMask - * Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.UpdateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const UpdateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Delete asset feed request. - * - * @property {string} name - * The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef DeleteFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.DeleteFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const DeleteFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for export assets destination. - * - * @property {Object} gcsDestination - * Destination on Cloud Storage. - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1p2beta1.GcsDestination} - * - * @property {Object} bigqueryDestination - * Destination on Bigquery. The output table stores the fields in asset - * proto as columns in BigQuery. The resource/iam_policy field is converted - * to a record with each field to a column, except metadata to a single JSON - * string. - * - * This object should have the same structure as [BigQueryDestination]{@link google.cloud.asset.v1p2beta1.BigQueryDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Storage location. - * - * @property {string} uri - * The uri of the Cloud Storage object. It's the same uri that is used by - * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - * Editing Object - * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - * for more information. - * - * @property {string} uriPrefix - * The uri prefix of all generated Cloud Storage objects. For example: - * "gs://bucket_name/object_name_prefix". Each object uri is in format: - * "gs://bucket_name/object_name_prefix// and only - * contains assets for that type. starts from 0. For example: - * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - * the first shard of output objects containing all - * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - * returned if file with the same name "gs://bucket_name/object_name_prefix" - * already exists. - * - * @typedef GcsDestination - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Bigquery destination. - * - * @property {string} dataset - * Required. The BigQuery dataset in format - * "projects/projectId/datasets/datasetId", to which the snapshot result - * should be exported. If this dataset does not exist, the export call returns - * an error. - * - * @property {string} table - * Required. The BigQuery table to which the snapshot result should be - * written. If this table does not exist, a new table with the given name - * will be created. - * - * @property {boolean} force - * If the destination table already exists and this flag is `TRUE`, the - * table will be overwritten by the contents of assets snapshot. If the flag - * is not set and the destination table already exists, the export call - * returns an error. - * - * @typedef BigQueryDestination - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.BigQueryDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const BigQueryDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Pubsub destination. - * - * @property {string} topic - * The name of the Cloud Pub/Sub topic to publish to. - * For example: `projects/PROJECT_ID/topics/TOPIC_ID`. - * - * @typedef PubsubDestination - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.PubsubDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const PubsubDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for asset feed destination. - * - * @property {Object} pubsubDestination - * Destination on Cloud Pubsub. - * - * This object should have the same structure as [PubsubDestination]{@link google.cloud.asset.v1p2beta1.PubsubDestination} - * - * @typedef FeedOutputConfig - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.FeedOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const FeedOutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An asset feed used to export asset updates to a destinations. - * An asset feed filter controls what updates are exported. - * The asset feed must be created within a project, organization, or - * folder. Supported destinations are: - * Cloud Pub/Sub topics. - * - * @property {string} name - * Required. The format will be - * projects/{project_number}/feeds/{client-assigned_feed_identifier} or - * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or - * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} - * - * The client-assigned feed identifier must be unique within the parent - * project/folder/organization. - * - * @property {string[]} assetNames - * A list of the full names of the assets to receive updates. You must specify - * either or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. For - * example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * @property {string[]} assetTypes - * A list of types of the assets to receive updates. You must specify either - * or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. - * For example: - * "compute.googleapis.com/Disk" See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name and - * type will be returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * - * @property {Object} feedOutputConfig - * Required. Feed output configuration defining where the asset updates are - * published to. - * - * This object should have the same structure as [FeedOutputConfig]{@link google.cloud.asset.v1p2beta1.FeedOutputConfig} - * - * @typedef Feed - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.Feed definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const Feed = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Asset content type. - * - * @enum {number} - * @memberof google.cloud.asset.v1p2beta1 - */ -const ContentType = { - - /** - * Unspecified content type. - */ - CONTENT_TYPE_UNSPECIFIED: 0, - - /** - * Resource metadata. - */ - RESOURCE: 1, - - /** - * The actual IAM policy set on a resource. - */ - IAM_POLICY: 2, - - /** - * The IAM policy name for the IAM policy set on a resource. - */ - IAM_POLICY_NAME: 3, - ORG_POLICY: 4, - - /** - * The Cloud Access context mananger Policy set on an asset. - */ - ACCESS_POLICY: 5 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js deleted file mode 100644 index 03eedbc2aa6..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js +++ /dev/null @@ -1,167 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Temporal asset. In addition to the asset, the temporal asset includes the - * status of the asset and valid from and to time of it. - * - * @property {Object} window - * The time window when the asset data and state was observed. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} - * - * @property {boolean} deleted - * If the asset is deleted or not. - * - * @property {Object} asset - * Asset. - * - * This object should have the same structure as [Asset]{@link google.cloud.asset.v1p2beta1.Asset} - * - * @typedef TemporalAsset - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const TemporalAsset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A time window of (start_time, end_time]. - * - * @property {Object} startTime - * Start time of the time window (exclusive). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * End time of the time window (inclusive). - * Current timestamp if not specified. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeWindow - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const TimeWindow = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud asset. This includes all Google Cloud Platform resources, - * Cloud IAM policies, and other non-GCP assets. - * - * @property {string} name - * The full name of the asset. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * @property {string} assetType - * Type of the asset. Example: "compute.googleapis.com/Disk". - * - * @property {Object} resource - * Representation of the resource. - * - * This object should have the same structure as [Resource]{@link google.cloud.asset.v1p2beta1.Resource} - * - * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy set on it. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @property {Buffer} iamPolicyName - * Cloud IAM policy name of the Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy name associated - * with it. - * - * @property {string[]} ancestors - * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, - * represented as a list of relative resource names. Ancestry path starts with - * the closest CRM ancestor and ending at a visible root. If the asset is a - * CRM project/ folder/organization, this starts from the asset itself. - * - * Example: ["projects/123456789", "folders/5432", "organizations/1234"] - * - * @typedef Asset - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Representation of a cloud resource. - * - * @property {string} version - * The API version. Example: "v1". - * - * @property {string} discoveryDocumentUri - * The URL of the discovery document containing the resource's JSON schema. - * For example: - * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). - * It will be left unspecified for resources without a discovery-based API, - * such as Cloud Bigtable. - * - * @property {string} discoveryName - * The JSON schema name listed in the discovery document. - * Example: "Project". It will be left unspecified for resources (such as - * Cloud Bigtable) without a discovery-based API. - * - * @property {string} resourceUrl - * The REST URL for accessing the resource. An HTTP GET operation using this - * URL returns the resource itself. - * Example: - * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - * It will be left unspecified for resources without a REST API. - * - * @property {string} parent - * The full name of the immediate parent of this resource. See - * [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * For GCP assets, it is the parent resource defined in the [Cloud IAM policy - * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: - * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - * - * For third-party assets, it is up to the users to define. - * - * @property {Object} data - * The content of the resource, in which some sensitive fields are scrubbed - * away and may not be present. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} internalData - * The actual metadata content for the resource, only visible for internal - * users. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Resource - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const Resource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d6609..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/index.js b/packages/google-cloud-asset/src/v1p2beta1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/v1beta1/index.js rename to packages/google-cloud-asset/src/v1p2beta1/index.ts index 501c92ee4cf..6890c43379a 100644 --- a/packages/google-cloud-asset/src/v1beta1/index.js +++ b/packages/google-cloud-asset/src/v1p2beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // 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 AssetServiceClient = require('./asset_service_client'); - -module.exports.AssetServiceClient = AssetServiceClient; +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 71de83499c7..39ae8f116ff 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,28 +1,24 @@ { - "updateTime": "2020-01-28T12:09:25.073655Z", + "updateTime": "2020-01-30T19:19:18.903592Z", "sources": [ { - "generator": { - "name": "artman", - "version": "0.44.3", - "dockerImage": "googleapis/artman@sha256:62b8b29acaae54b06a4183aa772e65b106e92d4bc466eb4db07953ab78bdb90c" + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "603d73dabc4a5979b6b4bec3412b145c9994c8f2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", - "internalRef": "291821782", - "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" + "sha": "3ca2c014e24eb5111c8e7248b1e1eb833977c83d", + "internalRef": "292382559", + "log": "3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } + "git": {} } ], "destinations": [ @@ -31,9 +27,8 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } }, { @@ -41,9 +36,17 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" } }, { @@ -51,9 +54,8 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1p2beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ], @@ -79,15 +81,9 @@ { "path": ".github/release-please.yml" }, - { - "path": ".gitignore" - }, { "path": ".jsdoc.js" }, - { - "path": ".kokoro/.gitattributes" - }, { "path": ".kokoro/common.cfg" }, @@ -166,9 +162,6 @@ { "path": ".kokoro/publish.sh" }, - { - "path": ".kokoro/release/common.cfg" - }, { "path": ".kokoro/release/docs.cfg" }, @@ -202,12 +195,6 @@ { "path": ".prettierrc" }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, { "path": "CODE_OF_CONDUCT.md" }, @@ -226,9 +213,6 @@ { "path": "linkinator.config.json" }, - { - "path": "package.json" - }, { "path": "protos/google/cloud/asset/v1/asset_service.proto" }, @@ -241,12 +225,21 @@ { "path": "protos/google/cloud/asset/v1beta1/assets.proto" }, + { + "path": "protos/google/cloud/asset/v1p1beta1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1p1beta1/assets.proto" + }, { "path": "protos/google/cloud/asset/v1p2beta1/asset_service.proto" }, { "path": "protos/google/cloud/asset/v1p2beta1/assets.proto" }, + { + "path": "protos/google/cloud/common_resources.proto" + }, { "path": "protos/protos.d.ts" }, @@ -259,50 +252,11 @@ { "path": "renovate.json" }, - { - "path": "samples/.eslintrc.yml" - }, { "path": "samples/README.md" }, { - "path": "samples/createFeed.js" - }, - { - "path": "samples/deleteFeed.js" - }, - { - "path": "samples/exportAssets.js" - }, - { - "path": "samples/getBatchAssetHistory.js" - }, - { - "path": "samples/getFeed.js" - }, - { - "path": "samples/listFeeds.js" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/test/sample.test.js" - }, - { - "path": "samples/updateFeed.js" - }, - { - "path": "src/browser.js" - }, - { - "path": "src/index.js" - }, - { - "path": "src/v1/asset_service_client.js" + "path": "src/v1/asset_service_client.ts" }, { "path": "src/v1/asset_service_client_config.json" @@ -311,43 +265,10 @@ "path": "src/v1/asset_service_proto_list.json" }, { - "path": "src/v1/doc/google/cloud/asset/v1/doc_asset_service.js" + "path": "src/v1/index.ts" }, { - "path": "src/v1/doc/google/cloud/asset/v1/doc_assets.js" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_empty.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1/index.js" - }, - { - "path": "src/v1beta1/asset_service_client.js" + "path": "src/v1beta1/asset_service_client.ts" }, { "path": "src/v1beta1/asset_service_client_config.json" @@ -356,37 +277,22 @@ "path": "src/v1beta1/asset_service_proto_list.json" }, { - "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + "path": "src/v1beta1/index.ts" }, { - "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + "path": "src/v1p1beta1/asset_service_client.ts" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + "path": "src/v1p1beta1/asset_service_client_config.json" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + "path": "src/v1p1beta1/asset_service_proto_list.json" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + "path": "src/v1p1beta1/index.ts" }, { - "path": "src/v1beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1beta1/index.js" - }, - { - "path": "src/v1p2beta1/asset_service_client.js" + "path": "src/v1p2beta1/asset_service_client.ts" }, { "path": "src/v1p2beta1/asset_service_client_config.json" @@ -395,64 +301,38 @@ "path": "src/v1p2beta1/asset_service_proto_list.json" }, { - "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js" + "path": "src/v1p2beta1/index.ts" }, { - "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js" + "path": "system-test/fixtures/sample/src/index.js" }, { - "path": "src/v1p2beta1/doc/google/iam/v1/doc_policy.js" + "path": "system-test/fixtures/sample/src/index.ts" }, { - "path": "src/v1p2beta1/doc/google/longrunning/doc_operations.js" + "path": "system-test/install.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_any.js" + "path": "test/gapic-asset_service-v1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_empty.js" + "path": "test/gapic-asset_service-v1beta1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_field_mask.js" + "path": "test/gapic-asset_service-v1p1beta1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_struct.js" + "path": "test/gapic-asset_service-v1p2beta1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_timestamp.js" + "path": "tsconfig.json" }, { - "path": "src/v1p2beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1p2beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1p2beta1/index.js" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "system-test/.eslintrc.yml" - }, - { - "path": "system-test/no-tests.js" - }, - { - "path": "test/gapic-v1.js" - }, - { - "path": "test/gapic-v1beta1.js" - }, - { - "path": "test/gapic-v1p2beta1.js" + "path": "tslint.json" }, { "path": "webpack.config.js" } - ] + ], + "combinedCommitLog": "Changes in googleapis:\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 6f78852b9c7..aaeb2aa1df8 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -20,38 +20,30 @@ logging.basicConfig(level=logging.DEBUG) -# run the gapic generator -gapic = gcp.GAPICGenerator() -versions = ['v1beta1', 'v1', 'v1p2beta1'] +gapic = gcp.GAPICMicrogenerator() +versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1'] +name = 'asset' for version in versions: - library = gapic.node_library( - 'asset', - version, - config_path=f"artman_cloudasset_{version}.yaml", - artman_output_name=f"asset-{version}") - s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) + library = gapic.typescript_library( + name, + proto_path=f'google/cloud/{name}/{version}', + generator_args={ + 'grpc-service-config': f'google/cloud/{name}/{version}/cloud{name}_grpc_service_config.json', + 'package-name': f'@google-cloud/{name}' + }, + extra_proto_files=['google/cloud/common_resources.proto'], + version=version) + # skip index, protos, package.json, and README.md + s.copy( + library, + excludes=['package.json', 'src/index.ts'] + ) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +templates = common_templates.node_library(source_location='build/src') s.copy(templates) -# [START fix-dead-link] -discovery_url = 'https://www.googleapis.com/discovery/v1/apis/compute/v1/rest' -s.replace('**/doc/google/cloud/asset/*/doc_assets.js', - f'`"{discovery_url}"`', - f'[`"{discovery_url}"`]({discovery_url})') - -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', - r"https://\1)") - -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'toISOString\]', - 'toISOString)') -# [END fix-dead-link] - - # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..6f3575b6c25 --- /dev/null +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2019 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 asset = require('@google-cloud/asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1c292d6b651 --- /dev/null +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2019 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 {AssetServiceClient} from '@google-cloud/asset'; + +function main() { + const assetServiceClient = new AssetServiceClient(); +} + +main(); diff --git a/packages/google-cloud-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts new file mode 100644 index 00000000000..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-asset/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 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-asset/system-test/no-tests.js b/packages/google-cloud-asset/system-test/no-tests.js deleted file mode 100644 index 28550b2df42..00000000000 --- a/packages/google-cloud-asset/system-test/no-tests.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 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. - -console.log('no system tests 👻'); diff --git a/packages/google-cloud-asset/test/gapic-v1p2beta1.js b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts similarity index 54% rename from packages/google-cloud-asset/test/gapic-v1p2beta1.js rename to packages/google-cloud-asset/test/gapic-asset_service-v1.ts index 8e90dd2a873..5a87d233785 100644 --- a/packages/google-cloud-asset/test/gapic-v1p2beta1.js +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,166 +11,114 @@ // 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 assert = require('assert'); -const {describe, it} = require('mocha'); - -const assetModule = require('../src'); +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} -describe('AssetServiceClient', () => { +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1.AssetServiceClient', () => { it('has servicePath', () => { - const servicePath = assetModule.v1p2beta1.AssetServiceClient.servicePath; + const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; assert(servicePath); }); - it('has apiEndpoint', () => { - const apiEndpoint = assetModule.v1p2beta1.AssetServiceClient.apiEndpoint; + const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; assert(apiEndpoint); }); - it('has port', () => { - const port = assetModule.v1p2beta1.AssetServiceClient.port; + const port = assetserviceModule.v1.AssetServiceClient.port; assert(port); assert(typeof port === 'number'); }); - - it('should create a client with no options', () => { - const client = new assetModule.v1p2beta1.AssetServiceClient(); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); assert(client); }); - it('should create a client with gRPC fallback', () => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ fallback: true, }); assert(client); }); - - describe('exportAssets', function() { - it('invokes exportAssets without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes exportAssets with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.exportAssets.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.exportAssets.metadataDecoder instanceof - Function - ); - }); - }); - describe('batchGetAssetsHistory', () => { it('invokes batchGetAssetsHistory without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const assetNames = []; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const request = { - parent: parent, - assetNames: assetNames, - contentType: contentType, - }; - + const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.batchGetAssetsHistory(request, (err, response) => { + client.batchGetAssetsHistory(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -178,67 +126,45 @@ describe('AssetServiceClient', () => { }); it('invokes batchGetAssetsHistory with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const assetNames = []; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const request = { - parent: parent, - assetNames: assetNames, - contentType: contentType, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( request, null, error ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert(err instanceof Error); + client.batchGetAssetsHistory(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('createFeed', () => { it('invokes createFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - + const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createFeed = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createFeed(request, (err, response) => { + client.createFeed(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -246,63 +172,45 @@ describe('AssetServiceClient', () => { }); it('invokes createFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createFeed = mockSimpleGrpcMethod( request, null, error ); - - client.createFeed(request, (err, response) => { - assert(err instanceof Error); + client.createFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('getFeed', () => { it('invokes getFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getFeed = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.getFeed(request, (err, response) => { + client.getFeed(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -310,56 +218,45 @@ describe('AssetServiceClient', () => { }); it('invokes getFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getFeed = mockSimpleGrpcMethod( request, null, error ); - - client.getFeed(request, (err, response) => { - assert(err instanceof Error); + client.getFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('listFeeds', () => { it('invokes listFeeds without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - + const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.listFeeds(request, (err, response) => { + client.listFeeds(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -367,61 +264,47 @@ describe('AssetServiceClient', () => { }); it('invokes listFeeds with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( request, null, error ); - - client.listFeeds(request, (err, response) => { - assert(err instanceof Error); + client.listFeeds(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('updateFeed', () => { it('invokes updateFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - + const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.updateFeed(request, (err, response) => { + client.updateFeed(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -429,112 +312,135 @@ describe('AssetServiceClient', () => { }); it('invokes updateFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( request, null, error ); - - client.updateFeed(request, (err, response) => { - assert(err instanceof Error); + client.updateFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('deleteFeed', () => { it('invokes deleteFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(request); - - client.deleteFeed(request, err => { + const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteFeed(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); it('invokes deleteFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( request, null, error ); - - client.deleteFeed(request, err => { - assert(err instanceof Error); + client.deleteFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} + describe('exportAssets', () => { + it('invokes exportAssets without error', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .exportAssets(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } + it('invokes exportAssets with error', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .exportAssets(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts similarity index 52% rename from packages/google-cloud-asset/test/gapic-v1beta1.js rename to packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts index a06ab6d3ebc..a403153c98c 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,230 +11,204 @@ // 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 assert = require('assert'); -const {describe, it} = require('mocha'); - -const assetModule = require('../src'); +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} -describe('AssetServiceClient', () => { +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta1.AssetServiceClient', () => { it('has servicePath', () => { - const servicePath = assetModule.v1beta1.AssetServiceClient.servicePath; + const servicePath = + assetserviceModule.v1beta1.AssetServiceClient.servicePath; assert(servicePath); }); - it('has apiEndpoint', () => { - const apiEndpoint = assetModule.v1beta1.AssetServiceClient.apiEndpoint; + const apiEndpoint = + assetserviceModule.v1beta1.AssetServiceClient.apiEndpoint; assert(apiEndpoint); }); - it('has port', () => { - const port = assetModule.v1beta1.AssetServiceClient.port; + const port = assetserviceModule.v1beta1.AssetServiceClient.port; assert(port); assert(typeof port === 'number'); }); - - it('should create a client with no options', () => { - const client = new assetModule.v1beta1.AssetServiceClient(); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient(); assert(client); }); - it('should create a client with gRPC fallback', () => { - const client = new assetModule.v1beta1.AssetServiceClient({fallback: true}); + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + fallback: true, + }); assert(client); }); + describe('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', done => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.batchGetAssetsHistory(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); - describe('exportAssets', function() { + it('invokes batchGetAssetsHistory with error', done => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + null, + error + ); + client.batchGetAssetsHistory(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('exportAssets', () => { it('invokes exportAssets without error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetserviceModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const outputConfig = {}; - const request = { - parent: formattedParent, - outputConfig: outputConfig, - }; - + const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( request, expectedResponse ); - client .exportAssets(request) - .then(responses => { + .then((responses: [Operation]) => { const operation = responses[0]; - return operation.promise(); + return operation ? operation.promise() : {}; }) - .then(responses => { + .then((responses: [Operation]) => { assert.deepStrictEqual(responses[0], expectedResponse); done(); }) - .catch(err => { + .catch((err: {}) => { done(err); }); }); it('invokes exportAssets with error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetserviceModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const outputConfig = {}; - const request = { - parent: formattedParent, - outputConfig: outputConfig, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( request, null, error ); - client .exportAssets(request) - .then(responses => { + .then((responses: [Operation]) => { const operation = responses[0]; - return operation.promise(); + return operation ? operation.promise() : {}; }) .then(() => { assert.fail(); }) - .catch(err => { - assert(err instanceof Error); + .catch((err: FakeError) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); done(); }); }); - - it('has longrunning decoder functions', () => { - const client = new assetModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.exportAssets.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.exportAssets.metadataDecoder instanceof - Function - ); - }); - }); - - describe('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: formattedParent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchGetAssetsHistory with error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: formattedParent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); }); }); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts new file mode 100644 index 00000000000..1c0bf79c478 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -0,0 +1,298 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +describe('v1p1beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('searchResources', () => { + it('invokes searchResources without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchResources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchResourcesStream', () => { + it('invokes searchResourcesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchResourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('searchIamPolicies', () => { + it('invokes searchIamPolicies without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchIamPolicies(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchIamPoliciesStream', () => { + it('invokes searchIamPoliciesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchIamPoliciesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('searchAllResources', () => { + it('invokes searchAllResources without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchAllResources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchAllResourcesStream', () => { + it('invokes searchAllResourcesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchAllResourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchAllIamPolicies(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchAllIamPoliciesStream', () => { + it('invokes searchAllIamPoliciesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchAllIamPoliciesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts new file mode 100644 index 00000000000..98e7b145c75 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts @@ -0,0 +1,320 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1p2beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('createFeed', () => { + it('invokes createFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getFeed', () => { + it('invokes getFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listFeeds', () => { + it('invokes listFeeds without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listFeeds(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listFeeds with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listFeeds(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateFeed', () => { + it('invokes updateFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteFeed', () => { + it('invokes deleteFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js deleted file mode 100644 index 38624f8f70c..00000000000 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ /dev/null @@ -1,538 +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 -// -// 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. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const assetModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = assetModule.v1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = assetModule.v1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetModule.v1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new assetModule.v1.AssetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new assetModule.v1.AssetServiceClient({fallback: true}); - assert(client); - }); - - describe('exportAssets', function() { - it('invokes exportAssets without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes exportAssets with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.exportAssets.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.exportAssets.metadataDecoder instanceof - Function - ); - }); - }); - - describe('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: parent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchGetAssetsHistory with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: parent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createFeed', () => { - it('invokes createFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createFeed(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - - // Mock Grpc layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createFeed(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getFeed', () => { - it('invokes getFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getFeed(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getFeed(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listFeeds', () => { - it('invokes listFeeds without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.listFeeds(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listFeeds with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - - // Mock Grpc layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listFeeds(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateFeed', () => { - it('invokes updateFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateFeed(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateFeed(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteFeed', () => { - it('invokes deleteFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(request); - - client.deleteFeed(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteFeed(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/packages/google-cloud-asset/tsconfig.json b/packages/google-cloud-asset/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-asset/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-asset/tslint.json b/packages/google-cloud-asset/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-asset/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js index 03328fdf838..c49be15531d 100644 --- a/packages/google-cloud-asset/webpack.config.js +++ b/packages/google-cloud-asset/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 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,11 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'asset', - filename: './asset.js', + library: 'AssetService', + filename: './asset-service.js', }, node: { child_process: 'empty', @@ -24,21 +26,37 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, - use: 'null-loader', + 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[\\/]https?-proxy-agent/, + use: 'null-loader' }, { - test: /node_modules[\\/]gtoken[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]gtoken/, + use: 'null-loader' }, ], }, From adda98eb3217eb6cc9f8d7788bdd83e4dda598cc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2020 11:55:55 -0800 Subject: [PATCH 167/429] chore: release 2.0.0 (#254) --- packages/google-cloud-asset/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 79de3c99827..50279bde022 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,17 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [2.0.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.6.1...v2.0.0) (2020-01-30) + + +### ⚠ BREAKING CHANGES + +* removes projectPath helper, instead use "projects/${project}". + +### Features + +* converts library to TypeScript adding v1p1beta1 surface ([#250](https://www.github.com/googleapis/nodejs-asset/issues/250)) ([54c1c48](https://www.github.com/googleapis/nodejs-asset/commit/54c1c48ebe364b665763fe056bd89401d11e020b)) + ### [1.6.1](https://www.github.com/googleapis/nodejs-asset/compare/v1.6.0...v1.6.1) (2020-01-28) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index a6a79b15b4c..411acb876fb 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "1.6.1", + "version": "2.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 00cd9a07c37..82002017337 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^1.6.1", + "@google-cloud/asset": "^2.0.0", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^15.0.0" From 0d79f4db8b374781f582383128e5d68f5c3a562c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 17:22:41 -0800 Subject: [PATCH 168/429] chore: skip img.shields.io in docs test --- packages/google-cloud-asset/linkinator.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/linkinator.config.json b/packages/google-cloud-asset/linkinator.config.json index d780d6bfff5..b555215ca02 100644 --- a/packages/google-cloud-asset/linkinator.config.json +++ b/packages/google-cloud-asset/linkinator.config.json @@ -2,6 +2,7 @@ "recurse": true, "skip": [ "https://codecov.io/gh/googleapis/", - "www.googleapis.com" + "www.googleapis.com", + "img.shields.io" ] } From dc284df5cf552034b9830961ac0dea627d94d370 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 19:02:57 -0800 Subject: [PATCH 169/429] test: modernize mocha config (#257) --- packages/google-cloud-asset/.mocharc.json | 5 +++++ packages/google-cloud-asset/package.json | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-asset/.mocharc.json diff --git a/packages/google-cloud-asset/.mocharc.json b/packages/google-cloud-asset/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-asset/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 411acb876fb..185fe3a08d4 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -55,7 +55,6 @@ "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", - "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -63,7 +62,6 @@ "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "power-assert": "^1.6.0", "prettier": "^1.13.7", "ts-loader": "^6.2.1", "typescript": "~3.6.4", From 1cd4a1a397f597881c1b399e832739675c4f86ba Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 7 Feb 2020 11:33:10 -0800 Subject: [PATCH 170/429] build: autosynth was failing due to bad data in synth.metadata (#259) --- packages/google-cloud-asset/synth.metadata | 338 --------------------- 1 file changed, 338 deletions(-) delete mode 100644 packages/google-cloud-asset/synth.metadata diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata deleted file mode 100644 index 39ae8f116ff..00000000000 --- a/packages/google-cloud-asset/synth.metadata +++ /dev/null @@ -1,338 +0,0 @@ -{ - "updateTime": "2020-01-30T19:19:18.903592Z", - "sources": [ - { - "git": { - "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "603d73dabc4a5979b6b4bec3412b145c9994c8f2" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3ca2c014e24eb5111c8e7248b1e1eb833977c83d", - "internalRef": "292382559", - "log": "3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" - } - }, - { - "git": {} - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1p1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1p2beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - } - ], - "newFiles": [ - { - "path": ".eslintignore" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".nycrc" - }, - { - "path": ".prettierignore" - }, - { - "path": ".prettierrc" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "LICENSE" - }, - { - "path": "README.md" - }, - { - "path": "codecov.yaml" - }, - { - "path": "linkinator.config.json" - }, - { - "path": "protos/google/cloud/asset/v1/asset_service.proto" - }, - { - "path": "protos/google/cloud/asset/v1/assets.proto" - }, - { - "path": "protos/google/cloud/asset/v1beta1/asset_service.proto" - }, - { - "path": "protos/google/cloud/asset/v1beta1/assets.proto" - }, - { - "path": "protos/google/cloud/asset/v1p1beta1/asset_service.proto" - }, - { - "path": "protos/google/cloud/asset/v1p1beta1/assets.proto" - }, - { - "path": "protos/google/cloud/asset/v1p2beta1/asset_service.proto" - }, - { - "path": "protos/google/cloud/asset/v1p2beta1/assets.proto" - }, - { - "path": "protos/google/cloud/common_resources.proto" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, - { - "path": "renovate.json" - }, - { - "path": "samples/README.md" - }, - { - "path": "src/v1/asset_service_client.ts" - }, - { - "path": "src/v1/asset_service_client_config.json" - }, - { - "path": "src/v1/asset_service_proto_list.json" - }, - { - "path": "src/v1/index.ts" - }, - { - "path": "src/v1beta1/asset_service_client.ts" - }, - { - "path": "src/v1beta1/asset_service_client_config.json" - }, - { - "path": "src/v1beta1/asset_service_proto_list.json" - }, - { - "path": "src/v1beta1/index.ts" - }, - { - "path": "src/v1p1beta1/asset_service_client.ts" - }, - { - "path": "src/v1p1beta1/asset_service_client_config.json" - }, - { - "path": "src/v1p1beta1/asset_service_proto_list.json" - }, - { - "path": "src/v1p1beta1/index.ts" - }, - { - "path": "src/v1p2beta1/asset_service_client.ts" - }, - { - "path": "src/v1p2beta1/asset_service_client_config.json" - }, - { - "path": "src/v1p2beta1/asset_service_proto_list.json" - }, - { - "path": "src/v1p2beta1/index.ts" - }, - { - "path": "system-test/fixtures/sample/src/index.js" - }, - { - "path": "system-test/fixtures/sample/src/index.ts" - }, - { - "path": "system-test/install.ts" - }, - { - "path": "test/gapic-asset_service-v1.ts" - }, - { - "path": "test/gapic-asset_service-v1beta1.ts" - }, - { - "path": "test/gapic-asset_service-v1p1beta1.ts" - }, - { - "path": "test/gapic-asset_service-v1p2beta1.ts" - }, - { - "path": "tsconfig.json" - }, - { - "path": "tslint.json" - }, - { - "path": "webpack.config.js" - } - ], - "combinedCommitLog": "Changes in googleapis:\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" -} \ No newline at end of file From a2413ebf22148ae4c7613f770c83c49e0901c922 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 7 Feb 2020 23:08:55 +0100 Subject: [PATCH 171/429] chore(deps): update dependency @types/mocha to v7 (#255) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 185fe3a08d4..b6b984b52a0 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -46,7 +46,7 @@ "protobufjs": "^6.8.0" }, "devDependencies": { - "@types/mocha": "^5.2.5", + "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "c8": "^7.0.1", "codecov": "^3.0.4", From 98caa742dc1f98650c5eec47d780db054c30ad13 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 Feb 2020 18:04:53 +0100 Subject: [PATCH 172/429] chore(deps): update dependency linkinator to v2 --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b6b984b52a0..040d4292382 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -58,7 +58,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", - "linkinator": "^1.5.0", + "linkinator": "^2.0.0", "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", From 45cdbcd419da32e22518a18d3e3fd73074679236 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Feb 2020 11:22:02 -0800 Subject: [PATCH 173/429] fix: useless path template methods removed Co-authored-by: Alexander Fenster --- packages/google-cloud-asset/.gitignore | 4 +- .../cloud/asset/v1p1beta1/asset_service.proto | 30 +- .../google-cloud-asset/protos/protos.d.ts | 4392 ++--- packages/google-cloud-asset/protos/protos.js | 15356 ++++++++-------- .../google-cloud-asset/protos/protos.json | 544 +- .../src/v1/asset_service_client.ts | 92 +- .../src/v1/asset_service_proto_list.json | 4 +- .../src/v1beta1/asset_service_client.ts | 20 - .../src/v1beta1/asset_service_proto_list.json | 4 +- .../src/v1p1beta1/asset_service_client.ts | 86 +- .../v1p1beta1/asset_service_proto_list.json | 4 +- .../src/v1p2beta1/asset_service_client.ts | 82 +- .../v1p2beta1/asset_service_proto_list.json | 4 +- packages/google-cloud-asset/synth.metadata | 58 + .../test/gapic-asset_service-v1.ts | 12 + .../test/gapic-asset_service-v1beta1.ts | 4 + .../test/gapic-asset_service-v1p1beta1.ts | 20 +- .../test/gapic-asset_service-v1p2beta1.ts | 8 + 18 files changed, 10406 insertions(+), 10318 deletions(-) create mode 100644 packages/google-cloud-asset/synth.metadata diff --git a/packages/google-cloud-asset/.gitignore b/packages/google-cloud-asset/.gitignore index 97cdf45ca3b..5d32b23782f 100644 --- a/packages/google-cloud-asset/.gitignore +++ b/packages/google-cloud-asset/.gitignore @@ -1,12 +1,14 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ +out/ build/ system-test/secrets.js system-test/*key.json *.lock -**/package-lock.json .DS_Store +package-lock.json __pycache__ diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto index 025adb27fe1..2083e45706c 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -93,13 +93,14 @@ message SearchResourcesRequest { // search all the supported asset types. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Returned results may be fewer - // than requested. The value of this field is capped at 2000. If set to the - // zero value, server will pick an appropriate default. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the preceding call - // to this method. `page_token` must be the value of `next_page_token` from + // to this method. `page_token` must be the value of `next_page_token` from // the previous response. The values of all other method parameters, must be // identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; @@ -131,9 +132,10 @@ message SearchIamPoliciesRequest { // * "policy:(myuser@mydomain.com viewer)" string query = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Returned results may be fewer - // than requested. The maximum is 2000. If set to the zero value, the server - // will pick an appropriate default. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, retrieve the next batch of results from the preceding call to @@ -171,9 +173,10 @@ message SearchAllResourcesRequest { // search all the supported asset types. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Returned results may be fewer - // than requested. The value of this field is capped at 2000. If set to the - // zero value, server will pick an appropriate default. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the preceding call @@ -209,9 +212,10 @@ message SearchAllIamPoliciesRequest { // * "policy:(myuser@mydomain.com viewer)" string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Returned results may be fewer - // than requested. The maximum is 2000. If set to the zero value, the server - // will pick an appropriate default. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, retrieve the next batch of results from the preceding call to diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 5c4491999a5..3396171ee31 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -26,2176 +26,2176 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); - - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); - } - - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new TemporalAsset. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new TemporalAsset instance using the specified properties. - * @param [properties] Properties to set - * @returns TemporalAsset instance + * Creates new AssetService 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(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; /** - * Verifies a TemporalAsset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static verify(message: { [k: string]: any }): (string|null); + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TemporalAsset + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset - * @param [options] Conversion options - * @returns Plain object + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; /** - * Converts this TemporalAsset to JSON. - * @returns JSON object + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; /** - * Constructs a new TimeWindow. - * @param [properties] Properties to set + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; /** - * Creates a new TimeWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeWindow instance + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; + } + + namespace AssetService { /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * 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 + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; /** - * 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 + * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Verifies a TimeWindow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static verify(message: { [k: string]: any }): (string|null); + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeWindow + * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; /** - * 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 + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Converts this TimeWindow to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty */ - public toJSON(): { [k: string]: any }; + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Properties of an Asset. */ - interface IAsset { + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { - /** Asset name */ - name?: (string|null); + /** ExportAssetsRequest parent */ + parent?: (string|null); - /** Asset assetType */ - assetType?: (string|null); + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); - /** Asset ancestors */ - ancestors?: (string[]|null); + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { /** - * Constructs a new Asset. + * Constructs a new ExportAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAsset); + constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); - /** Asset name. */ - public name: string; + /** ExportAssetsRequest parent. */ + public parent: string; - /** Asset assetType. */ - public assetType: string; + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); - /** Asset ancestors. */ - public ancestors: string[]; + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); /** - * Creates a new Asset instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns ExportAssetsRequest instance */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns ExportAssetsRequest * @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.asset.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsRequest; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns ExportAssetsRequest * @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.asset.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsRequest; /** - * Verifies an Asset message. + * Verifies an ExportAssetsRequest 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns ExportAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this ExportAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); - - /** Resource discoveryName */ - discoveryName?: (string|null); - - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { - /** Resource parent */ - parent?: (string|null); + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { /** - * Constructs a new Resource. + * Constructs a new ExportAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; - - /** Resource discoveryName. */ - public discoveryName: string; - - /** Resource resourceUrl. */ - public resourceUrl: string; + constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); - /** Resource parent. */ - public parent: string; + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); /** - * Creates a new Resource instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns ExportAssetsResponse instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns ExportAssetsResponse * @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.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsResponse; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns ExportAssetsResponse * @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.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsResponse; /** - * Verifies a Resource message. + * Verifies an ExportAssetsResponse 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns ExportAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this ExportAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { - /** - * Constructs a new AssetService 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); + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + } + + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { /** - * Creates new AssetService 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. + * Constructs a new BatchGetAssetsHistoryRequest. + * @param [properties] Properties to set */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); + + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; + + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryRequest instance */ - public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise - */ - public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; - - /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @returns Promise + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Verifies a BatchGetAssetsHistoryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @returns Promise + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryRequest */ - public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest + * @param [options] Conversion options + * @returns Plain object */ - public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @returns Promise + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @returns JSON object */ - public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; + public toJSON(): { [k: string]: any }; + } - /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed - */ - public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { + + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); + } + + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @returns Promise + * Constructs a new BatchGetAssetsHistoryResponse. + * @param [properties] Properties to set */ - public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); + + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1.ITemporalAsset[]; /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryResponse instance */ - public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @returns Promise + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; - } - - namespace AssetService { + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. - * @param error Error, if any - * @param [response] Feed + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. - * @param error Error, if any - * @param [response] Feed + * Verifies a BatchGetAssetsHistoryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. - * @param error Error, if any - * @param [response] ListFeedsResponse + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryResponse */ - type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. - * @param error Error, if any - * @param [response] Feed + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse + * @param [options] Conversion options + * @returns Plain object */ - type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. - * @param error Error, if any - * @param [response] Empty + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @returns JSON object */ - type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { - /** ExportAssetsRequest parent */ + /** CreateFeedRequest parent */ parent?: (string|null); - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); - - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + /** CreateFeedRequest feedId */ + feedId?: (string|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new CreateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); + constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); - /** ExportAssetsRequest parent. */ + /** CreateFeedRequest parent. */ public parent: string; - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; - - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + /** CreateFeedRequest feedId. */ + public feedId: string; - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns CreateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns CreateFeedRequest * @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.asset.v1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateFeedRequest; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns CreateFeedRequest * @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.asset.v1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateFeedRequest; /** - * Verifies an ExportAssetsRequest message. + * Verifies a CreateFeedRequest 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns CreateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this CreateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { - - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** GetFeedRequest name */ + name?: (string|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new GetFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); - - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** GetFeedRequest name. */ + public name: string; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns GetFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns GetFeedRequest * @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.asset.v1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetFeedRequest; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns GetFeedRequest * @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.asset.v1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetFeedRequest; /** - * Verifies an ExportAssetsResponse message. + * Verifies a GetFeedRequest 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns GetFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this GetFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { - /** BatchGetAssetsHistoryRequest parent */ + /** ListFeedsRequest parent */ parent?: (string|null); - - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); - - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); - - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); } - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new ListFeedsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); + constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); - /** BatchGetAssetsHistoryRequest parent. */ + /** ListFeedsRequest parent. */ public parent: string; - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; - - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); - - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); - /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * @returns ListFeedsRequest instance */ - public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest + * @returns ListFeedsRequest * @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.asset.v1.BatchGetAssetsHistoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsRequest; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest + * @returns ListFeedsRequest * @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.asset.v1.BatchGetAssetsHistoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsRequest; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a ListFeedsRequest 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * @returns ListFeedsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this ListFeedsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1.IFeed[]|null); } - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Constructs a new ListFeedsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); + constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1.ITemporalAsset[]; + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1.IFeed[]; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * @returns ListFeedsResponse instance */ - public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse + * @returns ListFeedsResponse * @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.asset.v1.BatchGetAssetsHistoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsResponse; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse + * @returns ListFeedsResponse * @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.asset.v1.BatchGetAssetsHistoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsResponse; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies a ListFeedsResponse 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * @returns ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this ListFeedsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateFeedRequest. */ - interface ICreateFeedRequest { - - /** CreateFeedRequest parent */ - parent?: (string|null); - - /** CreateFeedRequest feedId */ - feedId?: (string|null); + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { - /** CreateFeedRequest feed */ + /** UpdateFeedRequest feed */ feed?: (google.cloud.asset.v1.IFeed|null); + + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a CreateFeedRequest. */ - class CreateFeedRequest implements ICreateFeedRequest { + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { /** - * Constructs a new CreateFeedRequest. + * Constructs a new UpdateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); - - /** CreateFeedRequest parent. */ - public parent: string; - - /** CreateFeedRequest feedId. */ - public feedId: string; + constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); - /** CreateFeedRequest feed. */ + /** UpdateFeedRequest feed. */ public feed?: (google.cloud.asset.v1.IFeed|null); + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFeedRequest instance + * @returns UpdateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; + public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFeedRequest + * @returns UpdateFeedRequest * @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.asset.v1.CreateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateFeedRequest; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFeedRequest + * @returns UpdateFeedRequest * @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.asset.v1.CreateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateFeedRequest; /** - * Verifies a CreateFeedRequest message. + * Verifies an UpdateFeedRequest 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 CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFeedRequest + * @returns UpdateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. - * @param message CreateFeedRequest + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this UpdateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetFeedRequest. */ - interface IGetFeedRequest { + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { - /** GetFeedRequest name */ + /** DeleteFeedRequest name */ name?: (string|null); } - /** Represents a GetFeedRequest. */ - class GetFeedRequest implements IGetFeedRequest { + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { /** - * Constructs a new GetFeedRequest. + * Constructs a new DeleteFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); + constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); - /** GetFeedRequest name. */ + /** DeleteFeedRequest name. */ public name: string; /** - * Creates a new GetFeedRequest instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetFeedRequest instance + * @returns DeleteFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; + public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetFeedRequest + * @returns DeleteFeedRequest * @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.asset.v1.GetFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteFeedRequest; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetFeedRequest + * @returns DeleteFeedRequest * @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.asset.v1.GetFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteFeedRequest; /** - * Verifies a GetFeedRequest message. + * Verifies a DeleteFeedRequest 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 GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetFeedRequest + * @returns DeleteFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. - * @param message GetFeedRequest + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetFeedRequest to JSON. + * Converts this DeleteFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsRequest. */ - interface IListFeedsRequest { + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** ListFeedsRequest parent */ - parent?: (string|null); + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); } - /** Represents a ListFeedsRequest. */ - class ListFeedsRequest implements IListFeedsRequest { + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { /** - * Constructs a new ListFeedsRequest. + * Constructs a new OutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); + constructor(properties?: google.cloud.asset.v1.IOutputConfig); - /** ListFeedsRequest parent. */ - public parent: string; + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsRequest instance + * @returns OutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; + public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsRequest + * @returns OutputConfig * @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.asset.v1.ListFeedsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.OutputConfig; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsRequest + * @returns OutputConfig * @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.asset.v1.ListFeedsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.OutputConfig; /** - * Verifies a ListFeedsRequest message. + * Verifies an OutputConfig 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 ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsRequest + * @returns OutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. - * @param message ListFeedsRequest + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this OutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsResponse. */ - interface IListFeedsResponse { + /** Properties of a GcsDestination. */ + interface IGcsDestination { - /** ListFeedsResponse feeds */ - feeds?: (google.cloud.asset.v1.IFeed[]|null); + /** GcsDestination uri */ + uri?: (string|null); + + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } - /** Represents a ListFeedsResponse. */ - class ListFeedsResponse implements IListFeedsResponse { + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Constructs a new ListFeedsResponse. + * Constructs a new GcsDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); + constructor(properties?: google.cloud.asset.v1.IGcsDestination); - /** ListFeedsResponse feeds. */ - public feeds: google.cloud.asset.v1.IFeed[]; + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination uriPrefix. */ + public uriPrefix: string; + + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsResponse instance + * @returns GcsDestination instance */ - public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; + public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsResponse + * @returns GcsDestination * @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.asset.v1.ListFeedsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GcsDestination; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsResponse + * @returns GcsDestination * @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.asset.v1.ListFeedsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GcsDestination; /** - * Verifies a ListFeedsResponse message. + * Verifies a GcsDestination 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 ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsResponse + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. - * @param message ListFeedsResponse + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this GcsDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateFeedRequest. */ - interface IUpdateFeedRequest { + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { - /** UpdateFeedRequest feed */ - feed?: (google.cloud.asset.v1.IFeed|null); + /** BigQueryDestination dataset */ + dataset?: (string|null); - /** UpdateFeedRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination force */ + force?: (boolean|null); } - /** Represents an UpdateFeedRequest. */ - class UpdateFeedRequest implements IUpdateFeedRequest { + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { /** - * Constructs a new UpdateFeedRequest. + * Constructs a new BigQueryDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); + constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); - /** UpdateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1.IFeed|null); + /** BigQueryDestination dataset. */ + public dataset: string; - /** UpdateFeedRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination force. */ + public force: boolean; /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new BigQueryDestination instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateFeedRequest instance + * @returns BigQueryDestination instance */ - public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; + public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a BigQueryDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFeedRequest + * @returns BigQueryDestination * @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.asset.v1.UpdateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BigQueryDestination; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFeedRequest + * @returns BigQueryDestination * @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.asset.v1.UpdateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BigQueryDestination; /** - * Verifies an UpdateFeedRequest message. + * Verifies a BigQueryDestination 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFeedRequest + * @returns BigQueryDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @param message UpdateFeedRequest + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this BigQueryDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteFeedRequest. */ - interface IDeleteFeedRequest { + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { - /** DeleteFeedRequest name */ - name?: (string|null); + /** PubsubDestination topic */ + topic?: (string|null); } - /** Represents a DeleteFeedRequest. */ - class DeleteFeedRequest implements IDeleteFeedRequest { + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { /** - * Constructs a new DeleteFeedRequest. + * Constructs a new PubsubDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); + constructor(properties?: google.cloud.asset.v1.IPubsubDestination); - /** DeleteFeedRequest name. */ - public name: string; + /** PubsubDestination topic. */ + public topic: string; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteFeedRequest instance + * @returns PubsubDestination instance */ - public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; + public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteFeedRequest + * @returns PubsubDestination * @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.asset.v1.DeleteFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PubsubDestination; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteFeedRequest + * @returns PubsubDestination * @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.asset.v1.DeleteFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PubsubDestination; /** - * Verifies a DeleteFeedRequest message. + * Verifies a PubsubDestination 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 DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteFeedRequest + * @returns PubsubDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. - * @param message DeleteFeedRequest + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this PubsubDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { - /** OutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { /** - * Constructs a new OutputConfig. + * Constructs a new FeedOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IOutputConfig); - - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); - /** OutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); - /** OutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new FeedOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns FeedOutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns FeedOutputConfig * @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.asset.v1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.FeedOutputConfig; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns FeedOutputConfig * @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.asset.v1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.FeedOutputConfig; /** - * Verifies an OutputConfig message. + * Verifies a FeedOutputConfig 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns FeedOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this FeedOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of a Feed. */ + interface IFeed { - /** GcsDestination uri */ - uri?: (string|null); + /** Feed name */ + name?: (string|null); - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a Feed. */ + class Feed implements IFeed { /** - * Constructs a new GcsDestination. + * Constructs a new Feed. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGcsDestination); + constructor(properties?: google.cloud.asset.v1.IFeed); - /** GcsDestination uri. */ - public uri: string; + /** Feed name. */ + public name: string; - /** GcsDestination uriPrefix. */ - public uriPrefix: string; + /** Feed assetNames. */ + public assetNames: string[]; - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new Feed instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns Feed instance */ - public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns Feed * @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.asset.v1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Feed; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns Feed * @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.asset.v1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Feed; /** - * Verifies a GcsDestination message. + * Verifies a Feed 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns Feed */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this Feed to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** BigQueryDestination dataset */ - dataset?: (string|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); - /** BigQueryDestination table */ - table?: (string|null); + /** TemporalAsset deleted */ + deleted?: (boolean|null); - /** BigQueryDestination force */ - force?: (boolean|null); + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); } - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new BigQueryDestination. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - /** BigQueryDestination dataset. */ - public dataset: string; + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); - /** BigQueryDestination table. */ - public table: string; + /** TemporalAsset deleted. */ + public deleted: boolean; - /** BigQueryDestination force. */ - public force: boolean; + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns BigQueryDestination instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BigQueryDestination + * @returns TemporalAsset * @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.asset.v1.BigQueryDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BigQueryDestination + * @returns TemporalAsset * @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.asset.v1.BigQueryDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; /** - * Verifies a BigQueryDestination message. + * Verifies a TemporalAsset 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BigQueryDestination + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BigQueryDestination to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PubsubDestination. */ - interface IPubsubDestination { + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** PubsubDestination topic */ - topic?: (string|null); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a PubsubDestination. */ - class PubsubDestination implements IPubsubDestination { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new PubsubDestination. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IPubsubDestination); + constructor(properties?: google.cloud.asset.v1.ITimeWindow); - /** PubsubDestination topic. */ - public topic: string; + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new PubsubDestination instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns PubsubDestination instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * 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 PubsubDestination + * @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.asset.v1.PubsubDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PubsubDestination + * @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.asset.v1.PubsubDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; /** - * Verifies a PubsubDestination message. + * 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 PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PubsubDestination + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. - * @param message PubsubDestination + * 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.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PubsubDestination to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } + /** Properties of an Asset. */ + interface IAsset { - /** Properties of a FeedOutputConfig. */ - interface IFeedOutputConfig { + /** Asset name */ + name?: (string|null); - /** FeedOutputConfig pubsubDestination */ - pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); } - /** Represents a FeedOutputConfig. */ - class FeedOutputConfig implements IFeedOutputConfig { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new FeedOutputConfig. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); + constructor(properties?: google.cloud.asset.v1.IAsset); - /** FeedOutputConfig pubsubDestination. */ - public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + /** Asset name. */ + public name: string; - /** FeedOutputConfig destination. */ - public destination?: "pubsubDestination"; + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors. */ + public ancestors: string[]; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns FeedOutputConfig instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FeedOutputConfig + * @returns Asset * @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.asset.v1.FeedOutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FeedOutputConfig + * @returns Asset * @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.asset.v1.FeedOutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; /** - * Verifies a FeedOutputConfig message. + * Verifies an Asset 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 FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FeedOutputConfig + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. - * @param message FeedOutputConfig + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Feed. */ - interface IFeed { + /** Properties of a Resource. */ + interface IResource { - /** Feed name */ - name?: (string|null); + /** Resource version */ + version?: (string|null); - /** Feed assetNames */ - assetNames?: (string[]|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** Feed assetTypes */ - assetTypes?: (string[]|null); + /** Resource discoveryName */ + discoveryName?: (string|null); - /** Feed contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + /** Resource resourceUrl */ + resourceUrl?: (string|null); - /** Feed feedOutputConfig */ - feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents a Feed. */ - class Feed implements IFeed { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new Feed. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IFeed); + constructor(properties?: google.cloud.asset.v1.IResource); - /** Feed name. */ - public name: string; + /** Resource version. */ + public version: string; - /** Feed assetNames. */ - public assetNames: string[]; + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** Feed assetTypes. */ - public assetTypes: string[]; + /** Resource discoveryName. */ + public discoveryName: string; - /** Feed contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + /** Resource resourceUrl. */ + public resourceUrl: string; - /** Feed feedOutputConfig. */ - public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new Feed instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns Feed instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Feed + * @returns Resource * @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.asset.v1.Feed; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Feed + * @returns Resource * @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.asset.v1.Feed; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; /** - * Verifies a Feed message. + * Verifies a Resource 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 Feed message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Feed + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. - * @param message Feed + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Feed to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2205,1350 +2205,1128 @@ export namespace google { /** Namespace v1beta1. */ namespace v1beta1 { - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); - - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1beta1.IAsset|null); - } - - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new TemporalAsset. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1beta1.IAsset|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new TemporalAsset instance using the specified properties. - * @param [properties] Properties to set - * @returns TemporalAsset instance + * Creates new AssetService 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(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TemporalAsset; + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TemporalAsset; + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; + } + + namespace AssetService { /** - * Verifies a TemporalAsset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TemporalAsset + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; + } - /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { - /** - * Converts this TemporalAsset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ExportAssetsRequest parent */ + parent?: (string|null); - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { /** - * Constructs a new TimeWindow. + * Constructs a new ExportAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** ExportAssetsRequest parent. */ + public parent: string; - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns ExportAssetsRequest instance */ - public static create(properties?: google.cloud.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns ExportAssetsRequest * @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.asset.v1beta1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns ExportAssetsRequest * @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.asset.v1beta1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Verifies a TimeWindow message. + * Verifies an ExportAssetsRequest 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. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns ExportAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this ExportAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { - /** Asset resource */ - resource?: (google.cloud.asset.v1beta1.IResource|null); + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { /** - * Constructs a new Asset. + * Constructs a new ExportAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IAsset); - - /** Asset name. */ - public name: string; - - /** Asset assetType. */ - public assetType: string; + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); - /** Asset resource. */ - public resource?: (google.cloud.asset.v1beta1.IResource|null); + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); /** - * Creates a new Asset instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns ExportAssetsResponse instance */ - public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns ExportAssetsResponse * @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.asset.v1beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns ExportAssetsResponse * @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.asset.v1beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Verifies an Asset message. + * Verifies an ExportAssetsResponse 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns ExportAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this ExportAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); - /** Resource parent */ - parent?: (string|null); + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { /** - * Constructs a new Resource. + * Constructs a new BatchGetAssetsHistoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); - /** Resource discoveryName. */ - public discoveryName: string; + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; - /** Resource parent. */ - public parent: string; + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); /** - * Creates a new Resource instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns BatchGetAssetsHistoryRequest instance */ - public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns BatchGetAssetsHistoryRequest * @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.asset.v1beta1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns BatchGetAssetsHistoryRequest * @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.asset.v1beta1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Verifies a Resource message. + * Verifies a BatchGetAssetsHistoryRequest 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns BatchGetAssetsHistoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { - - /** - * Constructs a new AssetService 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 AssetService 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): AssetService; - - /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; - - /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise - */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; - - /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; - - /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise - */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; - } - - namespace AssetService { - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse - */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; - } - - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { - - /** ExportAssetsRequest parent */ - parent?: (string|null); - - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); - - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new BatchGetAssetsHistoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - - /** ExportAssetsRequest parent. */ - public parent: string; - - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; - - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns BatchGetAssetsHistoryResponse instance */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns BatchGetAssetsHistoryResponse * @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.asset.v1beta1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns BatchGetAssetsHistoryResponse * @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.asset.v1beta1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Verifies an ExportAssetsRequest message. + * Verifies a BatchGetAssetsHistoryResponse 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns BatchGetAssetsHistoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this BatchGetAssetsHistoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { - - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new OutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** OutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns OutputConfig instance */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns OutputConfig * @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.asset.v1beta1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.OutputConfig; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns OutputConfig * @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.asset.v1beta1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.OutputConfig; /** - * Verifies an ExportAssetsResponse message. + * Verifies an OutputConfig 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns OutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this OutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { - - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); - - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + /** GcsDestination uri */ + uri?: (string|null); - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new GcsDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); - - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; + /** GcsDestination uri. */ + public uri: string; - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + /** GcsDestination uriPrefix. */ + public uriPrefix: string; - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * @returns GcsDestination instance */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest + * @returns GcsDestination * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.GcsDestination; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest + * @returns GcsDestination * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.GcsDestination; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a GcsDestination 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this GcsDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1beta1.IAsset|null); } - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); + constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1beta1.IAsset|null); /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse + * @returns TemporalAsset * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TemporalAsset; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse + * @returns TemporalAsset * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TemporalAsset; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies a TemporalAsset 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new OutputConfig. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); + constructor(properties?: google.cloud.asset.v1beta1.ITimeWindow); - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** OutputConfig destination. */ - public destination?: "gcsDestination"; + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; + public static create(properties?: google.cloud.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * 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 OutputConfig + * @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.asset.v1beta1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TimeWindow; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @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.asset.v1beta1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TimeWindow; /** - * Verifies an OutputConfig message. + * 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 an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TimeWindow; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * 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.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of an Asset. */ + interface IAsset { - /** GcsDestination uri */ - uri?: (string|null); + /** Asset name */ + name?: (string|null); - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new GcsDestination. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); + constructor(properties?: google.cloud.asset.v1beta1.IAsset); - /** GcsDestination uri. */ - public uri: string; + /** Asset name. */ + public name: string; - /** GcsDestination uriPrefix. */ - public uriPrefix: string; + /** Asset assetType. */ + public assetType: string; - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** Asset resource. */ + public resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; + public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns Asset * @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.asset.v1beta1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Asset; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns Asset * @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.asset.v1beta1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Asset; /** - * Verifies a GcsDestination message. + * Verifies an Asset 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2 - } - } - - /** Namespace v1p1beta1. */ - namespace v1p1beta1 { - - /** Properties of a StandardResourceMetadata. */ - interface IStandardResourceMetadata { + /** Properties of a Resource. */ + interface IResource { - /** StandardResourceMetadata name */ - name?: (string|null); + /** Resource version */ + version?: (string|null); - /** StandardResourceMetadata assetType */ - assetType?: (string|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** StandardResourceMetadata project */ - project?: (string|null); + /** Resource discoveryName */ + discoveryName?: (string|null); - /** StandardResourceMetadata displayName */ - displayName?: (string|null); + /** Resource resourceUrl */ + resourceUrl?: (string|null); - /** StandardResourceMetadata description */ - description?: (string|null); + /** Resource parent */ + parent?: (string|null); - /** StandardResourceMetadata additionalAttributes */ - additionalAttributes?: (string[]|null); + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents a StandardResourceMetadata. */ - class StandardResourceMetadata implements IStandardResourceMetadata { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new StandardResourceMetadata. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata); + constructor(properties?: google.cloud.asset.v1beta1.IResource); - /** StandardResourceMetadata name. */ - public name: string; + /** Resource version. */ + public version: string; - /** StandardResourceMetadata assetType. */ - public assetType: string; + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** StandardResourceMetadata project. */ - public project: string; + /** Resource discoveryName. */ + public discoveryName: string; - /** StandardResourceMetadata displayName. */ - public displayName: string; + /** Resource resourceUrl. */ + public resourceUrl: string; - /** StandardResourceMetadata description. */ - public description: string; + /** Resource parent. */ + public parent: string; - /** StandardResourceMetadata additionalAttributes. */ - public additionalAttributes: string[]; + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new StandardResourceMetadata instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns StandardResourceMetadata instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata): google.cloud.asset.v1p1beta1.StandardResourceMetadata; + public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; /** - * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. - * @param message StandardResourceMetadata message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. - * @param message StandardResourceMetadata message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StandardResourceMetadata message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StandardResourceMetadata + * @returns Resource * @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.asset.v1p1beta1.StandardResourceMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Resource; /** - * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StandardResourceMetadata + * @returns Resource * @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.asset.v1p1beta1.StandardResourceMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Resource; /** - * Verifies a StandardResourceMetadata message. + * Verifies a Resource 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 StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StandardResourceMetadata + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.StandardResourceMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; /** - * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. - * @param message StandardResourceMetadata + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p1beta1.StandardResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StandardResourceMetadata to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an IamPolicySearchResult. */ - interface IIamPolicySearchResult { - - /** IamPolicySearchResult resource */ - resource?: (string|null); - - /** IamPolicySearchResult project */ - project?: (string|null); - - /** IamPolicySearchResult policy */ - policy?: (google.iam.v1.IPolicy|null); - } + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { - /** Represents an IamPolicySearchResult. */ - class IamPolicySearchResult implements IIamPolicySearchResult { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new IamPolicySearchResult. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult); - - /** IamPolicySearchResult resource. */ - public resource: string; - - /** IamPolicySearchResult project. */ - public project: string; - - /** IamPolicySearchResult policy. */ - public policy?: (google.iam.v1.IPolicy|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new IamPolicySearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicySearchResult instance + * Creates new AssetService 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(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult): google.cloud.asset.v1p1beta1.IamPolicySearchResult; - - /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicySearchResult - * @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.asset.v1p1beta1.IamPolicySearchResult; - - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicySearchResult - * @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.asset.v1p1beta1.IamPolicySearchResult; - - /** - * Verifies an IamPolicySearchResult 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicySearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult; - - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @param message IamPolicySearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamPolicySearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { - - /** - * Constructs a new AssetService 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 AssetService 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): AssetService; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** * Calls SearchResources. @@ -4465,442 +4243,232 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v1p2beta1. */ - namespace v1p2beta1 { + /** Properties of a StandardResourceMetadata. */ + interface IStandardResourceMetadata { - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { + /** StandardResourceMetadata name */ + name?: (string|null); - /** TemporalAsset window */ - window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + /** StandardResourceMetadata assetType */ + assetType?: (string|null); - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** StandardResourceMetadata project */ + project?: (string|null); - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + /** StandardResourceMetadata displayName */ + displayName?: (string|null); + + /** StandardResourceMetadata description */ + description?: (string|null); + + /** StandardResourceMetadata additionalAttributes */ + additionalAttributes?: (string[]|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a StandardResourceMetadata. */ + class StandardResourceMetadata implements IStandardResourceMetadata { /** - * Constructs a new TemporalAsset. + * Constructs a new StandardResourceMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); + constructor(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata); - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + /** StandardResourceMetadata name. */ + public name: string; - /** TemporalAsset deleted. */ - public deleted: boolean; + /** StandardResourceMetadata assetType. */ + public assetType: string; - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + /** StandardResourceMetadata project. */ + public project: string; + + /** StandardResourceMetadata displayName. */ + public displayName: string; + + /** StandardResourceMetadata description. */ + public description: string; + + /** StandardResourceMetadata additionalAttributes. */ + public additionalAttributes: string[]; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new StandardResourceMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns StandardResourceMetadata instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a StandardResourceMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns StandardResourceMetadata * @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.asset.v1p2beta1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns StandardResourceMetadata * @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.asset.v1p2beta1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Verifies a TemporalAsset message. + * Verifies a StandardResourceMetadata 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns StandardResourceMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. + * @param message StandardResourceMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.StandardResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this StandardResourceMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** IamPolicySearchResult resource */ + resource?: (string|null); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { /** - * Constructs a new TimeWindow. + * Constructs a new IamPolicySearchResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** IamPolicySearchResult resource. */ + public resource: string; - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new IamPolicySearchResult instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns IamPolicySearchResult instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; + public static create(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult): google.cloud.asset.v1p1beta1.IamPolicySearchResult; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an IamPolicySearchResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns IamPolicySearchResult * @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.asset.v1p2beta1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.IamPolicySearchResult; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns IamPolicySearchResult * @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.asset.v1p2beta1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.IamPolicySearchResult; /** - * Verifies a TimeWindow message. + * Verifies an IamPolicySearchResult 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. + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns IamPolicySearchResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1p2beta1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset ancestors */ - ancestors?: (string[]|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { - - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); - - /** Asset name. */ - public name: string; - - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1p2beta1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset ancestors. */ - public ancestors: string[]; - - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @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.asset.v1p2beta1.Asset; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @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.asset.v1p2beta1.Asset; - - /** - * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this IamPolicySearchResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); - - /** Resource discoveryName */ - discoveryName?: (string|null); - - /** Resource resourceUrl */ - resourceUrl?: (string|null); - - /** Resource parent */ - parent?: (string|null); - - /** Resource data */ - data?: (google.protobuf.IStruct|null); - } - - /** Represents a Resource. */ - class Resource implements IResource { - - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p2beta1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; - - /** Resource discoveryName. */ - public discoveryName: string; - - /** Resource resourceUrl. */ - public resourceUrl: string; - - /** Resource parent. */ - public parent: string; - - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); - - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Resource - * @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.asset.v1p2beta1.Resource; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Resource - * @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.asset.v1p2beta1.Resource; - - /** - * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Resource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { /** Represents an AssetService */ class AssetService extends $protobuf.rpc.Service { @@ -6078,238 +5646,444 @@ export namespace google { RESOURCE = 1, IAM_POLICY = 2 } - } - } - } - - /** Namespace api. */ - namespace api { - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** TemporalAsset deleted */ + deleted?: (boolean|null); - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + } - /** ResourceDescriptor plural */ - plural?: (string|null); + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { - /** ResourceDescriptor singular */ - singular?: (string|null); - } + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); + /** TemporalAsset deleted. */ + public deleted: boolean; - /** ResourceDescriptor type. */ - public type: string; + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; - /** ResourceDescriptor nameField. */ - public nameField: string; + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceDescriptor plural. */ - public plural: string; + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1p2beta1.TemporalAsset; - /** ResourceDescriptor singular. */ - public singular: string; + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1p2beta1.TemporalAsset; - /** - * 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; + /** + * Verifies a TemporalAsset 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); - /** - * 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; + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; - /** - * 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; + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** - * 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); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|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; + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } - /** - * 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 }; + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); - namespace ResourceDescriptor { + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; - /** ResourceReference type */ - type?: (string|null); + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceReference childType */ - childType?: (string|null); - } + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** + * 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.asset.v1p2beta1.TimeWindow; - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); + /** + * 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.asset.v1p2beta1.TimeWindow; - /** ResourceReference type. */ - public type: string; + /** + * 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); - /** ResourceReference childType. */ - public childType: string; + /** + * 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.asset.v1p2beta1.TimeWindow; - /** - * 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; + /** + * 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.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an Asset. */ + interface IAsset { - /** - * 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; + /** Asset name */ + name?: (string|null); - /** - * 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; + /** Asset assetType */ + assetType?: (string|null); - /** - * 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); + /** Asset resource */ + resource?: (google.cloud.asset.v1p2beta1.IResource|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; + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); - /** - * 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 }; + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1p2beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1p2beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1p2beta1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1p2beta1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } + } + + /** Namespace api. */ + namespace api { /** Properties of a Http. */ interface IHttp { @@ -6659,6 +6433,232 @@ export namespace google { 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. */ @@ -8518,11 +8518,11 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|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. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index f8039941e01..01e518fdca4 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -66,267 +66,295 @@ */ var v1 = {}; - v1.TemporalAsset = (function() { - - /** - * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset - */ + v1.AssetService = (function() { /** - * Constructs a new TemporalAsset. + * Constructs a new AssetService service. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents an AssetService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @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 TemporalAsset(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]]; + function AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + /** - * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. */ - TemporalAsset.prototype.window = null; + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - TemporalAsset.prototype.deleted = false; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1.AssetService * @instance + * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - TemporalAsset.prototype.asset = null; + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); /** - * Creates a new TemporalAsset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); - }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset 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.asset.v1.AssetService#batchGetAssetsHistory}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef BatchGetAssetsHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse */ - TemporalAsset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * @returns {undefined} + * @variation 1 */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { + return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse, request, callback); + }, "name", { value: "BatchGetAssetsHistory" }); /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.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.asset.v1.TemporalAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset - * @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.asset.v1.AssetService#createFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a TemporalAsset message. - * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - TemporalAsset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - return null; - }; + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1.CreateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) - return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); - } - return message; - }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed */ - TemporalAsset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; - } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); - return object; - }; /** - * Converts this TemporalAsset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1.AssetService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - TemporalAsset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1.GetFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "GetFeed" }); - return TemporalAsset; + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListFeedsResponse} [response] ListFeedsResponse + */ + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1.ListFeedsRequest, $root.google.cloud.asset.v1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1.UpdateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; })(); - v1.TimeWindow = (function() { + v1.ExportAssetsRequest = (function() { /** - * Properties of a TimeWindow. + * Properties of an ExportAssetsRequest. * @memberof google.cloud.asset.v1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig */ /** - * Constructs a new TimeWindow. + * Constructs a new ExportAssetsRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest * @constructor - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set */ - function TimeWindow(properties) { + function ExportAssetsRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -334,88 +362,130 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @instance */ - TimeWindow.prototype.startTime = null; + ExportAssetsRequest.prototype.parent = ""; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @instance */ - TimeWindow.prototype.endTime = null; + ExportAssetsRequest.prototype.readTime = null; /** - * Creates a new TimeWindow instance using the specified properties. + * ExportAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.contentType = 0; + + /** + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + ExportAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("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.asset.v1.TimeWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest * @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) { + ExportAssetsRequest.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.asset.v1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ExportAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -426,131 +496,192 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest * @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) { + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies an ExportAssetsRequest message. * @function verify - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @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) { + ExportAssetsRequest.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 (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "startTime." + error; + return "readTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); if (error) - return "endTime." + error; + return "outputConfig." + error; } return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsRequest) return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + var message = new $root.google.cloud.asset.v1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); } return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1.ExportAssetsRequest} message ExportAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + ExportAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.outputConfig = 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); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this ExportAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.ExportAssetsRequest * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + ExportAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return ExportAssetsRequest; })(); - v1.Asset = (function() { + v1.ExportAssetsResponse = (function() { /** - * Properties of an Asset. + * Properties of an ExportAssetsResponse. * @memberof google.cloud.asset.v1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [ancestors] Asset ancestors + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig */ /** - * Constructs a new Asset. + * Constructs a new ExportAssetsResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set */ - function Asset(properties) { - this.ancestors = []; + function ExportAssetsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -558,130 +689,88 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1.Asset + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @instance */ - Asset.prototype.name = ""; + ExportAssetsResponse.prototype.readTime = null; /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @instance */ - Asset.prototype.assetType = ""; + ExportAssetsResponse.prototype.outputConfig = null; /** - * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset - * @instance + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse instance */ - Asset.prototype.resource = null; + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.iamPolicy = null; - - /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.ancestors = $util.emptyArray; - - /** - * Creates a new Asset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance - */ - Asset.create = function create(properties) { - return new Asset(properties); - }; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + ExportAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + ExportAssetsResponse.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.asset.v1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -692,168 +781,130 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies an ExportAssetsResponse message. * @function verify - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + ExportAssetsResponse.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "resource." + error; + return "readTime." + error; } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); if (error) - return "iamPolicy." + error; - } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; + return "outputConfig." + error; } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsResponse) return object; - var message = new $root.google.cloud.asset.v1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + var message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); } return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1.Asset} message Asset + * @param {google.cloud.asset.v1.ExportAssetsResponse} message ExportAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + ExportAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.ancestors = []; if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; + object.readTime = null; + object.outputConfig = null; } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); return object; }; /** - * Converts this Asset to JSON. + * Converts this ExportAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.ExportAssetsResponse * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + ExportAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return ExportAssetsResponse; })(); - v1.Resource = (function() { + v1.BatchGetAssetsHistoryRequest = (function() { /** - * Properties of a Resource. + * Properties of a BatchGetAssetsHistoryRequest. * @memberof google.cloud.asset.v1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data + * @interface IBatchGetAssetsHistoryRequest + * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent + * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames + * @property {google.cloud.asset.v1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType + * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow */ /** - * Constructs a new Resource. + * Constructs a new BatchGetAssetsHistoryRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents a Resource. - * @implements IResource + * @classdesc Represents a BatchGetAssetsHistoryRequest. + * @implements IBatchGetAssetsHistoryRequest * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set */ - function Resource(properties) { + function BatchGetAssetsHistoryRequest(properties) { + this.assetNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -861,140 +912,117 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1.Resource + * BatchGetAssetsHistoryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @instance */ - Resource.prototype.version = ""; + BatchGetAssetsHistoryRequest.prototype.parent = ""; /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource + * BatchGetAssetsHistoryRequest assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @instance */ - Resource.prototype.discoveryDocumentUri = ""; + BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource + * BatchGetAssetsHistoryRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @instance */ - Resource.prototype.discoveryName = ""; + BatchGetAssetsHistoryRequest.prototype.contentType = 0; /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource + * BatchGetAssetsHistoryRequest readTimeWindow. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @instance */ - Resource.prototype.resourceUrl = ""; + BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.parent = ""; - - /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.data = null; - - /** - * Creates a new Resource instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance */ - Resource.create = function create(properties) { - return new Resource(properties); + BatchGetAssetsHistoryRequest.create = function create(properties) { + return new BatchGetAssetsHistoryRequest(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + BatchGetAssetsHistoryRequest.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.asset.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + message.parent = reader.string(); break; case 2: - message.discoveryDocumentUri = reader.string(); + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); break; case 3: - message.discoveryName = reader.string(); + message.contentType = reader.int32(); break; case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1005,424 +1033,623 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a BatchGetAssetsHistoryRequest message. * @function verify - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + BatchGetAssetsHistoryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.readTimeWindow); if (error) - return "data." + error; + return "readTimeWindow." + error; } return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) + BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) return object; - var message = new $root.google.cloud.asset.v1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); + var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); } return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1.Resource} message Resource + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetNames = []; if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; object.parent = ""; - object.data = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.readTimeWindow = null; } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return BatchGetAssetsHistoryRequest; })(); - v1.AssetService = (function() { + v1.BatchGetAssetsHistoryResponse = (function() { /** - * Constructs a new AssetService service. + * Properties of a BatchGetAssetsHistoryResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents an AssetService - * @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 + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets */ - function AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; /** - * Creates new AssetService service using the specified rpc implementation. + * Constructs a new BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse + * @constructor + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + */ + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @instance + */ + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.AssetService + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef ExportAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { - return this.rpcCall(exportAssets, $root.google.cloud.asset.v1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportAssets" }); + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + BatchGetAssetsHistoryResponse.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.asset.v1.BatchGetAssetsHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.TemporalAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef BatchGetAssetsHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - * @returns {undefined} - * @variation 1 + * Verifies a BatchGetAssetsHistoryResponse message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { - return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse, request, callback); - }, "name", { value: "BatchGetAssetsHistory" }); + BatchGetAssetsHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse */ + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.TemporalAsset.fromObject(object.assets[i]); + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef CreateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1.Feed} [response] Feed + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.TemporalAsset.toObject(message.assets[j], options); + } + return object; + }; /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1.AssetService + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse * @instance - * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { - return this.rpcCall(createFeed, $root.google.cloud.asset.v1.CreateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); - }, "name", { value: "CreateFeed" }); + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetAssetsHistoryResponse; + })(); + + v1.CreateFeedRequest = (function() { /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1.IFeed|null} [feed] CreateFeedRequest feed */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef GetFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1.Feed} [response] Feed + * Constructs a new CreateFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest + * @constructor + * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set */ + function CreateFeedRequest(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]]; + } /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1.AssetService + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.CreateFeedRequest * @instance - * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { - return this.rpcCall(getFeed, $root.google.cloud.asset.v1.GetFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); - }, "name", { value: "GetFeed" }); + CreateFeedRequest.prototype.parent = ""; /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1.AssetService + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1.CreateFeedRequest * @instance - * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateFeedRequest.prototype.feedId = ""; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef ListFeedsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1.ListFeedsResponse} [response] ListFeedsResponse + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @instance */ + CreateFeedRequest.prototype.feed = null; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse - * @returns {undefined} - * @variation 1 + * Creates a new CreateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest instance */ - Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { - return this.rpcCall(listFeeds, $root.google.cloud.asset.v1.ListFeedsRequest, $root.google.cloud.asset.v1.ListFeedsResponse, request, callback); - }, "name", { value: "ListFeeds" }); + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && message.hasOwnProperty("feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef UpdateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1.Feed} [response] Feed + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { - return this.rpcCall(updateFeed, $root.google.cloud.asset.v1.UpdateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); - }, "name", { value: "UpdateFeed" }); + CreateFeedRequest.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.asset.v1.CreateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef DeleteFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Verifies a CreateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateFeedRequest.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.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + return null; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest */ - Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { - return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteFeed" }); + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.CreateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); + } + return message; + }; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.CreateFeedRequest} message CreateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + return object; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1.AssetService + * Converts this CreateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.CreateFeedRequest * @instance - * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AssetService; + return CreateFeedRequest; })(); - v1.ExportAssetsRequest = (function() { + v1.GetFeedRequest = (function() { /** - * Properties of an ExportAssetsRequest. + * Properties of a GetFeedRequest. * @memberof google.cloud.asset.v1 - * @interface IExportAssetsRequest - * @property {string|null} [parent] ExportAssetsRequest parent - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime - * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes - * @property {google.cloud.asset.v1.ContentType|null} [contentType] ExportAssetsRequest contentType - * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name */ /** - * Constructs a new ExportAssetsRequest. + * Constructs a new GetFeedRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents an ExportAssetsRequest. - * @implements IExportAssetsRequest + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest * @constructor - * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set */ - function ExportAssetsRequest(properties) { - this.assetTypes = []; + function GetFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1430,130 +1657,75 @@ } /** - * ExportAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.parent = ""; - - /** - * ExportAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.readTime = null; - - /** - * ExportAssetsRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; - - /** - * ExportAssetsRequest contentType. - * @member {google.cloud.asset.v1.ContentType} contentType - * @memberof google.cloud.asset.v1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.contentType = 0; - - /** - * ExportAssetsRequest outputConfig. - * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.GetFeedRequest * @instance */ - ExportAssetsRequest.prototype.outputConfig = null; + GetFeedRequest.prototype.name = ""; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static - * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest instance + * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest instance */ - ExportAssetsRequest.create = function create(properties) { - return new ExportAssetsRequest(properties); + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); }; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static - * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encode = function encode(message, writer) { + GetFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static - * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decode = function decode(reader, length) { + GetFeedRequest.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.asset.v1.ExportAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.GetFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -1564,192 +1736,107 @@ }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsRequest message. + * Verifies a GetFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsRequest.verify = function verify(message) { + GetFeedRequest.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.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 5: - break; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ExportAssetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest - */ - ExportAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ExportAssetsRequest) - return object; - var message = new $root.google.cloud.asset.v1.ExportAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); - } + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + */ + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GetFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @static - * @param {google.cloud.asset.v1.ExportAssetsRequest} message ExportAssetsRequest + * @param {google.cloud.asset.v1.GetFeedRequest} message GetFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsRequest.toObject = function toObject(message, options) { + GetFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; - if (options.defaults) { - object.parent = ""; - object.readTime = null; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.outputConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this GetFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @memberof google.cloud.asset.v1.GetFeedRequest * @instance * @returns {Object.} JSON object */ - ExportAssetsRequest.prototype.toJSON = function toJSON() { + GetFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsRequest; + return GetFeedRequest; })(); - v1.ExportAssetsResponse = (function() { + v1.ListFeedsRequest = (function() { /** - * Properties of an ExportAssetsResponse. + * Properties of a ListFeedsRequest. * @memberof google.cloud.asset.v1 - * @interface IExportAssetsResponse - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime - * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent */ /** - * Constructs a new ExportAssetsResponse. + * Constructs a new ListFeedsRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents an ExportAssetsResponse. - * @implements IExportAssetsResponse + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest * @constructor - * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set */ - function ExportAssetsResponse(properties) { + function ListFeedsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1757,88 +1844,75 @@ } /** - * ExportAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1.ExportAssetsResponse - * @instance - */ - ExportAssetsResponse.prototype.readTime = null; - - /** - * ExportAssetsResponse outputConfig. - * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListFeedsRequest * @instance */ - ExportAssetsResponse.prototype.outputConfig = null; + ListFeedsRequest.prototype.parent = ""; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse instance + * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest instance */ - ExportAssetsResponse.create = function create(properties) { - return new ExportAssetsResponse(properties); + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); }; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encode = function encode(message, writer) { + ListFeedsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decode = function decode(reader, length) { + ListFeedsRequest.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.asset.v1.ExportAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListFeedsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + message.parent = reader.string(); break; default: reader.skipType(tag & 7); @@ -1849,248 +1923,187 @@ }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsResponse message. + * Verifies a ListFeedsRequest message. * @function verify - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsResponse.verify = function verify(message) { + ListFeedsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; return null; }; /** - * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest */ - ExportAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ExportAssetsResponse) + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListFeedsRequest) return object; - var message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); - } + var message = new $root.google.cloud.asset.v1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); return message; }; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1.ExportAssetsResponse} message ExportAssetsResponse + * @param {google.cloud.asset.v1.ListFeedsRequest} message ListFeedsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsResponse.toObject = function toObject(message, options) { + ListFeedsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.readTime = null; - object.outputConfig = null; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this ListFeedsRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListFeedsRequest * @instance * @returns {Object.} JSON object */ - ExportAssetsResponse.prototype.toJSON = function toJSON() { + ListFeedsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsResponse; + return ListFeedsRequest; })(); - v1.BatchGetAssetsHistoryRequest = (function() { - - /** - * Properties of a BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1 - * @interface IBatchGetAssetsHistoryRequest - * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent - * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames - * @property {google.cloud.asset.v1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType - * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow - */ - - /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a BatchGetAssetsHistoryRequest. - * @implements IBatchGetAssetsHistoryRequest - * @constructor - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - */ - function BatchGetAssetsHistoryRequest(properties) { - this.assetNames = []; - 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]]; - } - - /** - * BatchGetAssetsHistoryRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.parent = ""; + v1.ListFeedsResponse = (function() { /** - * BatchGetAssetsHistoryRequest assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest - * @instance + * Properties of a ListFeedsResponse. + * @memberof google.cloud.asset.v1 + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds */ - BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; /** - * BatchGetAssetsHistoryRequest contentType. - * @member {google.cloud.asset.v1.ContentType} contentType - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest - * @instance + * Constructs a new ListFeedsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse + * @constructor + * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set */ - BatchGetAssetsHistoryRequest.prototype.contentType = 0; + function ListFeedsResponse(properties) { + this.feeds = []; + 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]]; + } /** - * BatchGetAssetsHistoryRequest readTimeWindow. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} readTimeWindow - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1.ListFeedsResponse * @instance */ - BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + ListFeedsResponse.prototype.feeds = $util.emptyArray; /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse instance */ - BatchGetAssetsHistoryRequest.create = function create(properties) { - return new BatchGetAssetsHistoryRequest(properties); + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + ListFeedsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decode = function decode(reader, length) { + ListFeedsResponse.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.asset.v1.BatchGetAssetsHistoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListFeedsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - message.contentType = reader.int32(); - break; - case 4: - message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2101,179 +2114,125 @@ }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a ListFeedsResponse message. * @function verify - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryRequest.verify = function verify(message) { + ListFeedsResponse.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 5: - break; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; } - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.readTimeWindow); - if (error) - return "readTimeWindow." + error; } return null; }; /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse */ - BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListFeedsResponse) return object; - var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.readTimeWindow != null) { - if (typeof object.readTimeWindow !== "object") - throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); - message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); + var message = new $root.google.cloud.asset.v1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1.Feed.fromObject(object.feeds[i]); + } } return message; }; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {google.cloud.asset.v1.ListFeedsResponse} message ListFeedsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + ListFeedsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.assetNames = []; - if (options.defaults) { - object.parent = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.readTimeWindow = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1.Feed.toObject(message.feeds[j], options); } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); return object; }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this ListFeedsResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1.ListFeedsResponse * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + ListFeedsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryRequest; + return ListFeedsResponse; })(); - v1.BatchGetAssetsHistoryResponse = (function() { + v1.UpdateFeedRequest = (function() { /** - * Properties of a BatchGetAssetsHistoryResponse. + * Properties of an UpdateFeedRequest. * @memberof google.cloud.asset.v1 - * @interface IBatchGetAssetsHistoryResponse - * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask */ /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Constructs a new UpdateFeedRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents a BatchGetAssetsHistoryResponse. - * @implements IBatchGetAssetsHistoryResponse + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest * @constructor - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set */ - function BatchGetAssetsHistoryResponse(properties) { - this.assets = []; + function UpdateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2281,78 +2240,88 @@ } /** - * BatchGetAssetsHistoryResponse assets. - * @member {Array.} assets - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.feed = null; + + /** + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @instance */ - BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + UpdateFeedRequest.prototype.updateMask = null; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest instance */ - BatchGetAssetsHistoryResponse.create = function create(properties) { - return new BatchGetAssetsHistoryResponse(properties); + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + UpdateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.assets != null && message.assets.length) - for (var i = 0; i < message.assets.length; ++i) - $root.google.cloud.asset.v1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decode = function decode(reader, length) { + UpdateFeedRequest.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.asset.v1.BatchGetAssetsHistoryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.UpdateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1.TemporalAsset.decode(reader, reader.uint32())); + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2363,126 +2332,126 @@ }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies an UpdateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryResponse.verify = function verify(message) { + UpdateFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.assets != null && message.hasOwnProperty("assets")) { - if (!Array.isArray(message.assets)) - return "assets: array expected"; - for (var i = 0; i < message.assets.length; ++i) { - var error = $root.google.cloud.asset.v1.TemporalAsset.verify(message.assets[i]); - if (error) - return "assets." + error; - } + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); + if (error) + return "feed." + 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 a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest */ - BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse) + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.UpdateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse(); - if (object.assets) { - if (!Array.isArray(object.assets)) - throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: array expected"); - message.assets = []; - for (var i = 0; i < object.assets.length; ++i) { - if (typeof object.assets[i] !== "object") - throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: object expected"); - message.assets[i] = $root.google.cloud.asset.v1.TemporalAsset.fromObject(object.assets[i]); - } + var message = new $root.google.cloud.asset.v1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {google.cloud.asset.v1.UpdateFeedRequest} message UpdateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + UpdateFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assets = []; - if (message.assets && message.assets.length) { - object.assets = []; - for (var j = 0; j < message.assets.length; ++j) - object.assets[j] = $root.google.cloud.asset.v1.TemporalAsset.toObject(message.assets[j], options); + if (options.defaults) { + object.feed = null; + object.updateMask = null; } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this UpdateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1.UpdateFeedRequest * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + UpdateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryResponse; + return UpdateFeedRequest; })(); - v1.CreateFeedRequest = (function() { + v1.DeleteFeedRequest = (function() { /** - * Properties of a CreateFeedRequest. + * Properties of a DeleteFeedRequest. * @memberof google.cloud.asset.v1 - * @interface ICreateFeedRequest - * @property {string|null} [parent] CreateFeedRequest parent - * @property {string|null} [feedId] CreateFeedRequest feedId - * @property {google.cloud.asset.v1.IFeed|null} [feed] CreateFeedRequest feed + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name */ /** - * Constructs a new CreateFeedRequest. + * Constructs a new DeleteFeedRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents a CreateFeedRequest. - * @implements ICreateFeedRequest + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest * @constructor - * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set */ - function CreateFeedRequest(properties) { + function DeleteFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2490,101 +2459,75 @@ } /** - * CreateFeedRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.CreateFeedRequest - * @instance - */ - CreateFeedRequest.prototype.parent = ""; - - /** - * CreateFeedRequest feedId. - * @member {string} feedId - * @memberof google.cloud.asset.v1.CreateFeedRequest - * @instance - */ - CreateFeedRequest.prototype.feedId = ""; - - /** - * CreateFeedRequest feed. - * @member {google.cloud.asset.v1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1.CreateFeedRequest + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @instance */ - CreateFeedRequest.prototype.feed = null; + DeleteFeedRequest.prototype.name = ""; /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest instance */ - CreateFeedRequest.create = function create(properties) { - return new CreateFeedRequest(properties); + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); }; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encode = function encode(message, writer) { + DeleteFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.feedId != null && message.hasOwnProperty("feedId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decode = function decode(reader, length) { + DeleteFeedRequest.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.asset.v1.CreateFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.DeleteFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.feedId = reader.string(); - break; - case 3: - message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -2595,129 +2538,108 @@ }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFeedRequest message. + * Verifies a DeleteFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFeedRequest.verify = function verify(message) { + DeleteFeedRequest.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.feedId != null && message.hasOwnProperty("feedId")) - if (!$util.isString(message.feedId)) - return "feedId: string expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); - if (error) - return "feed." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest */ - CreateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.CreateFeedRequest) + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.DeleteFeedRequest) return object; - var message = new $root.google.cloud.asset.v1.CreateFeedRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.feedId != null) - message.feedId = String(object.feedId); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1.CreateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); - } + var message = new $root.google.cloud.asset.v1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1.CreateFeedRequest} message CreateFeedRequest + * @param {google.cloud.asset.v1.DeleteFeedRequest} message DeleteFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFeedRequest.toObject = function toObject(message, options) { + DeleteFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.feedId = ""; - object.feed = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.feedId != null && message.hasOwnProperty("feedId")) - object.feedId = message.feedId; - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this DeleteFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.CreateFeedRequest + * @memberof google.cloud.asset.v1.DeleteFeedRequest * @instance * @returns {Object.} JSON object */ - CreateFeedRequest.prototype.toJSON = function toJSON() { + DeleteFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFeedRequest; + return DeleteFeedRequest; })(); - v1.GetFeedRequest = (function() { + v1.OutputConfig = (function() { /** - * Properties of a GetFeedRequest. + * Properties of an OutputConfig. * @memberof google.cloud.asset.v1 - * @interface IGetFeedRequest - * @property {string|null} [name] GetFeedRequest name + * @interface IOutputConfig + * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.asset.v1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination */ /** - * Constructs a new GetFeedRequest. + * Constructs a new OutputConfig. * @memberof google.cloud.asset.v1 - * @classdesc Represents a GetFeedRequest. - * @implements IGetFeedRequest + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig * @constructor - * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set */ - function GetFeedRequest(properties) { + function OutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2725,75 +2647,102 @@ } /** - * GetFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1.GetFeedRequest + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.OutputConfig * @instance */ - GetFeedRequest.prototype.name = ""; + OutputConfig.prototype.gcsDestination = null; /** - * Creates a new GetFeedRequest instance using the specified properties. + * OutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static - * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest instance + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig instance */ - GetFeedRequest.create = function create(properties) { - return new GetFeedRequest(properties); + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); }; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static - * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encode = function encode(message, writer) { + OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static - * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decode = function decode(reader, length) { + OutputConfig.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.asset.v1.GetFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.OutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2804,107 +2753,138 @@ }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + OutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetFeedRequest message. + * Verifies an OutputConfig message. * @function verify - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetFeedRequest.verify = function verify(message) { + OutputConfig.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"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } return null; }; /** - * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig */ - GetFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.GetFeedRequest) + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputConfig) return object; - var message = new $root.google.cloud.asset.v1.GetFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.fromObject(object.bigqueryDestination); + } return message; }; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @static - * @param {google.cloud.asset.v1.GetFeedRequest} message GetFeedRequest + * @param {google.cloud.asset.v1.OutputConfig} message OutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFeedRequest.toObject = function toObject(message, options) { + OutputConfig.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; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } return object; }; /** - * Converts this GetFeedRequest to JSON. + * Converts this OutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.GetFeedRequest + * @memberof google.cloud.asset.v1.OutputConfig * @instance * @returns {Object.} JSON object */ - GetFeedRequest.prototype.toJSON = function toJSON() { + OutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetFeedRequest; + return OutputConfig; })(); - v1.ListFeedsRequest = (function() { + v1.GcsDestination = (function() { /** - * Properties of a ListFeedsRequest. + * Properties of a GcsDestination. * @memberof google.cloud.asset.v1 - * @interface IListFeedsRequest - * @property {string|null} [parent] ListFeedsRequest parent + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix */ /** - * Constructs a new ListFeedsRequest. + * Constructs a new GcsDestination. * @memberof google.cloud.asset.v1 - * @classdesc Represents a ListFeedsRequest. - * @implements IListFeedsRequest + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination * @constructor - * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set */ - function ListFeedsRequest(properties) { + function GcsDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2912,75 +2892,102 @@ } /** - * ListFeedsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.ListFeedsRequest + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1.GcsDestination * @instance */ - ListFeedsRequest.prototype.parent = ""; + GcsDestination.prototype.uri = ""; /** - * Creates a new ListFeedsRequest instance using the specified properties. + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|"uriPrefix"|undefined} objectUri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static - * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest instance + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination instance */ - ListFeedsRequest.create = function create(properties) { - return new ListFeedsRequest(properties); + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); }; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static - * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encode = function encode(message, writer) { + GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static - * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decode = function decode(reader, length) { + GcsDestination.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.asset.v1.ListFeedsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.GcsDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.uri = reader.string(); + break; + case 2: + message.uriPrefix = reader.string(); break; default: reader.skipType(tag & 7); @@ -2991,108 +2998,127 @@ }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + GcsDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsRequest message. + * Verifies a GcsDestination message. * @function verify - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsRequest.verify = function verify(message) { + GcsDestination.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"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } return null; }; /** - * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination */ - ListFeedsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ListFeedsRequest) + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsDestination) return object; - var message = new $root.google.cloud.asset.v1.ListFeedsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.asset.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); return message; }; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @static - * @param {google.cloud.asset.v1.ListFeedsRequest} message ListFeedsRequest + * @param {google.cloud.asset.v1.GcsDestination} message GcsDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsRequest.toObject = function toObject(message, options) { + GcsDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } return object; }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this GcsDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.ListFeedsRequest + * @memberof google.cloud.asset.v1.GcsDestination * @instance * @returns {Object.} JSON object */ - ListFeedsRequest.prototype.toJSON = function toJSON() { + GcsDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsRequest; + return GcsDestination; })(); - v1.ListFeedsResponse = (function() { + v1.BigQueryDestination = (function() { /** - * Properties of a ListFeedsResponse. + * Properties of a BigQueryDestination. * @memberof google.cloud.asset.v1 - * @interface IListFeedsResponse - * @property {Array.|null} [feeds] ListFeedsResponse feeds + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {boolean|null} [force] BigQueryDestination force */ /** - * Constructs a new ListFeedsResponse. + * Constructs a new BigQueryDestination. * @memberof google.cloud.asset.v1 - * @classdesc Represents a ListFeedsResponse. - * @implements IListFeedsResponse + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination * @constructor - * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set */ - function ListFeedsResponse(properties) { - this.feeds = []; + function BigQueryDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3100,78 +3126,101 @@ } /** - * ListFeedsResponse feeds. - * @member {Array.} feeds - * @memberof google.cloud.asset.v1.ListFeedsResponse + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.BigQueryDestination * @instance */ - ListFeedsResponse.prototype.feeds = $util.emptyArray; + BigQueryDestination.prototype.dataset = ""; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; + + /** + * BigQueryDestination force. + * @member {boolean} force + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.force = false; + + /** + * Creates a new BigQueryDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse instance + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination instance */ - ListFeedsResponse.create = function create(properties) { - return new ListFeedsResponse(properties); + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); }; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encode = function encode(message, writer) { + BigQueryDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feeds != null && message.feeds.length) - for (var i = 0; i < message.feeds.length; ++i) - $root.google.cloud.asset.v1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataset != null && message.hasOwnProperty("dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && message.hasOwnProperty("table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.force != null && message.hasOwnProperty("force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a BigQueryDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decode = function decode(reader, length) { + BigQueryDestination.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.asset.v1.ListFeedsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BigQueryDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32())); + message.dataset = reader.string(); + break; + case 2: + message.table = reader.string(); + break; + case 3: + message.force = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3182,125 +3231,124 @@ }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsResponse message. + * Verifies a BigQueryDestination message. * @function verify - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsResponse.verify = function verify(message) { + BigQueryDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.feeds != null && message.hasOwnProperty("feeds")) { - if (!Array.isArray(message.feeds)) - return "feeds: array expected"; - for (var i = 0; i < message.feeds.length; ++i) { - var error = $root.google.cloud.asset.v1.Feed.verify(message.feeds[i]); - if (error) - return "feeds." + error; - } - } + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination */ - ListFeedsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ListFeedsResponse) + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BigQueryDestination) return object; - var message = new $root.google.cloud.asset.v1.ListFeedsResponse(); - if (object.feeds) { - if (!Array.isArray(object.feeds)) - throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: array expected"); - message.feeds = []; - for (var i = 0; i < object.feeds.length; ++i) { - if (typeof object.feeds[i] !== "object") - throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: object expected"); - message.feeds[i] = $root.google.cloud.asset.v1.Feed.fromObject(object.feeds[i]); - } - } + var message = new $root.google.cloud.asset.v1.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @static - * @param {google.cloud.asset.v1.ListFeedsResponse} message ListFeedsResponse + * @param {google.cloud.asset.v1.BigQueryDestination} message BigQueryDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsResponse.toObject = function toObject(message, options) { + BigQueryDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.feeds = []; - if (message.feeds && message.feeds.length) { - object.feeds = []; - for (var j = 0; j < message.feeds.length; ++j) - object.feeds[j] = $root.google.cloud.asset.v1.Feed.toObject(message.feeds[j], options); + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.force = false; } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this BigQueryDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.ListFeedsResponse + * @memberof google.cloud.asset.v1.BigQueryDestination * @instance * @returns {Object.} JSON object */ - ListFeedsResponse.prototype.toJSON = function toJSON() { + BigQueryDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsResponse; + return BigQueryDestination; })(); - v1.UpdateFeedRequest = (function() { + v1.PubsubDestination = (function() { /** - * Properties of an UpdateFeedRequest. + * Properties of a PubsubDestination. * @memberof google.cloud.asset.v1 - * @interface IUpdateFeedRequest - * @property {google.cloud.asset.v1.IFeed|null} [feed] UpdateFeedRequest feed - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic */ /** - * Constructs a new UpdateFeedRequest. + * Constructs a new PubsubDestination. * @memberof google.cloud.asset.v1 - * @classdesc Represents an UpdateFeedRequest. - * @implements IUpdateFeedRequest + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination * @constructor - * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set */ - function UpdateFeedRequest(properties) { + function PubsubDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3308,88 +3356,75 @@ } /** - * UpdateFeedRequest feed. - * @member {google.cloud.asset.v1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1.UpdateFeedRequest - * @instance - */ - UpdateFeedRequest.prototype.feed = null; - - /** - * UpdateFeedRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1.PubsubDestination * @instance */ - UpdateFeedRequest.prototype.updateMask = null; + PubsubDestination.prototype.topic = ""; /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static - * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest instance + * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination instance */ - UpdateFeedRequest.create = function create(properties) { - return new UpdateFeedRequest(properties); + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); }; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static - * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFeedRequest.encode = function encode(message, writer) { + PubsubDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); return writer; }; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static - * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFeedRequest.decode = function decode(reader, length) { + PubsubDestination.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.asset.v1.UpdateFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.PubsubDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.topic = reader.string(); break; default: reader.skipType(tag & 7); @@ -3400,126 +3435,127 @@ }; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateFeedRequest message. + * Verifies a PubsubDestination message. * @function verify - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateFeedRequest.verify = function verify(message) { + PubsubDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); - if (error) - return "feed." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; return null; }; /** - * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest - */ - UpdateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.UpdateFeedRequest) - return object; - var message = new $root.google.cloud.asset.v1.UpdateFeedRequest(); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + */ + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.PubsubDestination) + return object; + var message = new $root.google.cloud.asset.v1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); return message; }; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @static - * @param {google.cloud.asset.v1.UpdateFeedRequest} message UpdateFeedRequest + * @param {google.cloud.asset.v1.PubsubDestination} message PubsubDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFeedRequest.toObject = function toObject(message, options) { + PubsubDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.feed = null; - object.updateMask = null; - } - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; return object; }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this PubsubDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @memberof google.cloud.asset.v1.PubsubDestination * @instance * @returns {Object.} JSON object */ - UpdateFeedRequest.prototype.toJSON = function toJSON() { + PubsubDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateFeedRequest; + return PubsubDestination; })(); - v1.DeleteFeedRequest = (function() { + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.FeedOutputConfig = (function() { /** - * Properties of a DeleteFeedRequest. + * Properties of a FeedOutputConfig. * @memberof google.cloud.asset.v1 - * @interface IDeleteFeedRequest - * @property {string|null} [name] DeleteFeedRequest name + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination */ /** - * Constructs a new DeleteFeedRequest. + * Constructs a new FeedOutputConfig. * @memberof google.cloud.asset.v1 - * @classdesc Represents a DeleteFeedRequest. - * @implements IDeleteFeedRequest + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig * @constructor - * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set */ - function DeleteFeedRequest(properties) { + function FeedOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3527,75 +3563,89 @@ } /** - * DeleteFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig * @instance */ - DeleteFeedRequest.prototype.name = ""; + FeedOutputConfig.prototype.pubsubDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @instance + */ + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeedOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest instance + * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig instance */ - DeleteFeedRequest.create = function create(properties) { - return new DeleteFeedRequest(properties); + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); }; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encode = function encode(message, writer) { + FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + $root.google.cloud.asset.v1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decode = function decode(reader, length) { + FeedOutputConfig.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.asset.v1.DeleteFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.FeedOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3606,108 +3656,123 @@ }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteFeedRequest message. + * Verifies a FeedOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteFeedRequest.verify = function verify(message) { + FeedOutputConfig.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"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } + } return null; }; /** - * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig */ - DeleteFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.DeleteFeedRequest) + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.FeedOutputConfig) return object; - var message = new $root.google.cloud.asset.v1.DeleteFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.fromObject(object.pubsubDestination); + } return message; }; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1.DeleteFeedRequest} message DeleteFeedRequest + * @param {google.cloud.asset.v1.FeedOutputConfig} message FeedOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFeedRequest.toObject = function toObject(message, options) { + FeedOutputConfig.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; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; + } return object; }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this FeedOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @memberof google.cloud.asset.v1.FeedOutputConfig * @instance * @returns {Object.} JSON object */ - DeleteFeedRequest.prototype.toJSON = function toJSON() { + FeedOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteFeedRequest; + return FeedOutputConfig; })(); - v1.OutputConfig = (function() { + v1.Feed = (function() { /** - * Properties of an OutputConfig. + * Properties of a Feed. * @memberof google.cloud.asset.v1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination - * @property {google.cloud.asset.v1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig */ /** - * Constructs a new OutputConfig. + * Constructs a new Feed. * @memberof google.cloud.asset.v1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a Feed. + * @implements IFeed * @constructor - * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set */ - function OutputConfig(properties) { + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3715,102 +3780,133 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1.OutputConfig + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.name = ""; + + /** + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.assetNames = $util.emptyArray; + + /** + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.Feed * @instance */ - OutputConfig.prototype.gcsDestination = null; + Feed.prototype.assetTypes = $util.emptyArray; /** - * OutputConfig bigqueryDestination. - * @member {google.cloud.asset.v1.IBigQueryDestination|null|undefined} bigqueryDestination - * @memberof google.cloud.asset.v1.OutputConfig + * Feed contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.Feed * @instance */ - OutputConfig.prototype.bigqueryDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Feed.prototype.contentType = 0; /** - * OutputConfig destination. - * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination - * @memberof google.cloud.asset.v1.OutputConfig + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1.Feed * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + Feed.prototype.feedOutputConfig = null; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new Feed instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig instance + * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Feed} Feed instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + Feed.create = function create(properties) { + return new Feed(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) - $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + Feed.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + Feed.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.asset.v1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Feed(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3821,138 +3917,201 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + Feed.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a Feed message. * @function verify - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + Feed.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - if (properties.destination === 1) - return "destination: multiple values"; - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.BigQueryDestination.verify(message.bigqueryDestination); - if (error) - return "bigqueryDestination." + error; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1.FeedOutputConfig.verify(message.feedOutputConfig); + if (error) + return "feedOutputConfig." + error; } return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1.Feed} Feed */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.OutputConfig) + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Feed) return object; - var message = new $root.google.cloud.asset.v1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); + var message = new $root.google.cloud.asset.v1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); } - if (object.bigqueryDestination != null) { - if (typeof object.bigqueryDestination !== "object") - throw TypeError(".google.cloud.asset.v1.OutputConfig.bigqueryDestination: object expected"); - message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.fromObject(object.bigqueryDestination); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.fromObject(object.feedOutputConfig); } return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a Feed message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @static - * @param {google.cloud.asset.v1.OutputConfig} message OutputConfig + * @param {google.cloud.asset.v1.Feed} message Feed * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + Feed.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - object.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.toObject(message.bigqueryDestination, options); - if (options.oneofs) - object.destination = "bigqueryDestination"; + if (options.defaults) { + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this Feed to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.OutputConfig + * @memberof google.cloud.asset.v1.Feed * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + Feed.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return Feed; })(); - v1.GcsDestination = (function() { + v1.TemporalAsset = (function() { /** - * Properties of a GcsDestination. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - * @property {string|null} [uriPrefix] GcsDestination uriPrefix + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset */ /** - * Constructs a new GcsDestination. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set */ - function GcsDestination(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3960,102 +4119,101 @@ } /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1.GcsDestination + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - GcsDestination.prototype.uri = ""; + TemporalAsset.prototype.window = null; /** - * GcsDestination uriPrefix. - * @member {string} uriPrefix - * @memberof google.cloud.asset.v1.GcsDestination + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - GcsDestination.prototype.uriPrefix = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + TemporalAsset.prototype.deleted = false; /** - * GcsDestination objectUri. - * @member {"uri"|"uriPrefix"|undefined} objectUri - * @memberof google.cloud.asset.v1.GcsDestination + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + TemporalAsset.prototype.asset = null; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination instance + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decode = function decode(reader, length) { + TemporalAsset.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.asset.v1.GcsDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); break; case 2: - message.uriPrefix = reader.string(); + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4066,127 +4224,135 @@ }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsDestination message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsDestination.verify = function verify(message) { + TemporalAsset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - if (properties.objectUri === 1) - return "objectUri: multiple values"; - properties.objectUri = 1; - if (!$util.isString(message.uriPrefix)) - return "uriPrefix: string expected"; + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; } return null; }; /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.GcsDestination) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.uriPrefix != null) - message.uriPrefix = String(object.uriPrefix); + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } return message; }; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.GcsDestination} message GcsDestination + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsDestination.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - object.uriPrefix = message.uriPrefix; - if (options.oneofs) - object.objectUri = "uriPrefix"; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this GcsDestination to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.GcsDestination + * @memberof google.cloud.asset.v1.TemporalAsset * @instance * @returns {Object.} JSON object */ - GcsDestination.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsDestination; + return TemporalAsset; })(); - v1.BigQueryDestination = (function() { + v1.TimeWindow = (function() { /** - * Properties of a BigQueryDestination. + * Properties of a TimeWindow. * @memberof google.cloud.asset.v1 - * @interface IBigQueryDestination - * @property {string|null} [dataset] BigQueryDestination dataset - * @property {string|null} [table] BigQueryDestination table - * @property {boolean|null} [force] BigQueryDestination force + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime */ /** - * Constructs a new BigQueryDestination. + * Constructs a new TimeWindow. * @memberof google.cloud.asset.v1 - * @classdesc Represents a BigQueryDestination. - * @implements IBigQueryDestination + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set */ - function BigQueryDestination(properties) { + function TimeWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4194,101 +4360,88 @@ } /** - * BigQueryDestination dataset. - * @member {string} dataset - * @memberof google.cloud.asset.v1.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.dataset = ""; - - /** - * BigQueryDestination table. - * @member {string} table - * @memberof google.cloud.asset.v1.BigQueryDestination + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1.TimeWindow * @instance */ - BigQueryDestination.prototype.table = ""; + TimeWindow.prototype.startTime = null; /** - * BigQueryDestination force. - * @member {boolean} force - * @memberof google.cloud.asset.v1.BigQueryDestination + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow * @instance */ - BigQueryDestination.prototype.force = false; + TimeWindow.prototype.endTime = null; /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static - * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination instance + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance */ - BigQueryDestination.create = function create(properties) { - return new BigQueryDestination(properties); + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); }; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static - * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encode = function encode(message, writer) { + TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && message.hasOwnProperty("dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.table != null && message.hasOwnProperty("table")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); - if (message.force != null && message.hasOwnProperty("force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static - * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.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.asset.v1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decode = function decode(reader, length) { + 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.asset.v1.BigQueryDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataset = reader.string(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.table = reader.string(); - break; - case 3: - message.force = reader.bool(); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4299,124 +4452,131 @@ }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + TimeWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQueryDestination message. + * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BigQueryDestination.verify = function verify(message) { + TimeWindow.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow */ - BigQueryDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.BigQueryDestination) + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) return object; - var message = new $root.google.cloud.asset.v1.BigQueryDestination(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.table != null) - message.table = String(object.table); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @static - * @param {google.cloud.asset.v1.BigQueryDestination} message BigQueryDestination + * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQueryDestination.toObject = function toObject(message, options) { + TimeWindow.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.dataset = ""; - object.table = ""; - object.force = false; + object.startTime = null; + object.endTime = null; } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + 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 BigQueryDestination to JSON. + * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.BigQueryDestination + * @memberof google.cloud.asset.v1.TimeWindow * @instance * @returns {Object.} JSON object */ - BigQueryDestination.prototype.toJSON = function toJSON() { + TimeWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BigQueryDestination; + return TimeWindow; })(); - v1.PubsubDestination = (function() { + v1.Asset = (function() { /** - * Properties of a PubsubDestination. + * Properties of an Asset. * @memberof google.cloud.asset.v1 - * @interface IPubsubDestination - * @property {string|null} [topic] PubsubDestination topic + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors */ /** - * Constructs a new PubsubDestination. + * Constructs a new Asset. * @memberof google.cloud.asset.v1 - * @classdesc Represents a PubsubDestination. - * @implements IPubsubDestination + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set */ - function PubsubDestination(properties) { + function Asset(properties) { + this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4424,75 +4584,130 @@ } /** - * PubsubDestination topic. - * @member {string} topic - * @memberof google.cloud.asset.v1.PubsubDestination + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset * @instance */ - PubsubDestination.prototype.topic = ""; + Asset.prototype.name = ""; /** - * Creates a new PubsubDestination instance using the specified properties. + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination instance + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance */ - PubsubDestination.create = function create(properties) { - return new PubsubDestination(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decode = function decode(reader, length) { + Asset.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.asset.v1.PubsubDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = reader.string(); + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4503,127 +4718,168 @@ }; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubsubDestination message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubsubDestination.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } return null; }; /** - * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1.Asset} Asset */ - PubsubDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.PubsubDestination) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) return object; - var message = new $root.google.cloud.asset.v1.PubsubDestination(); - if (object.topic != null) - message.topic = String(object.topic); + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } return message; }; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.PubsubDestination} message PubsubDestination + * @param {google.cloud.asset.v1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubsubDestination.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } return object; }; /** - * Converts this PubsubDestination to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.PubsubDestination + * @memberof google.cloud.asset.v1.Asset * @instance * @returns {Object.} JSON object */ - PubsubDestination.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubsubDestination; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; + return Asset; })(); - v1.FeedOutputConfig = (function() { + v1.Resource = (function() { /** - * Properties of a FeedOutputConfig. + * Properties of a Resource. * @memberof google.cloud.asset.v1 - * @interface IFeedOutputConfig - * @property {google.cloud.asset.v1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data */ /** - * Constructs a new FeedOutputConfig. + * Constructs a new Resource. * @memberof google.cloud.asset.v1 - * @classdesc Represents a FeedOutputConfig. - * @implements IFeedOutputConfig + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set */ - function FeedOutputConfig(properties) { + function Resource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4631,89 +4887,140 @@ } /** - * FeedOutputConfig pubsubDestination. - * @member {google.cloud.asset.v1.IPubsubDestination|null|undefined} pubsubDestination - * @memberof google.cloud.asset.v1.FeedOutputConfig + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource * @instance */ - FeedOutputConfig.prototype.pubsubDestination = null; + Resource.prototype.version = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; /** - * FeedOutputConfig destination. - * @member {"pubsubDestination"|undefined} destination - * @memberof google.cloud.asset.v1.FeedOutputConfig + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource * @instance */ - Object.defineProperty(FeedOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + Resource.prototype.discoveryName = ""; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig instance + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance */ - FeedOutputConfig.create = function create(properties) { - return new FeedOutputConfig(properties); + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) - $root.google.cloud.asset.v1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decode = function decode(reader, length) { + Resource.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.asset.v1.FeedOutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.decode(reader, reader.uint32()); + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4724,122 +5031,270 @@ }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FeedOutputConfig message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FeedOutputConfig.verify = function verify(message) { + Resource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.PubsubDestination.verify(message.pubsubDestination); - if (error) - return "pubsubDestination." + error; - } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; } return null; }; /** - * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1.Resource} Resource */ - FeedOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.FeedOutputConfig) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) return object; - var message = new $root.google.cloud.asset.v1.FeedOutputConfig(); - if (object.pubsubDestination != null) { - if (typeof object.pubsubDestination !== "object") - throw TypeError(".google.cloud.asset.v1.FeedOutputConfig.pubsubDestination: object expected"); - message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.fromObject(object.pubsubDestination); + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; }; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.FeedOutputConfig + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.FeedOutputConfig} message FeedOutputConfig + * @param {google.cloud.asset.v1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeedOutputConfig.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - object.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.toObject(message.pubsubDestination, options); - if (options.oneofs) - object.destination = "pubsubDestination"; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); return object; }; /** - * Converts this FeedOutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.FeedOutputConfig + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + return v1; + })(); + + asset.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1beta1 = {}; + + v1beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. + * @memberof google.cloud.asset.v1beta1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. + * @memberof google.cloud.asset.v1beta1.AssetService + * @typedef BatchGetAssetsHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + */ + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @param {google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { + return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, request, callback); + }, "name", { value: "BatchGetAssetsHistory" }); + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1beta1.AssetService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - FeedOutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return FeedOutputConfig; + return AssetService; })(); - v1.Feed = (function() { + v1beta1.ExportAssetsRequest = (function() { /** - * Properties of a Feed. - * @memberof google.cloud.asset.v1 - * @interface IFeed - * @property {string|null} [name] Feed name - * @property {Array.|null} [assetNames] Feed assetNames - * @property {Array.|null} [assetTypes] Feed assetTypes - * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType - * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + * Properties of an ExportAssetsRequest. + * @memberof google.cloud.asset.v1beta1 + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig */ /** - * Constructs a new Feed. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a Feed. - * @implements IFeed + * Constructs a new ExportAssetsRequest. + * @memberof google.cloud.asset.v1beta1 + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest * @constructor - * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set */ - function Feed(properties) { - this.assetNames = []; + function ExportAssetsRequest(properties) { this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -4848,122 +5303,119 @@ } /** - * Feed name. - * @member {string} name - * @memberof google.cloud.asset.v1.Feed + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @instance */ - Feed.prototype.name = ""; + ExportAssetsRequest.prototype.parent = ""; /** - * Feed assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1.Feed + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @instance */ - Feed.prototype.assetNames = $util.emptyArray; + ExportAssetsRequest.prototype.readTime = null; /** - * Feed assetTypes. + * ExportAssetsRequest assetTypes. * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @instance */ - Feed.prototype.assetTypes = $util.emptyArray; + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; /** - * Feed contentType. - * @member {google.cloud.asset.v1.ContentType} contentType - * @memberof google.cloud.asset.v1.Feed + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1beta1.ContentType} contentType + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @instance */ - Feed.prototype.contentType = 0; + ExportAssetsRequest.prototype.contentType = 0; /** - * Feed feedOutputConfig. - * @member {google.cloud.asset.v1.IFeedOutputConfig|null|undefined} feedOutputConfig - * @memberof google.cloud.asset.v1.Feed + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @instance */ - Feed.prototype.feedOutputConfig = null; + ExportAssetsRequest.prototype.outputConfig = null; /** - * Creates a new Feed instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Feed} Feed instance + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest instance */ - Feed.create = function create(properties) { - return new Feed(properties); + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); }; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encode = function encode(message, writer) { + ExportAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); if (message.contentType != null && message.hasOwnProperty("contentType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encodeDelimited = function encodeDelimited(message, writer) { + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Feed} Feed + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decode = function decode(reader, length) { + ExportAssetsRequest.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.asset.v1.Feed(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.ExportAssetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: if (!(message.assetTypes && message.assetTypes.length)) @@ -4974,7 +5426,7 @@ message.contentType = reader.int32(); break; case 5: - message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4985,41 +5437,39 @@ }; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Feed} Feed + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decodeDelimited = function decodeDelimited(reader) { + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Feed message. + * Verifies an ExportAssetsRequest message. * @function verify - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Feed.verify = function verify(message) { + ExportAssetsRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { if (!Array.isArray(message.assetTypes)) @@ -5035,42 +5485,38 @@ case 0: case 1: case 2: - case 4: - case 5: break; } - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { - var error = $root.google.cloud.asset.v1.FeedOutputConfig.verify(message.feedOutputConfig); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); if (error) - return "feedOutputConfig." + error; + return "outputConfig." + error; } return null; }; /** - * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Feed} Feed + * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest */ - Feed.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Feed) + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsRequest) return object; - var message = new $root.google.cloud.asset.v1.Feed(); - if (object.name != null) - message.name = String(object.name); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1.Feed.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); + var message = new $root.google.cloud.asset.v1beta1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } if (object.assetTypes) { if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1.Feed.assetTypes: array expected"); + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.assetTypes: array expected"); message.assetTypes = []; for (var i = 0; i < object.assetTypes.length; ++i) message.assetTypes[i] = String(object.assetTypes[i]); @@ -5088,110 +5534,85 @@ case 2: message.contentType = 2; break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; } - if (object.feedOutputConfig != null) { - if (typeof object.feedOutputConfig !== "object") - throw TypeError(".google.cloud.asset.v1.Feed.feedOutputConfig: object expected"); - message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.fromObject(object.feedOutputConfig); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); } return message; }; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @static - * @param {google.cloud.asset.v1.Feed} message Feed + * @param {google.cloud.asset.v1beta1.ExportAssetsRequest} message ExportAssetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Feed.toObject = function toObject(message, options) { + ExportAssetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.assetNames = []; + if (options.arrays || options.defaults) object.assetTypes = []; - } if (options.defaults) { - object.name = ""; + object.parent = ""; + object.readTime = null; object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.feedOutputConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; + object.outputConfig = null; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.assetTypes && message.assetTypes.length) { object.assetTypes = []; for (var j = 0; j < message.assetTypes.length; ++j) object.assetTypes[j] = message.assetTypes[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); + object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); return object; }; /** - * Converts this Feed to JSON. + * Converts this ExportAssetsRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Feed + * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest * @instance * @returns {Object.} JSON object */ - Feed.prototype.toJSON = function toJSON() { + ExportAssetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Feed; + return ExportAssetsRequest; })(); - return v1; - })(); - - asset.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1beta1 = {}; - - v1beta1.TemporalAsset = (function() { + v1beta1.ExportAssetsResponse = (function() { /** - * Properties of a TemporalAsset. + * Properties of an ExportAssetsResponse. * @memberof google.cloud.asset.v1beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig */ /** - * Constructs a new TemporalAsset. + * Constructs a new ExportAssetsResponse. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse * @constructor - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set */ - function TemporalAsset(properties) { + function ExportAssetsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5199,101 +5620,88 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.window = null; - - /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @instance */ - TemporalAsset.prototype.deleted = false; + ExportAssetsResponse.prototype.readTime = null; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @instance */ - TemporalAsset.prototype.asset = null; + ExportAssetsResponse.prototype.outputConfig = null; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + ExportAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readTime != null && message.hasOwnProperty("readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + ExportAssetsResponse.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.asset.v1beta1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.ExportAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5304,135 +5712,130 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies an ExportAssetsResponse message. * @function verify - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + ExportAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "window." + error; + return "readTime." + error; } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); if (error) - return "asset." + error; + return "outputConfig." + error; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsResponse) return object; - var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); + var message = new $root.google.cloud.asset.v1beta1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); } return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @static - * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1beta1.ExportAssetsResponse} message ExportAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + ExportAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + object.readTime = null; + object.outputConfig = null; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this ExportAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + ExportAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return ExportAssetsResponse; })(); - v1beta1.TimeWindow = (function() { + v1beta1.BatchGetAssetsHistoryRequest = (function() { /** - * Properties of a TimeWindow. + * Properties of a BatchGetAssetsHistoryRequest. * @memberof google.cloud.asset.v1beta1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface IBatchGetAssetsHistoryRequest + * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent + * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames + * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType + * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow */ /** - * Constructs a new TimeWindow. + * Constructs a new BatchGetAssetsHistoryRequest. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents a BatchGetAssetsHistoryRequest. + * @implements IBatchGetAssetsHistoryRequest * @constructor - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set */ - function TimeWindow(properties) { + function BatchGetAssetsHistoryRequest(properties) { + this.assetNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5440,88 +5843,117 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1beta1.TimeWindow + * BatchGetAssetsHistoryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.parent = ""; + + /** + * BatchGetAssetsHistoryRequest assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + + /** + * BatchGetAssetsHistoryRequest contentType. + * @member {google.cloud.asset.v1beta1.ContentType} contentType + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @instance */ - TimeWindow.prototype.startTime = null; + BatchGetAssetsHistoryRequest.prototype.contentType = 0; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1beta1.TimeWindow + * BatchGetAssetsHistoryRequest readTimeWindow. + * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @instance */ - TimeWindow.prototype.endTime = null; + BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + BatchGetAssetsHistoryRequest.create = function create(properties) { + return new BatchGetAssetsHistoryRequest(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest * @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) { + BatchGetAssetsHistoryRequest.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.asset.v1beta1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + message.contentType = reader.int32(); + break; + case 4: + message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5532,244 +5964,248 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest * @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) { + BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies a BatchGetAssetsHistoryRequest message. * @function verify - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @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) { + BatchGetAssetsHistoryRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.readTimeWindow); if (error) - return "endTime." + error; + return "readTimeWindow." + error; } return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) + BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) return object; - var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.readTimeWindow); } return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @static - * @param {google.cloud.asset.v1beta1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetNames = []; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.parent = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.readTimeWindow = 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); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + object.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.readTimeWindow, options); return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return BatchGetAssetsHistoryRequest; })(); - v1beta1.Asset = (function() { + v1beta1.BatchGetAssetsHistoryResponse = (function() { /** - * Properties of an Asset. + * Properties of a BatchGetAssetsHistoryResponse. * @memberof google.cloud.asset.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets */ /** - * Constructs a new Asset. + * Constructs a new BatchGetAssetsHistoryResponse. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse * @constructor - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set - */ - function Asset(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]]; - } - - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - */ - Asset.prototype.assetType = ""; - - /** - * Asset resource. - * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1beta1.Asset - * @instance + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set */ - Asset.prototype.resource = null; + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1beta1.Asset + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @instance */ - Asset.prototype.iamPolicy = null; + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; /** - * Creates a new Asset instance using the specified properties. + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Asset} Asset instance + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance */ - Asset.create = function create(properties) { - return new Asset(properties); + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + BatchGetAssetsHistoryResponse.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.asset.v1beta1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1beta1.TemporalAsset.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5780,147 +6216,124 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a BatchGetAssetsHistoryResponse message. * @function verify - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + BatchGetAssetsHistoryResponse.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1beta1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Asset) + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) return object; - var message = new $root.google.cloud.asset.v1beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1beta1.TemporalAsset.fromObject(object.assets[i]); + } } return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @static - * @param {google.cloud.asset.v1beta1.Asset} message Asset + * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1beta1.TemporalAsset.toObject(message.assets[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); return object; }; /** - * Converts this Asset to JSON. + * Converts this BatchGetAssetsHistoryResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return BatchGetAssetsHistoryResponse; })(); - v1beta1.Resource = (function() { + v1beta1.OutputConfig = (function() { /** - * Properties of a Resource. + * Properties of an OutputConfig. * @memberof google.cloud.asset.v1beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data + * @interface IOutputConfig + * @property {google.cloud.asset.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination */ /** - * Constructs a new Resource. + * Constructs a new OutputConfig. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a Resource. - * @implements IResource + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig * @constructor - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set */ - function Resource(properties) { + function OutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5928,140 +6341,89 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1beta1.Resource + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1beta1.OutputConfig * @instance */ - Resource.prototype.resourceUrl = ""; + OutputConfig.prototype.gcsDestination = null; - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.parent = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1beta1.Resource + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1beta1.OutputConfig * @instance */ - Resource.prototype.data = null; + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Resource instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1beta1.OutputConfig * @static - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Resource} Resource instance + * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig instance */ - Resource.create = function create(properties) { - return new Resource(properties); + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1beta1.OutputConfig * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1beta1.OutputConfig * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + OutputConfig.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.asset.v1beta1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.OutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6072,259 +6434,118 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + OutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies an OutputConfig message. * @function verify - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1beta1.OutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + OutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; - } - return null; - }; - - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Resource) - return object; - var message = new $root.google.cloud.asset.v1beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); - } - return message; - }; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {google.cloud.asset.v1beta1.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - return object; - }; - - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Resource; - })(); - - v1beta1.AssetService = (function() { - - /** - * Constructs a new AssetService service. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an AssetService - * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; - - /** - * Creates new AssetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.asset.v1beta1.AssetService - * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. - */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. - * @memberof google.cloud.asset.v1beta1.AssetService - * @typedef ExportAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @param {google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { - return this.rpcCall(exportAssets, $root.google.cloud.asset.v1beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportAssets" }); - - /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. - * @memberof google.cloud.asset.v1beta1.AssetService - * @typedef BatchGetAssetsHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @param {google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { - return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, request, callback); - }, "name", { value: "BatchGetAssetsHistory" }); + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1beta1.AssetService + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1beta1.OutputConfig * @instance - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AssetService; + return OutputConfig; })(); - v1beta1.ExportAssetsRequest = (function() { + v1beta1.GcsDestination = (function() { /** - * Properties of an ExportAssetsRequest. + * Properties of a GcsDestination. * @memberof google.cloud.asset.v1beta1 - * @interface IExportAssetsRequest - * @property {string|null} [parent] ExportAssetsRequest parent - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime - * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes - * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] ExportAssetsRequest contentType - * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix */ /** - * Constructs a new ExportAssetsRequest. + * Constructs a new GcsDestination. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an ExportAssetsRequest. - * @implements IExportAssetsRequest + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination * @constructor - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set */ - function ExportAssetsRequest(properties) { - this.assetTypes = []; + function GcsDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6332,130 +6553,102 @@ } /** - * ExportAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.parent = ""; - - /** - * ExportAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1beta1.GcsDestination * @instance */ - ExportAssetsRequest.prototype.readTime = null; + GcsDestination.prototype.uri = ""; /** - * ExportAssetsRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1beta1.GcsDestination * @instance */ - ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + GcsDestination.prototype.uriPrefix = ""; - /** - * ExportAssetsRequest contentType. - * @member {google.cloud.asset.v1beta1.ContentType} contentType - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.contentType = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ExportAssetsRequest outputConfig. - * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * GcsDestination objectUri. + * @member {"uri"|"uriPrefix"|undefined} objectUri + * @memberof google.cloud.asset.v1beta1.GcsDestination * @instance */ - ExportAssetsRequest.prototype.outputConfig = null; + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest instance + * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination instance */ - ExportAssetsRequest.create = function create(properties) { - return new ExportAssetsRequest(properties); + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); }; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encode = function encode(message, writer) { + GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decode = function decode(reader, length) { + GcsDestination.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.asset.v1beta1.ExportAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.GcsDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.uri = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); + message.uriPrefix = reader.string(); break; default: reader.skipType(tag & 7); @@ -6466,182 +6659,143 @@ }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + GcsDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsRequest message. + * Verifies a GcsDestination message. * @function verify - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; } return null; }; /** - * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination */ - ExportAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsRequest) + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.GcsDestination) return object; - var message = new $root.google.cloud.asset.v1beta1.ExportAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); - } + var message = new $root.google.cloud.asset.v1beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); return message; }; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @static - * @param {google.cloud.asset.v1beta1.ExportAssetsRequest} message ExportAssetsRequest + * @param {google.cloud.asset.v1beta1.GcsDestination} message GcsDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsRequest.toObject = function toObject(message, options) { + GcsDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; - if (options.defaults) { - object.parent = ""; - object.readTime = null; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.outputConfig = null; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); return object; }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this GcsDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1beta1.GcsDestination * @instance * @returns {Object.} JSON object */ - ExportAssetsRequest.prototype.toJSON = function toJSON() { + GcsDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsRequest; + return GcsDestination; })(); - v1beta1.ExportAssetsResponse = (function() { + /** + * ContentType enum. + * @name google.cloud.asset.v1beta1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; + })(); + + v1beta1.TemporalAsset = (function() { /** - * Properties of an ExportAssetsResponse. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1beta1 - * @interface IExportAssetsResponse - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime - * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * @interface ITemporalAsset + * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset */ /** - * Constructs a new ExportAssetsResponse. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an ExportAssetsResponse. - * @implements IExportAssetsResponse + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set */ - function ExportAssetsResponse(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6649,88 +6803,101 @@ } /** - * ExportAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * TemporalAsset window. + * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ - ExportAssetsResponse.prototype.readTime = null; + TemporalAsset.prototype.window = null; /** - * ExportAssetsResponse outputConfig. - * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ - ExportAssetsResponse.prototype.outputConfig = null; + TemporalAsset.prototype.deleted = false; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * TemporalAsset asset. + * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse instance + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance */ - ExportAssetsResponse.create = function create(properties) { - return new ExportAssetsResponse(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decode = function decode(reader, length) { + TemporalAsset.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.asset.v1beta1.ExportAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); break; case 2: - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6741,130 +6908,135 @@ }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsResponse message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsResponse.verify = function verify(message) { + TemporalAsset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); if (error) - return "readTime." + error; + return "window." + error; } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); if (error) - return "outputConfig." + error; + return "asset." + error; } return null; }; /** - * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset */ - ExportAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsResponse) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1beta1.ExportAssetsResponse(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); } return message; }; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsResponse.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.readTime = null; - object.outputConfig = null; + object.window = null; + object.deleted = false; + object.asset = null; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance * @returns {Object.} JSON object */ - ExportAssetsResponse.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsResponse; + return TemporalAsset; })(); - v1beta1.BatchGetAssetsHistoryRequest = (function() { + v1beta1.TimeWindow = (function() { /** - * Properties of a BatchGetAssetsHistoryRequest. + * Properties of a TimeWindow. * @memberof google.cloud.asset.v1beta1 - * @interface IBatchGetAssetsHistoryRequest - * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent - * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames - * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType - * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime */ /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new TimeWindow. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a BatchGetAssetsHistoryRequest. - * @implements IBatchGetAssetsHistoryRequest + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set */ - function BatchGetAssetsHistoryRequest(properties) { - this.assetNames = []; + function TimeWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6872,117 +7044,88 @@ } /** - * BatchGetAssetsHistoryRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.parent = ""; - - /** - * BatchGetAssetsHistoryRequest assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; - - /** - * BatchGetAssetsHistoryRequest contentType. - * @member {google.cloud.asset.v1beta1.ContentType} contentType - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance */ - BatchGetAssetsHistoryRequest.prototype.contentType = 0; + TimeWindow.prototype.startTime = null; /** - * BatchGetAssetsHistoryRequest readTimeWindow. - * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} readTimeWindow - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance */ - BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + TimeWindow.prototype.endTime = null; /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance */ - BatchGetAssetsHistoryRequest.create = function create(properties) { - return new BatchGetAssetsHistoryRequest(properties); + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decode = function decode(reader, length) { + 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.asset.v1beta1.BatchGetAssetsHistoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - message.contentType = reader.int32(); - break; - case 4: - message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6993,169 +7136,129 @@ }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + TimeWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryRequest.verify = function verify(message) { + TimeWindow.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { - var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.readTimeWindow); + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); if (error) - return "readTimeWindow." + error; + return "endTime." + error; } return null; }; /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow */ - BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) return object; - var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; + var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } - if (object.readTimeWindow != null) { - if (typeof object.readTimeWindow !== "object") - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); - message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.readTimeWindow); + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } return message; }; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {google.cloud.asset.v1beta1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + TimeWindow.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetNames = []; if (options.defaults) { - object.parent = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.readTimeWindow = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; + object.startTime = null; + object.endTime = null; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - object.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.readTimeWindow, options); + 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 BatchGetAssetsHistoryRequest to JSON. + * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + TimeWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryRequest; + return TimeWindow; })(); - v1beta1.BatchGetAssetsHistoryResponse = (function() { + v1beta1.Asset = (function() { /** - * Properties of a BatchGetAssetsHistoryResponse. + * Properties of an Asset. * @memberof google.cloud.asset.v1beta1 - * @interface IBatchGetAssetsHistoryResponse - * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy */ /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Constructs a new Asset. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a BatchGetAssetsHistoryResponse. - * @implements IBatchGetAssetsHistoryResponse + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set */ - function BatchGetAssetsHistoryResponse(properties) { - this.assets = []; + function Asset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7163,78 +7266,114 @@ } /** - * BatchGetAssetsHistoryResponse assets. - * @member {Array.} assets - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ - BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + Asset.prototype.name = ""; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Asset} Asset instance */ - BatchGetAssetsHistoryResponse.create = function create(properties) { - return new BatchGetAssetsHistoryResponse(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.assets != null && message.assets.length) - for (var i = 0; i < message.assets.length; ++i) - $root.google.cloud.asset.v1beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decode = function decode(reader, length) { + Asset.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.asset.v1beta1.BatchGetAssetsHistoryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1beta1.TemporalAsset.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7245,124 +7384,147 @@ }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryResponse.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.assets != null && message.hasOwnProperty("assets")) { - if (!Array.isArray(message.assets)) - return "assets: array expected"; - for (var i = 0; i < message.assets.length; ++i) { - var error = $root.google.cloud.asset.v1beta1.TemporalAsset.verify(message.assets[i]); - if (error) - return "assets." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; } return null; }; /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1beta1.Asset} Asset */ - BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.Asset) return object; - var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse(); - if (object.assets) { - if (!Array.isArray(object.assets)) - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: array expected"); - message.assets = []; - for (var i = 0; i < object.assets.length; ++i) { - if (typeof object.assets[i] !== "object") - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: object expected"); - message.assets[i] = $root.google.cloud.asset.v1beta1.TemporalAsset.fromObject(object.assets[i]); - } + var message = new $root.google.cloud.asset.v1beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); } return message; }; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {google.cloud.asset.v1beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assets = []; - if (message.assets && message.assets.length) { - object.assets = []; - for (var j = 0; j < message.assets.length; ++j) - object.assets[j] = $root.google.cloud.asset.v1beta1.TemporalAsset.toObject(message.assets[j], options); + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); return object; }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1beta1.Asset * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryResponse; + return Asset; })(); - v1beta1.OutputConfig = (function() { + v1beta1.Resource = (function() { /** - * Properties of an OutputConfig. + * Properties of a Resource. * @memberof google.cloud.asset.v1beta1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data */ /** - * Constructs a new OutputConfig. + * Constructs a new Resource. * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set */ - function OutputConfig(properties) { + function Resource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7370,89 +7532,140 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1beta1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1beta1.OutputConfig + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ - OutputConfig.prototype.gcsDestination = null; + Resource.prototype.version = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; /** - * OutputConfig destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.asset.v1beta1.OutputConfig + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + Resource.prototype.discoveryName = ""; /** - * Creates a new OutputConfig instance using the specified properties. + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig instance + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Resource} Resource instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.asset.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + Resource.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.asset.v1beta1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.decode(reader, reader.uint32()); + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7463,384 +7676,337 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + Resource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1beta1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; } return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1beta1.Resource} Resource */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.OutputConfig) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1beta1.Resource) return object; - var message = new $root.google.cloud.asset.v1beta1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1beta1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.fromObject(object.gcsDestination); + var message = new $root.google.cloud.asset.v1beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1beta1.OutputConfig} message OutputConfig + * @param {google.cloud.asset.v1beta1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.OutputConfig + * @memberof google.cloud.asset.v1beta1.Resource * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return Resource; })(); - v1beta1.GcsDestination = (function() { + return v1beta1; + })(); - /** - * Properties of a GcsDestination. - * @memberof google.cloud.asset.v1beta1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - * @property {string|null} [uriPrefix] GcsDestination uriPrefix - */ + asset.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.AssetService = (function() { /** - * Constructs a new GcsDestination. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an AssetService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set + * @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 GcsDestination(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]]; + function AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @instance + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. */ - GcsDestination.prototype.uri = ""; + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * GcsDestination uriPrefix. - * @member {string} uriPrefix - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @instance + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} [response] SearchResourcesResponse */ - GcsDestination.prototype.uriPrefix = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchResources = function searchResources(request, callback) { + return this.rpcCall(searchResources, $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse, request, callback); + }, "name", { value: "SearchResources" }); /** - * GcsDestination objectUri. - * @member {"uri"|"uriPrefix"|undefined} objectUri - * @memberof google.cloud.asset.v1beta1.GcsDestination + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.asset.v1p1beta1.AssetService * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); /** - * Creates a new GcsDestination instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination instance + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} [response] SearchIamPoliciesResponse */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); - }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SearchIamPolicies. + * @function searchIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse + * @returns {undefined} + * @variation 1 */ - GcsDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); - return writer; - }; + Object.defineProperty(AssetService.prototype.searchIamPolicies = function searchIamPolicies(request, callback) { + return this.rpcCall(searchIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, request, callback); + }, "name", { value: "SearchIamPolicies" }); /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SearchIamPolicies. + * @function searchIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination - * @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.asset.v1p1beta1.AssetService#searchAllResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse */ - GcsDestination.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.asset.v1beta1.GcsDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - case 2: - message.uriPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + * @returns {undefined} + * @variation 1 */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { + return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, request, callback); + }, "name", { value: "SearchAllResources" }); /** - * Verifies a GcsDestination message. - * @function verify - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GcsDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - if (properties.objectUri === 1) - return "objectUri: multiple values"; - properties.objectUri = 1; - if (!$util.isString(message.uriPrefix)) - return "uriPrefix: string expected"; - } - return null; - }; /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.GcsDestination) - return object; - var message = new $root.google.cloud.asset.v1beta1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.uriPrefix != null) - message.uriPrefix = String(object.uriPrefix); - return message; - }; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.GcsDestination} message GcsDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + * @returns {undefined} + * @variation 1 */ - GcsDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - object.uriPrefix = message.uriPrefix; - if (options.oneofs) - object.objectUri = "uriPrefix"; - } - return object; - }; + Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { + return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, request, callback); + }, "name", { value: "SearchAllIamPolicies" }); /** - * Converts this GcsDestination to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.GcsDestination + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GcsDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GcsDestination; - })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1beta1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - */ - v1beta1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - return values; + return AssetService; })(); - return v1beta1; - })(); - - asset.v1p1beta1 = (function() { - - /** - * Namespace v1p1beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1p1beta1 = {}; - - v1p1beta1.StandardResourceMetadata = (function() { + v1p1beta1.SearchResourcesRequest = (function() { /** - * Properties of a StandardResourceMetadata. + * Properties of a SearchResourcesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @interface IStandardResourceMetadata - * @property {string|null} [name] StandardResourceMetadata name - * @property {string|null} [assetType] StandardResourceMetadata assetType - * @property {string|null} [project] StandardResourceMetadata project - * @property {string|null} [displayName] StandardResourceMetadata displayName - * @property {string|null} [description] StandardResourceMetadata description - * @property {Array.|null} [additionalAttributes] StandardResourceMetadata additionalAttributes + * @interface ISearchResourcesRequest + * @property {string|null} [scope] SearchResourcesRequest scope + * @property {string|null} [query] SearchResourcesRequest query + * @property {Array.|null} [assetTypes] SearchResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchResourcesRequest pageSize + * @property {string|null} [pageToken] SearchResourcesRequest pageToken */ /** - * Constructs a new StandardResourceMetadata. + * Constructs a new SearchResourcesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a StandardResourceMetadata. - * @implements IStandardResourceMetadata + * @classdesc Represents a SearchResourcesRequest. + * @implements ISearchResourcesRequest * @constructor - * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set */ - function StandardResourceMetadata(properties) { - this.additionalAttributes = []; + function SearchResourcesRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7848,143 +8014,130 @@ } /** - * StandardResourceMetadata name. - * @member {string} name - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata - * @instance - */ - StandardResourceMetadata.prototype.name = ""; - - /** - * StandardResourceMetadata assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * SearchResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - StandardResourceMetadata.prototype.assetType = ""; + SearchResourcesRequest.prototype.scope = ""; /** - * StandardResourceMetadata project. - * @member {string} project - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * SearchResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - StandardResourceMetadata.prototype.project = ""; + SearchResourcesRequest.prototype.query = ""; /** - * StandardResourceMetadata displayName. - * @member {string} displayName - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * SearchResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - StandardResourceMetadata.prototype.displayName = ""; + SearchResourcesRequest.prototype.assetTypes = $util.emptyArray; /** - * StandardResourceMetadata description. - * @member {string} description - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * SearchResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - StandardResourceMetadata.prototype.description = ""; + SearchResourcesRequest.prototype.pageSize = 0; /** - * StandardResourceMetadata additionalAttributes. - * @member {Array.} additionalAttributes - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * SearchResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - StandardResourceMetadata.prototype.additionalAttributes = $util.emptyArray; + SearchResourcesRequest.prototype.pageToken = ""; /** - * Creates a new StandardResourceMetadata instance using the specified properties. + * Creates a new SearchResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest instance */ - StandardResourceMetadata.create = function create(properties) { - return new StandardResourceMetadata(properties); + SearchResourcesRequest.create = function create(properties) { + return new SearchResourcesRequest(properties); }; /** - * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StandardResourceMetadata.encode = function encode(message, writer) { + SearchResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.project != null && message.hasOwnProperty("project")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.additionalAttributes != null && message.additionalAttributes.length) - for (var i = 0; i < message.additionalAttributes.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.additionalAttributes[i]); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StandardResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StandardResourceMetadata message from the specified reader or buffer. + * Decodes a SearchResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StandardResourceMetadata.decode = function decode(reader, length) { + SearchResourcesRequest.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.asset.v1p1beta1.StandardResourceMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.scope = reader.string(); break; case 2: - message.assetType = reader.string(); + message.query = reader.string(); break; case 3: - message.project = reader.string(); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); break; case 4: - message.displayName = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 10: - if (!(message.additionalAttributes && message.additionalAttributes.length)) - message.additionalAttributes = []; - message.additionalAttributes.push(reader.string()); + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -7995,163 +8148,155 @@ }; /** - * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StandardResourceMetadata.decodeDelimited = function decodeDelimited(reader) { + SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StandardResourceMetadata message. + * Verifies a SearchResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StandardResourceMetadata.verify = function verify(message) { + SearchResourcesRequest.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { - if (!Array.isArray(message.additionalAttributes)) - return "additionalAttributes: array expected"; - for (var i = 0; i < message.additionalAttributes.length; ++i) - if (!$util.isString(message.additionalAttributes[i])) - return "additionalAttributes: string[] expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: 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 StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest */ - StandardResourceMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata) + SearchResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.project != null) - message.project = String(object.project); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.additionalAttributes) { - if (!Array.isArray(object.additionalAttributes)) - throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.additionalAttributes: array expected"); - message.additionalAttributes = []; - for (var i = 0; i < object.additionalAttributes.length; ++i) - message.additionalAttributes[i] = String(object.additionalAttributes[i]); + var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); } + 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 StandardResourceMetadata message. Also converts values to other types if specified. + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.StandardResourceMetadata} message StandardResourceMetadata + * @param {google.cloud.asset.v1p1beta1.SearchResourcesRequest} message SearchResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StandardResourceMetadata.toObject = function toObject(message, options) { + SearchResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.additionalAttributes = []; + object.assetTypes = []; if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.project = ""; - object.displayName = ""; - object.description = ""; + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.additionalAttributes && message.additionalAttributes.length) { - object.additionalAttributes = []; - for (var j = 0; j < message.additionalAttributes.length; ++j) - object.additionalAttributes[j] = message.additionalAttributes[j]; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this StandardResourceMetadata to JSON. + * Converts this SearchResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance * @returns {Object.} JSON object */ - StandardResourceMetadata.prototype.toJSON = function toJSON() { + SearchResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StandardResourceMetadata; + return SearchResourcesRequest; })(); - v1p1beta1.IamPolicySearchResult = (function() { + v1p1beta1.SearchResourcesResponse = (function() { /** - * Properties of an IamPolicySearchResult. + * Properties of a SearchResourcesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @interface IIamPolicySearchResult - * @property {string|null} [resource] IamPolicySearchResult resource - * @property {string|null} [project] IamPolicySearchResult project - * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @interface ISearchResourcesResponse + * @property {Array.|null} [results] SearchResourcesResponse results + * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken */ /** - * Constructs a new IamPolicySearchResult. + * Constructs a new SearchResourcesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents an IamPolicySearchResult. - * @implements IIamPolicySearchResult + * @classdesc Represents a SearchResourcesResponse. + * @implements ISearchResourcesResponse * @constructor - * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set */ - function IamPolicySearchResult(properties) { + function SearchResourcesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8159,101 +8304,91 @@ } /** - * IamPolicySearchResult resource. - * @member {string} resource - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.resource = ""; - - /** - * IamPolicySearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * SearchResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance */ - IamPolicySearchResult.prototype.project = ""; + SearchResourcesResponse.prototype.results = $util.emptyArray; /** - * IamPolicySearchResult policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * SearchResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance */ - IamPolicySearchResult.prototype.policy = null; + SearchResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new IamPolicySearchResult instance using the specified properties. + * Creates a new SearchResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse instance */ - IamPolicySearchResult.create = function create(properties) { - return new IamPolicySearchResult(properties); + SearchResourcesResponse.create = function create(properties) { + return new SearchResourcesResponse(properties); }; /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicySearchResult.encode = function encode(message, writer) { + SearchResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.project != null && message.hasOwnProperty("project")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.policy != null && message.hasOwnProperty("policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * Decodes a SearchResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicySearchResult.decode = function decode(reader, length) { + SearchResourcesResponse.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.asset.v1p1beta1.IamPolicySearchResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resource = reader.string(); - break; - case 3: - message.project = reader.string(); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); break; - case 4: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8264,301 +8399,136 @@ }; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { + SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IamPolicySearchResult message. + * Verifies a SearchResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IamPolicySearchResult.verify = function verify(message) { + SearchResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse */ - IamPolicySearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult) + SearchResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.project != null) - message.project = String(object.project); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult} message IamPolicySearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicySearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.project = ""; - object.policy = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - return object; - }; - - /** - * Converts this IamPolicySearchResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult - * @instance - * @returns {Object.} JSON object - */ - IamPolicySearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IamPolicySearchResult; - })(); - - v1p1beta1.AssetService = (function() { - - /** - * Constructs a new AssetService service. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents an AssetService - * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; - - /** - * Creates new AssetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. - */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} [response] SearchResourcesResponse - */ - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchResources = function searchResources(request, callback) { - return this.rpcCall(searchResources, $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse, request, callback); - }, "name", { value: "SearchResources" }); - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchIamPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} [response] SearchIamPoliciesResponse - */ - - /** - * Calls SearchIamPolicies. - * @function searchIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchIamPolicies = function searchIamPolicies(request, callback) { - return this.rpcCall(searchIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, request, callback); - }, "name", { value: "SearchIamPolicies" }); - - /** - * Calls SearchIamPolicies. - * @function searchIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchAllResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse - */ - - /** - * Calls SearchAllResources. - * @function searchAllResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { - return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, request, callback); - }, "name", { value: "SearchAllResources" }); - - /** - * Calls SearchAllResources. - * @function searchAllResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchAllIamPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse - */ - - /** - * Calls SearchAllIamPolicies. - * @function searchAllIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse - * @returns {undefined} - * @variation 1 + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} message SearchResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { - return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, request, callback); - }, "name", { value: "SearchAllIamPolicies" }); + SearchResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; /** - * Calls SearchAllIamPolicies. - * @function searchAllIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService + * Converts this SearchResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + SearchResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AssetService; + return SearchResourcesResponse; })(); - v1p1beta1.SearchResourcesRequest = (function() { + v1p1beta1.SearchIamPoliciesRequest = (function() { /** - * Properties of a SearchResourcesRequest. + * Properties of a SearchIamPoliciesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchResourcesRequest - * @property {string|null} [scope] SearchResourcesRequest scope - * @property {string|null} [query] SearchResourcesRequest query - * @property {Array.|null} [assetTypes] SearchResourcesRequest assetTypes - * @property {number|null} [pageSize] SearchResourcesRequest pageSize - * @property {string|null} [pageToken] SearchResourcesRequest pageToken + * @interface ISearchIamPoliciesRequest + * @property {string|null} [scope] SearchIamPoliciesRequest scope + * @property {string|null} [query] SearchIamPoliciesRequest query + * @property {number|null} [pageSize] SearchIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchIamPoliciesRequest pageToken */ /** - * Constructs a new SearchResourcesRequest. + * Constructs a new SearchIamPoliciesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchResourcesRequest. - * @implements ISearchResourcesRequest + * @classdesc Represents a SearchIamPoliciesRequest. + * @implements ISearchIamPoliciesRequest * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set */ - function SearchResourcesRequest(properties) { - this.assetTypes = []; + function SearchIamPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8566,129 +8536,113 @@ } /** - * SearchResourcesRequest scope. + * SearchIamPoliciesRequest scope. * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance */ - SearchResourcesRequest.prototype.scope = ""; + SearchIamPoliciesRequest.prototype.scope = ""; /** - * SearchResourcesRequest query. + * SearchIamPoliciesRequest query. * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.query = ""; - - /** - * SearchResourcesRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance */ - SearchResourcesRequest.prototype.assetTypes = $util.emptyArray; + SearchIamPoliciesRequest.prototype.query = ""; /** - * SearchResourcesRequest pageSize. + * SearchIamPoliciesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance */ - SearchResourcesRequest.prototype.pageSize = 0; + SearchIamPoliciesRequest.prototype.pageSize = 0; /** - * SearchResourcesRequest pageToken. + * SearchIamPoliciesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance */ - SearchResourcesRequest.prototype.pageToken = ""; + SearchIamPoliciesRequest.prototype.pageToken = ""; /** - * Creates a new SearchResourcesRequest instance using the specified properties. + * Creates a new SearchIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest instance */ - SearchResourcesRequest.create = function create(properties) { - return new SearchResourcesRequest(properties); + SearchIamPoliciesRequest.create = function create(properties) { + return new SearchIamPoliciesRequest(properties); }; /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. + * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResourcesRequest.encode = function encode(message, writer) { + SearchIamPoliciesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scope); return writer; }; /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. + * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResourcesRequest.decode = function decode(reader, length) { + SearchIamPoliciesRequest.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.asset.v1p1beta1.SearchResourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: + case 4: message.scope = reader.string(); break; - case 2: + case 1: message.query = reader.string(); break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: + case 2: message.pageSize = reader.int32(); break; - case 5: + case 3: message.pageToken = reader.string(); break; default: @@ -8700,30 +8654,30 @@ }; /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + SearchIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResourcesRequest message. + * Verifies a SearchIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResourcesRequest.verify = function verify(message) { + SearchIamPoliciesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.scope != null && message.hasOwnProperty("scope")) @@ -8732,13 +8686,6 @@ if (message.query != null && message.hasOwnProperty("query")) if (!$util.isString(message.query)) return "query: string expected"; - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; @@ -8749,28 +8696,21 @@ }; /** - * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest */ - SearchResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest) + SearchIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); + var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); if (object.scope != null) message.scope = String(object.scope); if (object.query != null) message.query = String(object.query); - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -8779,165 +8719,158 @@ }; /** - * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.SearchResourcesRequest} message SearchResourcesRequest + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} message SearchIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResourcesRequest.toObject = function toObject(message, options) { + SearchIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; if (options.defaults) { - object.scope = ""; object.query = ""; object.pageSize = 0; object.pageToken = ""; + object.scope = ""; } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; if (message.query != null && message.hasOwnProperty("query")) object.query = message.query; - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; - } if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; return object; }; /** - * Converts this SearchResourcesRequest to JSON. + * Converts this SearchIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - SearchResourcesRequest.prototype.toJSON = function toJSON() { + SearchIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchResourcesRequest; + return SearchIamPoliciesRequest; })(); - v1p1beta1.SearchResourcesResponse = (function() { + v1p1beta1.SearchIamPoliciesResponse = (function() { /** - * Properties of a SearchResourcesResponse. + * Properties of a SearchIamPoliciesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchResourcesResponse - * @property {Array.|null} [results] SearchResourcesResponse results - * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken + * @interface ISearchIamPoliciesResponse + * @property {Array.|null} [results] SearchIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchIamPoliciesResponse nextPageToken */ /** - * Constructs a new SearchResourcesResponse. + * Constructs a new SearchIamPoliciesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchResourcesResponse. - * @implements ISearchResourcesResponse + * @classdesc Represents a SearchIamPoliciesResponse. + * @implements ISearchIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set */ - function SearchResourcesResponse(properties) { + function SearchIamPoliciesResponse(properties) { this.results = []; 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]]; } - - /** - * SearchResourcesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + + /** + * SearchIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance */ - SearchResourcesResponse.prototype.results = $util.emptyArray; + SearchIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * SearchResourcesResponse nextPageToken. + * SearchIamPoliciesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance */ - SearchResourcesResponse.prototype.nextPageToken = ""; + SearchIamPoliciesResponse.prototype.nextPageToken = ""; /** - * Creates a new SearchResourcesResponse instance using the specified properties. + * Creates a new SearchIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse instance */ - SearchResourcesResponse.create = function create(properties) { - return new SearchResourcesResponse(properties); + SearchIamPoliciesResponse.create = function create(properties) { + return new SearchIamPoliciesResponse(properties); }; /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. + * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResourcesResponse.encode = function encode(message, writer) { + SearchIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. + * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResourcesResponse.decode = function decode(reader, length) { + SearchIamPoliciesResponse.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.asset.v1p1beta1.SearchResourcesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.results && message.results.length)) message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); @@ -8951,37 +8884,37 @@ }; /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + SearchIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResourcesResponse message. + * Verifies a SearchIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResourcesResponse.verify = function verify(message) { + SearchIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.results != null && message.hasOwnProperty("results")) { if (!Array.isArray(message.results)) return "results: array expected"; for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); if (error) return "results." + error; } @@ -8993,25 +8926,25 @@ }; /** - * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse */ - SearchResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse) + SearchIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); + var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); if (object.results) { if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: array expected"); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: array expected"); message.results = []; for (var i = 0; i < object.results.length; ++i) { if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); } } if (object.nextPageToken != null) @@ -9020,15 +8953,15 @@ }; /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} message SearchResourcesResponse + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} message SearchIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResourcesResponse.toObject = function toObject(message, options) { + SearchIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -9039,7 +8972,7 @@ if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -9047,40 +8980,42 @@ }; /** - * Converts this SearchResourcesResponse to JSON. + * Converts this SearchIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - SearchResourcesResponse.prototype.toJSON = function toJSON() { + SearchIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchResourcesResponse; + return SearchIamPoliciesResponse; })(); - v1p1beta1.SearchIamPoliciesRequest = (function() { + v1p1beta1.SearchAllResourcesRequest = (function() { /** - * Properties of a SearchIamPoliciesRequest. + * Properties of a SearchAllResourcesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchIamPoliciesRequest - * @property {string|null} [scope] SearchIamPoliciesRequest scope - * @property {string|null} [query] SearchIamPoliciesRequest query - * @property {number|null} [pageSize] SearchIamPoliciesRequest pageSize - * @property {string|null} [pageToken] SearchIamPoliciesRequest pageToken + * @interface ISearchAllResourcesRequest + * @property {string|null} [scope] SearchAllResourcesRequest scope + * @property {string|null} [query] SearchAllResourcesRequest query + * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize + * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken */ /** - * Constructs a new SearchIamPoliciesRequest. + * Constructs a new SearchAllResourcesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchIamPoliciesRequest. - * @implements ISearchIamPoliciesRequest + * @classdesc Represents a SearchAllResourcesRequest. + * @implements ISearchAllResourcesRequest * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set */ - function SearchIamPoliciesRequest(properties) { + function SearchAllResourcesRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9088,113 +9023,129 @@ } /** - * SearchIamPoliciesRequest scope. + * SearchAllResourcesRequest scope. * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - SearchIamPoliciesRequest.prototype.scope = ""; + SearchAllResourcesRequest.prototype.scope = ""; /** - * SearchIamPoliciesRequest query. + * SearchAllResourcesRequest query. * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - SearchIamPoliciesRequest.prototype.query = ""; + SearchAllResourcesRequest.prototype.query = ""; /** - * SearchIamPoliciesRequest pageSize. + * SearchAllResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; + + /** + * SearchAllResourcesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - SearchIamPoliciesRequest.prototype.pageSize = 0; + SearchAllResourcesRequest.prototype.pageSize = 0; /** - * SearchIamPoliciesRequest pageToken. + * SearchAllResourcesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - SearchIamPoliciesRequest.prototype.pageToken = ""; + SearchAllResourcesRequest.prototype.pageToken = ""; /** - * Creates a new SearchIamPoliciesRequest instance using the specified properties. + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest instance */ - SearchIamPoliciesRequest.create = function create(properties) { - return new SearchIamPoliciesRequest(properties); + SearchAllResourcesRequest.create = function create(properties) { + return new SearchAllResourcesRequest(properties); }; /** - * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchIamPoliciesRequest.encode = function encode(message, writer) { + SearchAllResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.scope); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchIamPoliciesRequest.decode = function decode(reader, length) { + SearchAllResourcesRequest.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.asset.v1p1beta1.SearchIamPoliciesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: + case 1: message.scope = reader.string(); break; - case 1: + case 2: message.query = reader.string(); break; - case 2: + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: message.pageSize = reader.int32(); break; - case 3: + case 5: message.pageToken = reader.string(); break; default: @@ -9206,30 +9157,30 @@ }; /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchIamPoliciesRequest message. + * Verifies a SearchAllResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchIamPoliciesRequest.verify = function verify(message) { + SearchAllResourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.scope != null && message.hasOwnProperty("scope")) @@ -9238,6 +9189,13 @@ if (message.query != null && message.hasOwnProperty("query")) if (!$util.isString(message.query)) return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; @@ -9248,21 +9206,28 @@ }; /** - * Creates a SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest */ - SearchIamPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest) + SearchAllResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); if (object.scope != null) message.scope = String(object.scope); if (object.query != null) message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -9271,68 +9236,75 @@ }; /** - * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} message SearchIamPoliciesRequest + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} message SearchAllResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchIamPoliciesRequest.toObject = function toObject(message, options) { + SearchAllResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; if (options.defaults) { + object.scope = ""; object.query = ""; object.pageSize = 0; object.pageToken = ""; - object.scope = ""; } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; if (message.query != null && message.hasOwnProperty("query")) object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; return object; }; /** - * Converts this SearchIamPoliciesRequest to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance * @returns {Object.} JSON object */ - SearchIamPoliciesRequest.prototype.toJSON = function toJSON() { + SearchAllResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchIamPoliciesRequest; + return SearchAllResourcesRequest; })(); - v1p1beta1.SearchIamPoliciesResponse = (function() { + v1p1beta1.SearchAllResourcesResponse = (function() { /** - * Properties of a SearchIamPoliciesResponse. + * Properties of a SearchAllResourcesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchIamPoliciesResponse - * @property {Array.|null} [results] SearchIamPoliciesResponse results - * @property {string|null} [nextPageToken] SearchIamPoliciesResponse nextPageToken + * @interface ISearchAllResourcesResponse + * @property {Array.|null} [results] SearchAllResourcesResponse results + * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken */ /** - * Constructs a new SearchIamPoliciesResponse. + * Constructs a new SearchAllResourcesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchIamPoliciesResponse. - * @implements ISearchIamPoliciesResponse + * @classdesc Represents a SearchAllResourcesResponse. + * @implements ISearchAllResourcesResponse * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set */ - function SearchIamPoliciesResponse(properties) { + function SearchAllResourcesResponse(properties) { this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -9341,88 +9313,88 @@ } /** - * SearchIamPoliciesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * SearchAllResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance */ - SearchIamPoliciesResponse.prototype.results = $util.emptyArray; + SearchAllResourcesResponse.prototype.results = $util.emptyArray; /** - * SearchIamPoliciesResponse nextPageToken. + * SearchAllResourcesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance */ - SearchIamPoliciesResponse.prototype.nextPageToken = ""; + SearchAllResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new SearchIamPoliciesResponse instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse instance */ - SearchIamPoliciesResponse.create = function create(properties) { - return new SearchIamPoliciesResponse(properties); + SearchAllResourcesResponse.create = function create(properties) { + return new SearchAllResourcesResponse(properties); }; /** - * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchIamPoliciesResponse.encode = function encode(message, writer) { + SearchAllResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchIamPoliciesResponse.decode = function decode(reader, length) { + SearchAllResourcesResponse.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.asset.v1p1beta1.SearchIamPoliciesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.results && message.results.length)) message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); @@ -9436,37 +9408,37 @@ }; /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchIamPoliciesResponse message. + * Verifies a SearchAllResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchIamPoliciesResponse.verify = function verify(message) { + SearchAllResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.results != null && message.hasOwnProperty("results")) { if (!Array.isArray(message.results)) return "results: array expected"; for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); if (error) return "results." + error; } @@ -9478,25 +9450,25 @@ }; /** - * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse */ - SearchIamPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) + SearchAllResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); if (object.results) { if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: array expected"); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: array expected"); message.results = []; for (var i = 0; i < object.results.length; ++i) { if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); } } if (object.nextPageToken != null) @@ -9505,15 +9477,15 @@ }; /** - * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} message SearchIamPoliciesResponse + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} message SearchAllResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchIamPoliciesResponse.toObject = function toObject(message, options) { + SearchAllResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -9524,7 +9496,7 @@ if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -9532,42 +9504,40 @@ }; /** - * Converts this SearchIamPoliciesResponse to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance * @returns {Object.} JSON object */ - SearchIamPoliciesResponse.prototype.toJSON = function toJSON() { + SearchAllResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchIamPoliciesResponse; + return SearchAllResourcesResponse; })(); - v1p1beta1.SearchAllResourcesRequest = (function() { + v1p1beta1.SearchAllIamPoliciesRequest = (function() { /** - * Properties of a SearchAllResourcesRequest. + * Properties of a SearchAllIamPoliciesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchAllResourcesRequest - * @property {string|null} [scope] SearchAllResourcesRequest scope - * @property {string|null} [query] SearchAllResourcesRequest query - * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes - * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize - * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken + * @interface ISearchAllIamPoliciesRequest + * @property {string|null} [scope] SearchAllIamPoliciesRequest scope + * @property {string|null} [query] SearchAllIamPoliciesRequest query + * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken */ /** - * Constructs a new SearchAllResourcesRequest. + * Constructs a new SearchAllIamPoliciesRequest. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchAllResourcesRequest. - * @implements ISearchAllResourcesRequest + * @classdesc Represents a SearchAllIamPoliciesRequest. + * @implements ISearchAllIamPoliciesRequest * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set */ - function SearchAllResourcesRequest(properties) { - this.assetTypes = []; + function SearchAllIamPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9575,111 +9545,100 @@ } /** - * SearchAllResourcesRequest scope. + * SearchAllIamPoliciesRequest scope. * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - SearchAllResourcesRequest.prototype.scope = ""; + SearchAllIamPoliciesRequest.prototype.scope = ""; /** - * SearchAllResourcesRequest query. + * SearchAllIamPoliciesRequest query. * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest - * @instance - */ - SearchAllResourcesRequest.prototype.query = ""; - - /** - * SearchAllResourcesRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; + SearchAllIamPoliciesRequest.prototype.query = ""; /** - * SearchAllResourcesRequest pageSize. + * SearchAllIamPoliciesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - SearchAllResourcesRequest.prototype.pageSize = 0; + SearchAllIamPoliciesRequest.prototype.pageSize = 0; /** - * SearchAllResourcesRequest pageToken. + * SearchAllIamPoliciesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - SearchAllResourcesRequest.prototype.pageToken = ""; + SearchAllIamPoliciesRequest.prototype.pageToken = ""; /** - * Creates a new SearchAllResourcesRequest instance using the specified properties. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance */ - SearchAllResourcesRequest.create = function create(properties) { - return new SearchAllResourcesRequest(properties); + SearchAllIamPoliciesRequest.create = function create(properties) { + return new SearchAllIamPoliciesRequest(properties); }; /** - * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllResourcesRequest.encode = function encode(message, writer) { + SearchAllIamPoliciesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.scope != null && message.hasOwnProperty("scope")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); if (message.query != null && message.hasOwnProperty("query")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllResourcesRequest.decode = function decode(reader, length) { + SearchAllIamPoliciesRequest.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.asset.v1p1beta1.SearchAllResourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9690,14 +9649,9 @@ message.query = reader.string(); break; case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: message.pageSize = reader.int32(); break; - case 5: + case 4: message.pageToken = reader.string(); break; default: @@ -9709,30 +9663,30 @@ }; /** - * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchAllResourcesRequest message. + * Verifies a SearchAllIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchAllResourcesRequest.verify = function verify(message) { + SearchAllIamPoliciesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.scope != null && message.hasOwnProperty("scope")) @@ -9741,13 +9695,6 @@ if (message.query != null && message.hasOwnProperty("query")) if (!$util.isString(message.query)) return "query: string expected"; - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; @@ -9758,28 +9705,21 @@ }; /** - * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest */ - SearchAllResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest) + SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); if (object.scope != null) message.scope = String(object.scope); if (object.query != null) message.query = String(object.query); - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -9788,20 +9728,18 @@ }; /** - * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} message SearchAllResourcesRequest + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchAllResourcesRequest.toObject = function toObject(message, options) { + SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; if (options.defaults) { object.scope = ""; object.query = ""; @@ -9812,11 +9750,6 @@ object.scope = message.scope; if (message.query != null && message.hasOwnProperty("query")) object.query = message.query; - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; - } if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -9825,38 +9758,38 @@ }; /** - * Converts this SearchAllResourcesRequest to JSON. + * Converts this SearchAllIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - SearchAllResourcesRequest.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchAllResourcesRequest; + return SearchAllIamPoliciesRequest; })(); - v1p1beta1.SearchAllResourcesResponse = (function() { + v1p1beta1.SearchAllIamPoliciesResponse = (function() { /** - * Properties of a SearchAllResourcesResponse. + * Properties of a SearchAllIamPoliciesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchAllResourcesResponse - * @property {Array.|null} [results] SearchAllResourcesResponse results - * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken + * @interface ISearchAllIamPoliciesResponse + * @property {Array.|null} [results] SearchAllIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken */ /** - * Constructs a new SearchAllResourcesResponse. + * Constructs a new SearchAllIamPoliciesResponse. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchAllResourcesResponse. - * @implements ISearchAllResourcesResponse + * @classdesc Represents a SearchAllIamPoliciesResponse. + * @implements ISearchAllIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set */ - function SearchAllResourcesResponse(properties) { + function SearchAllIamPoliciesResponse(properties) { this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -9865,88 +9798,88 @@ } /** - * SearchAllResourcesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * SearchAllIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance */ - SearchAllResourcesResponse.prototype.results = $util.emptyArray; + SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * SearchAllResourcesResponse nextPageToken. + * SearchAllIamPoliciesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance */ - SearchAllResourcesResponse.prototype.nextPageToken = ""; + SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; /** - * Creates a new SearchAllResourcesResponse instance using the specified properties. + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance */ - SearchAllResourcesResponse.create = function create(properties) { - return new SearchAllResourcesResponse(properties); + SearchAllIamPoliciesResponse.create = function create(properties) { + return new SearchAllIamPoliciesResponse(properties); }; /** - * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllResourcesResponse.encode = function encode(message, writer) { + SearchAllIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllResourcesResponse.decode = function decode(reader, length) { + SearchAllIamPoliciesResponse.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.asset.v1p1beta1.SearchAllResourcesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.results && message.results.length)) message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); @@ -9960,37 +9893,37 @@ }; /** - * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchAllResourcesResponse message. + * Verifies a SearchAllIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchAllResourcesResponse.verify = function verify(message) { + SearchAllIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.results != null && message.hasOwnProperty("results")) { if (!Array.isArray(message.results)) return "results: array expected"; for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); if (error) return "results." + error; } @@ -10002,25 +9935,25 @@ }; /** - * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse */ - SearchAllResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) + SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); if (object.results) { if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: array expected"); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: array expected"); message.results = []; for (var i = 0; i < object.results.length; ++i) { if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); } } if (object.nextPageToken != null) @@ -10029,15 +9962,15 @@ }; /** - * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} message SearchAllResourcesResponse + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchAllResourcesResponse.toObject = function toObject(message, options) { + SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -10048,7 +9981,7 @@ if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -10056,40 +9989,43 @@ }; /** - * Converts this SearchAllResourcesResponse to JSON. + * Converts this SearchAllIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - SearchAllResourcesResponse.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchAllResourcesResponse; + return SearchAllIamPoliciesResponse; })(); - v1p1beta1.SearchAllIamPoliciesRequest = (function() { + v1p1beta1.StandardResourceMetadata = (function() { /** - * Properties of a SearchAllIamPoliciesRequest. + * Properties of a StandardResourceMetadata. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchAllIamPoliciesRequest - * @property {string|null} [scope] SearchAllIamPoliciesRequest scope - * @property {string|null} [query] SearchAllIamPoliciesRequest query - * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize - * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken + * @interface IStandardResourceMetadata + * @property {string|null} [name] StandardResourceMetadata name + * @property {string|null} [assetType] StandardResourceMetadata assetType + * @property {string|null} [project] StandardResourceMetadata project + * @property {string|null} [displayName] StandardResourceMetadata displayName + * @property {string|null} [description] StandardResourceMetadata description + * @property {Array.|null} [additionalAttributes] StandardResourceMetadata additionalAttributes */ /** - * Constructs a new SearchAllIamPoliciesRequest. + * Constructs a new StandardResourceMetadata. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchAllIamPoliciesRequest. - * @implements ISearchAllIamPoliciesRequest + * @classdesc Represents a StandardResourceMetadata. + * @implements IStandardResourceMetadata * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set */ - function SearchAllIamPoliciesRequest(properties) { + function StandardResourceMetadata(properties) { + this.additionalAttributes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10097,114 +10033,143 @@ } /** - * SearchAllIamPoliciesRequest scope. - * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * StandardResourceMetadata name. + * @member {string} name + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.name = ""; + + /** + * StandardResourceMetadata assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.assetType = ""; + + /** + * StandardResourceMetadata project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - SearchAllIamPoliciesRequest.prototype.scope = ""; + StandardResourceMetadata.prototype.project = ""; /** - * SearchAllIamPoliciesRequest query. - * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * StandardResourceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - SearchAllIamPoliciesRequest.prototype.query = ""; + StandardResourceMetadata.prototype.displayName = ""; /** - * SearchAllIamPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * StandardResourceMetadata description. + * @member {string} description + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - SearchAllIamPoliciesRequest.prototype.pageSize = 0; + StandardResourceMetadata.prototype.description = ""; /** - * SearchAllIamPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * StandardResourceMetadata additionalAttributes. + * @member {Array.} additionalAttributes + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - SearchAllIamPoliciesRequest.prototype.pageToken = ""; + StandardResourceMetadata.prototype.additionalAttributes = $util.emptyArray; /** - * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. + * Creates a new StandardResourceMetadata instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata instance */ - SearchAllIamPoliciesRequest.create = function create(properties) { - return new SearchAllIamPoliciesRequest(properties); + StandardResourceMetadata.create = function create(properties) { + return new StandardResourceMetadata(properties); }; /** - * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllIamPoliciesRequest.encode = function encode(message, writer) { + StandardResourceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.additionalAttributes != null && message.additionalAttributes.length) + for (var i = 0; i < message.additionalAttributes.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.additionalAttributes[i]); return writer; }; /** - * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + StandardResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. + * Decodes a StandardResourceMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllIamPoliciesRequest.decode = function decode(reader, length) { + StandardResourceMetadata.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.asset.v1p1beta1.SearchAllIamPoliciesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.scope = reader.string(); + message.name = reader.string(); break; case 2: - message.query = reader.string(); + message.assetType = reader.string(); break; case 3: - message.pageSize = reader.int32(); + message.project = reader.string(); break; case 4: - message.pageToken = reader.string(); + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 10: + if (!(message.additionalAttributes && message.additionalAttributes.length)) + message.additionalAttributes = []; + message.additionalAttributes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -10215,134 +10180,163 @@ }; /** - * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + StandardResourceMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchAllIamPoliciesRequest message. + * Verifies a StandardResourceMetadata message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchAllIamPoliciesRequest.verify = function verify(message) { + StandardResourceMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: 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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + if (!Array.isArray(message.additionalAttributes)) + return "additionalAttributes: array expected"; + for (var i = 0; i < message.additionalAttributes.length; ++i) + if (!$util.isString(message.additionalAttributes[i])) + return "additionalAttributes: string[] expected"; + } return null; }; /** - * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata */ - SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest) + StandardResourceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.query != null) - message.query = String(object.query); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.additionalAttributes) { + if (!Array.isArray(object.additionalAttributes)) + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.additionalAttributes: array expected"); + message.additionalAttributes = []; + for (var i = 0; i < object.additionalAttributes.length; ++i) + message.additionalAttributes[i] = String(object.additionalAttributes[i]); + } return message; }; /** - * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest + * @param {google.cloud.asset.v1p1beta1.StandardResourceMetadata} message StandardResourceMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { + StandardResourceMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalAttributes = []; if (options.defaults) { - object.scope = ""; - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.additionalAttributes && message.additionalAttributes.length) { + object.additionalAttributes = []; + for (var j = 0; j < message.additionalAttributes.length; ++j) + object.additionalAttributes[j] = message.additionalAttributes[j]; } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; return object; }; /** - * Converts this SearchAllIamPoliciesRequest to JSON. + * Converts this StandardResourceMetadata to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance * @returns {Object.} JSON object */ - SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { + StandardResourceMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchAllIamPoliciesRequest; + return StandardResourceMetadata; })(); - v1p1beta1.SearchAllIamPoliciesResponse = (function() { + v1p1beta1.IamPolicySearchResult = (function() { /** - * Properties of a SearchAllIamPoliciesResponse. + * Properties of an IamPolicySearchResult. * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchAllIamPoliciesResponse - * @property {Array.|null} [results] SearchAllIamPoliciesResponse results - * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy */ /** - * Constructs a new SearchAllIamPoliciesResponse. + * Constructs a new IamPolicySearchResult. * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchAllIamPoliciesResponse. - * @implements ISearchAllIamPoliciesResponse + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set */ - function SearchAllIamPoliciesResponse(properties) { - this.results = []; + function IamPolicySearchResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10350,91 +10344,101 @@ } /** - * SearchAllIamPoliciesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance */ - SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; + IamPolicySearchResult.prototype.resource = ""; /** - * SearchAllIamPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance */ - SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; + IamPolicySearchResult.prototype.project = ""; /** - * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult instance */ - SearchAllIamPoliciesResponse.create = function create(properties) { - return new SearchAllIamPoliciesResponse(properties); + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); }; /** - * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllIamPoliciesResponse.encode = function encode(message, writer) { + IamPolicySearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.policy != null && message.hasOwnProperty("policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. + * Decodes an IamPolicySearchResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllIamPoliciesResponse.decode = function decode(reader, length) { + IamPolicySearchResult.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.asset.v1p1beta1.SearchAllIamPoliciesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + message.resource = reader.string(); break; - case 2: - message.nextPageToken = reader.string(); + case 3: + message.project = reader.string(); + break; + case 4: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10445,113 +10449,109 @@ }; /** - * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchAllIamPoliciesResponse message. + * Verifies an IamPolicySearchResult message. * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchAllIamPoliciesResponse.verify = function verify(message) { + IamPolicySearchResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult */ - SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult) return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); - } + var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult} message IamPolicySearchResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { + IamPolicySearchResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.results = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); return object; }; /** - * Converts this SearchAllIamPoliciesResponse to JSON. + * Converts this IamPolicySearchResult to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance * @returns {Object.} JSON object */ - SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { + IamPolicySearchResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchAllIamPoliciesResponse; + return IamPolicySearchResult; })(); return v1p1beta1; @@ -10566,267 +10566,226 @@ */ var v1p2beta1 = {}; - v1p2beta1.TemporalAsset = (function() { + v1p2beta1.AssetService = (function() { /** - * Properties of a TemporalAsset. + * Constructs a new AssetService service. * @memberof google.cloud.asset.v1p2beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; /** - * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset - * @constructor - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. */ - function TemporalAsset(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]]; - } + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); /** - * TemporalAsset window. - * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.prototype.window = null; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @instance + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed */ - TemporalAsset.prototype.deleted = false; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - TemporalAsset.prototype.asset = null; + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "GetFeed" }); /** - * Creates a new TemporalAsset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); - }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset 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.asset.v1p2beta1.AssetService#listFeeds}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse */ - TemporalAsset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.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.asset.v1p2beta1.TemporalAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset - * @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.asset.v1p2beta1.AssetService#updateFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a TemporalAsset message. - * @function verify - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - TemporalAsset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - return null; - }; + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) - return object; - var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); - } - return message; - }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - TemporalAsset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; - } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); - return object; - }; /** - * Converts this TemporalAsset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - TemporalAsset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return TemporalAsset; + return AssetService; })(); - v1p2beta1.TimeWindow = (function() { + v1p2beta1.CreateFeedRequest = (function() { /** - * Properties of a TimeWindow. + * Properties of a CreateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed */ /** - * Constructs a new TimeWindow. + * Constructs a new CreateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set */ - function TimeWindow(properties) { + function CreateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10834,88 +10793,101 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance */ - TimeWindow.prototype.startTime = null; + CreateFeedRequest.prototype.parent = ""; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance */ - TimeWindow.prototype.endTime = null; + CreateFeedRequest.prototype.feedId = ""; /** - * Creates a new TimeWindow instance using the specified properties. + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feed = null; + + /** + * Creates a new CreateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + CreateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && message.hasOwnProperty("feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest * @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) { + CreateFeedRequest.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.asset.v1p2beta1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.feedId = reader.string(); + break; + case 3: + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10926,263 +10898,206 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest * @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) { + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies a CreateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @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) { + CreateFeedRequest.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 (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); if (error) - return "endTime." + error; + return "feed." + error; } return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); } return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + CreateFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.parent = ""; + object.feedId = ""; + object.feed = 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); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this CreateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + CreateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return CreateFeedRequest; })(); - v1p2beta1.Asset = (function() { - - /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [ancestors] Asset ancestors - */ - - /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set - */ - function Asset(properties) { - this.ancestors = []; - 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]]; - } - - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.assetType = ""; + v1p2beta1.GetFeedRequest = (function() { /** - * Asset resource. - * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance + * Properties of a GetFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name */ - Asset.prototype.resource = null; /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance + * Constructs a new GetFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set */ - Asset.prototype.iamPolicy = null; + function GetFeedRequest(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]]; + } /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1p2beta1.Asset + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @instance */ - Asset.prototype.ancestors = $util.emptyArray; + GetFeedRequest.prototype.name = ""; /** - * Creates a new Asset instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance */ - Asset.create = function create(properties) { - return new Asset(properties); + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + GetFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + GetFeedRequest.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.asset.v1p2beta1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; default: reader.skipType(tag & 7); break; @@ -11192,310 +11107,184 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a GetFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + GetFeedRequest.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; - } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Asset(); + var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); if (object.name != null) message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.Asset} message Asset + * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + GetFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.ancestors = []; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; - } return object; }; /** - * Converts this Asset to JSON. + * Converts this GetFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + GetFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return GetFeedRequest; })(); - v1p2beta1.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - */ - - /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set - */ - function Resource(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]]; - } - - /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; + v1p2beta1.ListFeedsRequest = (function() { /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance + * Properties of a ListFeedsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent */ - Resource.prototype.resourceUrl = ""; /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance + * Constructs a new ListFeedsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set */ - Resource.prototype.parent = ""; + function ListFeedsRequest(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]]; + } /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1p2beta1.Resource + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @instance */ - Resource.prototype.data = null; + ListFeedsRequest.prototype.parent = ""; /** - * Creates a new Resource instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance */ - Resource.create = function create(properties) { - return new Resource(properties); + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + ListFeedsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + ListFeedsRequest.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.asset.v1p2beta1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: message.parent = reader.string(); break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -11505,355 +11294,316 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a ListFeedsRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + ListFeedsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; - } return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); - } return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.Resource} message Resource + * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + ListFeedsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; + if (options.defaults) object.parent = ""; - object.data = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this ListFeedsRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + ListFeedsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Resource; - })(); - - v1p2beta1.AssetService = (function() { - - /** - * Constructs a new AssetService service. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an AssetService - * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; - - /** - * Creates new AssetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. - */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef CreateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed - */ - - /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { - return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "CreateFeed" }); - - /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + }; + + return ListFeedsRequest; + })(); + + v1p2beta1.ListFeedsResponse = (function() { /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef GetFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Properties of a ListFeedsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds */ /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * Constructs a new ListFeedsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set */ - Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { - return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "GetFeed" }); + function ListFeedsResponse(properties) { + this.feeds = []; + 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]]; + } /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListFeedsResponse.prototype.feeds = $util.emptyArray; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef ListFeedsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse + * Creates a new ListFeedsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance */ + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { - return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); - }, "name", { value: "ListFeeds" }); + ListFeedsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef UpdateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ListFeedsResponse.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.asset.v1p2beta1.ListFeedsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { - return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "UpdateFeed" }); + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a ListFeedsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + ListFeedsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef DeleteFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse */ + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); + } + } + return message; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { - return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteFeed" }); + ListFeedsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); + } + return object; + }; - /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + /** + * Converts this ListFeedsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListFeedsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AssetService; + return ListFeedsResponse; })(); - v1p2beta1.CreateFeedRequest = (function() { + v1p2beta1.UpdateFeedRequest = (function() { /** - * Properties of a CreateFeedRequest. + * Properties of an UpdateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface ICreateFeedRequest - * @property {string|null} [parent] CreateFeedRequest parent - * @property {string|null} [feedId] CreateFeedRequest feedId - * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask */ /** - * Constructs a new CreateFeedRequest. + * Constructs a new UpdateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a CreateFeedRequest. - * @implements ICreateFeedRequest + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set */ - function CreateFeedRequest(properties) { + function UpdateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11861,101 +11611,88 @@ } /** - * CreateFeedRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest - * @instance - */ - CreateFeedRequest.prototype.parent = ""; - - /** - * CreateFeedRequest feedId. - * @member {string} feedId - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance */ - CreateFeedRequest.prototype.feedId = ""; + UpdateFeedRequest.prototype.feed = null; /** - * CreateFeedRequest feed. - * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance */ - CreateFeedRequest.prototype.feed = null; + UpdateFeedRequest.prototype.updateMask = null; /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance */ - CreateFeedRequest.create = function create(properties) { - return new CreateFeedRequest(properties); + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); }; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encode = function encode(message, writer) { + UpdateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.feedId != null && message.hasOwnProperty("feedId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decode = function decode(reader, length) { + UpdateFeedRequest.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.asset.v1p2beta1.CreateFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); break; case 2: - message.feedId = reader.string(); - break; - case 3: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11966,129 +11703,126 @@ }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFeedRequest message. + * Verifies an UpdateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFeedRequest.verify = function verify(message) { + UpdateFeedRequest.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.feedId != null && message.hasOwnProperty("feedId")) - if (!$util.isString(message.feedId)) - return "feedId: string expected"; if (message.feed != null && message.hasOwnProperty("feed")) { var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); if (error) return "feed." + 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 a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest */ - CreateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.feedId != null) - message.feedId = String(object.feedId); + var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); if (object.feed != null) { if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest + * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFeedRequest.toObject = function toObject(message, options) { + UpdateFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.feedId = ""; object.feed = null; + object.updateMask = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.feedId != null && message.hasOwnProperty("feedId")) - object.feedId = message.feedId; if (message.feed != null && message.hasOwnProperty("feed")) object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this UpdateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance * @returns {Object.} JSON object */ - CreateFeedRequest.prototype.toJSON = function toJSON() { + UpdateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFeedRequest; + return UpdateFeedRequest; })(); - v1p2beta1.GetFeedRequest = (function() { + v1p2beta1.DeleteFeedRequest = (function() { /** - * Properties of a GetFeedRequest. + * Properties of a DeleteFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IGetFeedRequest - * @property {string|null} [name] GetFeedRequest name + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name */ /** - * Constructs a new GetFeedRequest. + * Constructs a new DeleteFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a GetFeedRequest. - * @implements IGetFeedRequest + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set */ - function GetFeedRequest(properties) { + function DeleteFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12096,35 +11830,35 @@ } /** - * GetFeedRequest name. + * DeleteFeedRequest name. * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @instance */ - GetFeedRequest.prototype.name = ""; + DeleteFeedRequest.prototype.name = ""; /** - * Creates a new GetFeedRequest instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance */ - GetFeedRequest.create = function create(properties) { - return new GetFeedRequest(properties); + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); }; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encode = function encode(message, writer) { + DeleteFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) @@ -12133,33 +11867,33 @@ }; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decode = function decode(reader, length) { + DeleteFeedRequest.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.asset.v1p2beta1.GetFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12175,30 +11909,30 @@ }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetFeedRequest message. + * Verifies a DeleteFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetFeedRequest.verify = function verify(message) { + DeleteFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -12208,32 +11942,32 @@ }; /** - * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest */ - GetFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest + * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFeedRequest.toObject = function toObject(message, options) { + DeleteFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -12245,37 +11979,37 @@ }; /** - * Converts this GetFeedRequest to JSON. + * Converts this DeleteFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @instance * @returns {Object.} JSON object */ - GetFeedRequest.prototype.toJSON = function toJSON() { + DeleteFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetFeedRequest; + return DeleteFeedRequest; })(); - v1p2beta1.ListFeedsRequest = (function() { + v1p2beta1.OutputConfig = (function() { /** - * Properties of a ListFeedsRequest. + * Properties of an OutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @interface IListFeedsRequest - * @property {string|null} [parent] ListFeedsRequest parent + * @interface IOutputConfig + * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination */ /** - * Constructs a new ListFeedsRequest. + * Constructs a new OutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a ListFeedsRequest. - * @implements IListFeedsRequest + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig * @constructor - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set */ - function ListFeedsRequest(properties) { + function OutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12283,75 +12017,89 @@ } /** - * ListFeedsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance */ - ListFeedsRequest.prototype.parent = ""; + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ListFeedsRequest instance using the specified properties. + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance */ - ListFeedsRequest.create = function create(properties) { - return new ListFeedsRequest(properties); + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); }; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encode = function encode(message, writer) { + OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decode = function decode(reader, length) { + OutputConfig.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.asset.v1p2beta1.ListFeedsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12362,108 +12110,117 @@ }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + OutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsRequest message. + * Verifies an OutputConfig message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsRequest.verify = function verify(message) { + OutputConfig.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"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } return null; }; /** - * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig */ - ListFeedsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); + } return message; }; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest + * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsRequest.toObject = function toObject(message, options) { + OutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } return object; }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this OutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance * @returns {Object.} JSON object */ - ListFeedsRequest.prototype.toJSON = function toJSON() { + OutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsRequest; + return OutputConfig; })(); - v1p2beta1.ListFeedsResponse = (function() { + v1p2beta1.GcsDestination = (function() { /** - * Properties of a ListFeedsResponse. + * Properties of a GcsDestination. * @memberof google.cloud.asset.v1p2beta1 - * @interface IListFeedsResponse - * @property {Array.|null} [feeds] ListFeedsResponse feeds + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri */ /** - * Constructs a new ListFeedsResponse. + * Constructs a new GcsDestination. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a ListFeedsResponse. - * @implements IListFeedsResponse + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination * @constructor - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set */ - function ListFeedsResponse(properties) { - this.feeds = []; + function GcsDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12471,78 +12228,89 @@ } /** - * ListFeedsResponse feeds. - * @member {Array.} feeds - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance */ - ListFeedsResponse.prototype.feeds = $util.emptyArray; + GcsDestination.prototype.uri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * GcsDestination objectUri. + * @member {"uri"|undefined} objectUri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance */ - ListFeedsResponse.create = function create(properties) { - return new ListFeedsResponse(properties); + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); }; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encode = function encode(message, writer) { + GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feeds != null && message.feeds.length) - for (var i = 0; i < message.feeds.length; ++i) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); return writer; }; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decode = function decode(reader, length) { + GcsDestination.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.asset.v1p2beta1.ListFeedsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + message.uri = reader.string(); break; default: reader.skipType(tag & 7); @@ -12553,125 +12321,111 @@ }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + GcsDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsResponse message. + * Verifies a GcsDestination message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsResponse.verify = function verify(message) { + GcsDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.feeds != null && message.hasOwnProperty("feeds")) { - if (!Array.isArray(message.feeds)) - return "feeds: array expected"; - for (var i = 0; i < message.feeds.length; ++i) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); - if (error) - return "feeds." + error; - } + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; } return null; }; /** - * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination */ - ListFeedsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); - if (object.feeds) { - if (!Array.isArray(object.feeds)) - throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); - message.feeds = []; - for (var i = 0; i < object.feeds.length; ++i) { - if (typeof object.feeds[i] !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); - message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); - } - } + var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); return message; }; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse + * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsResponse.toObject = function toObject(message, options) { + GcsDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.feeds = []; - if (message.feeds && message.feeds.length) { - object.feeds = []; - for (var j = 0; j < message.feeds.length; ++j) - object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; } return object; }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this GcsDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance * @returns {Object.} JSON object */ - ListFeedsResponse.prototype.toJSON = function toJSON() { + GcsDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsResponse; + return GcsDestination; })(); - v1p2beta1.UpdateFeedRequest = (function() { + v1p2beta1.PubsubDestination = (function() { /** - * Properties of an UpdateFeedRequest. + * Properties of a PubsubDestination. * @memberof google.cloud.asset.v1p2beta1 - * @interface IUpdateFeedRequest - * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic */ /** - * Constructs a new UpdateFeedRequest. + * Constructs a new PubsubDestination. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an UpdateFeedRequest. - * @implements IUpdateFeedRequest + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination * @constructor - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set */ - function UpdateFeedRequest(properties) { + function PubsubDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12679,88 +12433,75 @@ } /** - * UpdateFeedRequest feed. - * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @instance - */ - UpdateFeedRequest.prototype.feed = null; - - /** - * UpdateFeedRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @instance */ - UpdateFeedRequest.prototype.updateMask = null; + PubsubDestination.prototype.topic = ""; /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance */ - UpdateFeedRequest.create = function create(properties) { - return new UpdateFeedRequest(properties); + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); }; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFeedRequest.encode = function encode(message, writer) { + PubsubDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); return writer; }; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFeedRequest.decode = function decode(reader, length) { + PubsubDestination.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.asset.v1p2beta1.UpdateFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.topic = reader.string(); break; default: reader.skipType(tag & 7); @@ -12771,126 +12512,107 @@ }; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateFeedRequest message. + * Verifies a PubsubDestination message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateFeedRequest.verify = function verify(message) { + PubsubDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); - if (error) - return "feed." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; return null; }; /** - * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination */ - UpdateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) return object; - var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); return message; }; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest + * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFeedRequest.toObject = function toObject(message, options) { + PubsubDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.feed = null; - object.updateMask = null; - } - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; return object; }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this PubsubDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @instance * @returns {Object.} JSON object */ - UpdateFeedRequest.prototype.toJSON = function toJSON() { + PubsubDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateFeedRequest; + return PubsubDestination; })(); - v1p2beta1.DeleteFeedRequest = (function() { + v1p2beta1.FeedOutputConfig = (function() { /** - * Properties of a DeleteFeedRequest. + * Properties of a FeedOutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @interface IDeleteFeedRequest - * @property {string|null} [name] DeleteFeedRequest name + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination */ /** - * Constructs a new DeleteFeedRequest. + * Constructs a new FeedOutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a DeleteFeedRequest. - * @implements IDeleteFeedRequest + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig * @constructor - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set */ - function DeleteFeedRequest(properties) { + function FeedOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12898,75 +12620,89 @@ } /** - * DeleteFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance */ - DeleteFeedRequest.prototype.name = ""; + FeedOutputConfig.prototype.pubsubDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + */ + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeedOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance */ - DeleteFeedRequest.create = function create(properties) { - return new DeleteFeedRequest(properties); + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); }; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encode = function encode(message, writer) { + FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decode = function decode(reader, length) { + FeedOutputConfig.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.asset.v1p2beta1.DeleteFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12977,107 +12713,123 @@ }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteFeedRequest message. + * Verifies a FeedOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteFeedRequest.verify = function verify(message) { + FeedOutputConfig.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"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } + } return null; }; /** - * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig */ - DeleteFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) return object; - var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); + } return message; }; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest + * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFeedRequest.toObject = function toObject(message, options) { + FeedOutputConfig.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; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; + } return object; }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this FeedOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance * @returns {Object.} JSON object */ - DeleteFeedRequest.prototype.toJSON = function toJSON() { + FeedOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteFeedRequest; + return FeedOutputConfig; })(); - v1p2beta1.OutputConfig = (function() { + v1p2beta1.Feed = (function() { /** - * Properties of an OutputConfig. + * Properties of a Feed. * @memberof google.cloud.asset.v1p2beta1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig */ /** - * Constructs a new OutputConfig. + * Constructs a new Feed. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a Feed. + * @implements IFeed * @constructor - * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set */ - function OutputConfig(properties) { + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13085,89 +12837,133 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - OutputConfig.prototype.gcsDestination = null; + Feed.prototype.name = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.assetNames = $util.emptyArray; /** - * OutputConfig destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + Feed.prototype.assetTypes = $util.emptyArray; /** - * Creates a new OutputConfig instance using the specified properties. + * Feed contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.contentType = 0; + + /** + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.feedOutputConfig = null; + + /** + * Creates a new Feed instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + Feed.create = function create(properties) { + return new Feed(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + Feed.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + Feed.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.asset.v1p2beta1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Feed(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); + message.name = reader.string(); + break; + case 2: + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13178,117 +12974,207 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + Feed.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a Feed message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + Feed.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); + if (error) + return "feedOutputConfig." + error; } return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) return object; - var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); + var message = new $root.google.cloud.asset.v1p2beta1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); } return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a Feed message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig + * @param {google.cloud.asset.v1p2beta1.Feed} message Feed * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + Feed.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + } + if (options.defaults) { + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this Feed to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + Feed.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return Feed; })(); - v1p2beta1.GcsDestination = (function() { + /** + * ContentType enum. + * @name google.cloud.asset.v1p2beta1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1p2beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; + })(); + + v1p2beta1.TemporalAsset = (function() { /** - * Properties of a GcsDestination. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1p2beta1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri + * @interface ITemporalAsset + * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset */ /** - * Constructs a new GcsDestination. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set */ - function GcsDestination(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13296,89 +13182,101 @@ } /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * TemporalAsset window. + * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - GcsDestination.prototype.uri = ""; + TemporalAsset.prototype.window = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; /** - * GcsDestination objectUri. - * @member {"uri"|undefined} objectUri - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * TemporalAsset asset. + * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), - set: $util.oneOfSetter($oneOfFields) - }); + TemporalAsset.prototype.asset = null; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decode = function decode(reader, length) { + TemporalAsset.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.asset.v1p2beta1.GcsDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13389,111 +13287,135 @@ }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsDestination message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsDestination.verify = function verify(message) { + TemporalAsset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; } return null; }; /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); + var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); + } return message; }; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination + * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsDestination.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this GcsDestination to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance * @returns {Object.} JSON object */ - GcsDestination.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsDestination; + return TemporalAsset; })(); - v1p2beta1.PubsubDestination = (function() { + v1p2beta1.TimeWindow = (function() { /** - * Properties of a PubsubDestination. + * Properties of a TimeWindow. * @memberof google.cloud.asset.v1p2beta1 - * @interface IPubsubDestination - * @property {string|null} [topic] PubsubDestination topic + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime */ /** - * Constructs a new PubsubDestination. + * Constructs a new TimeWindow. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a PubsubDestination. - * @implements IPubsubDestination + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set */ - function PubsubDestination(properties) { + function TimeWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13501,75 +13423,88 @@ } /** - * PubsubDestination topic. - * @member {string} topic - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @instance */ - PubsubDestination.prototype.topic = ""; + TimeWindow.prototype.startTime = null; /** - * Creates a new PubsubDestination instance using the specified properties. + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance */ - PubsubDestination.create = function create(properties) { - return new PubsubDestination(properties); + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); }; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encode = function encode(message, writer) { + TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decode = function decode(reader, length) { + 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.asset.v1p2beta1.PubsubDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = reader.string(); + 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); @@ -13580,107 +13515,131 @@ }; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + TimeWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubsubDestination message. + * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubsubDestination.verify = function verify(message) { + TimeWindow.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string 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 PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow */ - PubsubDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) - return object; - var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); - if (object.topic != null) - message.topic = String(object.topic); + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination + * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubsubDestination.toObject = function toObject(message, options) { + TimeWindow.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; + 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 PubsubDestination to JSON. + * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @instance * @returns {Object.} JSON object */ - PubsubDestination.prototype.toJSON = function toJSON() { + TimeWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubsubDestination; + return TimeWindow; })(); - v1p2beta1.FeedOutputConfig = (function() { + v1p2beta1.Asset = (function() { /** - * Properties of a FeedOutputConfig. + * Properties of an Asset. * @memberof google.cloud.asset.v1p2beta1 - * @interface IFeedOutputConfig - * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors */ /** - * Constructs a new FeedOutputConfig. + * Constructs a new Asset. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a FeedOutputConfig. - * @implements IFeedOutputConfig + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set */ - function FeedOutputConfig(properties) { + function Asset(properties) { + this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13688,89 +13647,130 @@ } /** - * FeedOutputConfig pubsubDestination. - * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance */ - FeedOutputConfig.prototype.pubsubDestination = null; + Asset.prototype.name = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; /** - * FeedOutputConfig destination. - * @member {"pubsubDestination"|undefined} destination - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * Asset resource. + * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance */ - Object.defineProperty(FeedOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + Asset.prototype.resource = null; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance */ - FeedOutputConfig.create = function create(properties) { - return new FeedOutputConfig(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) - $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decode = function decode(reader, length) { + Asset.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.asset.v1p2beta1.FeedOutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -13781,123 +13781,168 @@ }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FeedOutputConfig message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FeedOutputConfig.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); - if (error) - return "pubsubDestination." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; } return null; }; /** - * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset */ - FeedOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) return object; - var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); - if (object.pubsubDestination != null) { - if (typeof object.pubsubDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); + var message = new $root.google.cloud.asset.v1p2beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); } return message; }; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {google.cloud.asset.v1p2beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeedOutputConfig.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); - if (options.oneofs) - object.destination = "pubsubDestination"; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; } return object; }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance * @returns {Object.} JSON object */ - FeedOutputConfig.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FeedOutputConfig; + return Asset; })(); - v1p2beta1.Feed = (function() { + v1p2beta1.Resource = (function() { /** - * Properties of a Feed. + * Properties of a Resource. * @memberof google.cloud.asset.v1p2beta1 - * @interface IFeed - * @property {string|null} [name] Feed name - * @property {Array.|null} [assetNames] Feed assetNames - * @property {Array.|null} [assetTypes] Feed assetTypes - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType - * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data */ /** - * Constructs a new Feed. + * Constructs a new Resource. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a Feed. - * @implements IFeed + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set */ - function Feed(properties) { - this.assetNames = []; - this.assetTypes = []; + function Resource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13905,133 +13950,140 @@ } /** - * Feed name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.Feed + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - Feed.prototype.name = ""; + Resource.prototype.version = ""; /** - * Feed assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1p2beta1.Feed + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - Feed.prototype.assetNames = $util.emptyArray; + Resource.prototype.discoveryDocumentUri = ""; /** - * Feed assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p2beta1.Feed + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - Feed.prototype.assetTypes = $util.emptyArray; + Resource.prototype.discoveryName = ""; /** - * Feed contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.Feed + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - Feed.prototype.contentType = 0; + Resource.prototype.resourceUrl = ""; /** - * Feed feedOutputConfig. - * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig - * @memberof google.cloud.asset.v1p2beta1.Feed + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - Feed.prototype.feedOutputConfig = null; + Resource.prototype.parent = ""; /** - * Creates a new Feed instance using the specified properties. + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance */ - Feed.create = function create(properties) { - return new Feed(properties); + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decode = function decode(reader, length) { + Resource.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.asset.v1p2beta1.Feed(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.version = reader.string(); break; case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); + message.discoveryDocumentUri = reader.string(); break; case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); + message.discoveryName = reader.string(); break; case 4: - message.contentType = reader.int32(); + message.resourceUrl = reader.string(); break; case 5: - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14042,185 +14094,133 @@ }; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Feed message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Feed.verify = function verify(message) { + Resource.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); if (error) - return "feedOutputConfig." + error; + return "data." + error; } return null; }; /** - * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource */ - Feed.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Feed(); - if (object.name != null) - message.name = String(object.name); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - } - if (object.feedOutputConfig != null) { - if (typeof object.feedOutputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); + var message = new $root.google.cloud.asset.v1p2beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; }; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.Feed} message Feed + * @param {google.cloud.asset.v1p2beta1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Feed.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.assetNames = []; - object.assetTypes = []; - } if (options.defaults) { - object.name = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.feedOutputConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; - } - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); return object; }; /** - * Converts this Feed to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance * @returns {Object.} JSON object */ - Feed.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Feed; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1p2beta1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - */ - v1p2beta1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - return values; + return Resource; })(); return v1p2beta1; @@ -14241,30 +14241,26 @@ */ var api = {}; - api.ResourceDescriptor = (function() { + api.Http = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a Http. * @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 + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14272,143 +14268,91 @@ } /** - * 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 + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.plural = ""; + Http.prototype.rules = $util.emptyArray; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.singular = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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: - message.type = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); 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(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -14419,285 +14363,353 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a Http message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + Http.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.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.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"; + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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; + 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.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + Http.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]; + 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.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; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + return Http; + })(); + + api.HttpRule = (function() { + /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @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 + * 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 */ - 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; - })(); + /** + * 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 = ""; - api.ResourceReference = (function() { + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance */ + HttpRule.prototype.body = ""; /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance */ - 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]]; - } + HttpRule.prototype.responseBody = ""; /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.type = ""; + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.childType = ""; + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - message.childType = reader.string(); + 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); @@ -14708,118 +14720,240 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + HttpRule.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return HttpRule; })(); - api.Http = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a Http. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14827,91 +14961,88 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.rules = $util.emptyArray; + CustomHttpPattern.prototype.kind = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - Http.create = function create(properties) { - return new Http(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + CustomHttpPattern.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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.kind = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -14922,143 +15053,144 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + CustomHttpPattern.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"; + 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 Http message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.Http} message Http + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + CustomHttpPattern.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 (options.defaults) { + object.kind = ""; + object.path = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + 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 Http to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return CustomHttpPattern; })(); - api.HttpRule = (function() { + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 HttpRule. + * Properties of a ResourceDescriptor. * @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 + * @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 HttpRule. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15066,209 +15198,143 @@ } /** - * 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 + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.patch = ""; + ResourceDescriptor.prototype.type = ""; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.custom = null; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.body = ""; + ResourceDescriptor.prototype.nameField = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.responseBody = ""; + ResourceDescriptor.prototype.history = 0; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceDescriptor.prototype.plural = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceDescriptor.prototype.singular = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; case 3: - message.put = reader.string(); + message.nameField = reader.string(); break; case 4: - message.post = reader.string(); + message.history = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.plural = 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())); + message.singular = reader.string(); break; default: reader.skipType(tag & 7); @@ -15279,240 +15345,196 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + ResourceDescriptor.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.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.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; + 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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); + 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.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]); - } + 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 HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.additionalBindings = []; + object.pattern = []; 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"; + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - 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.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.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15520,88 +15542,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -15612,118 +15634,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + 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 CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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; + return ResourceReference; })(); return api; @@ -20936,8 +20936,8 @@ * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** @@ -21014,20 +21014,20 @@ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** * Creates a new FieldOptions instance using the specified properties. @@ -21133,9 +21133,6 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -21146,6 +21143,9 @@ } 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; @@ -21220,11 +21220,6 @@ return "uninterpretedOption." + error; } } - 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; - } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -21241,6 +21236,11 @@ 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; }; @@ -21302,11 +21302,6 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - 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"]); - } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -21340,6 +21335,11 @@ 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; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 4568a83f1ea..c1e58442a51 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -8,100 +8,15 @@ "nested": { "v1": { "options": { - "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.Asset.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1;asset", "java_multiple_files": true, - "java_outer_classname": "AssetServiceProto", + "java_outer_classname": "AssetProto", "java_package": "com.google.cloud.asset.v1", - "php_namespace": "Google\\Cloud\\Asset\\V1" + "php_namespace": "Google\\Cloud\\Asset\\V1", + "cc_enable_arenas": true }, "nested": { - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { - "options": { - "(google.api.resource).type": "cloudasset.googleapis.com/Asset", - "(google.api.resource).pattern": "*" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "assetType": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - }, - "iamPolicy": { - "type": "google.iam.v1.Policy", - "id": 4 - }, - "ancestors": { - "rule": "repeated", - "type": "string", - "id": 10 - } - } - }, - "Resource": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { - "type": "string", - "id": 3 - }, - "resourceUrl": { - "type": "string", - "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 - } - } - }, "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -470,20 +385,7 @@ } } } - } - } - }, - "v1beta1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Asset.V1Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetServiceProto", - "java_package": "com.google.cloud.asset.v1beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1beta1" - }, - "nested": { + }, "TemporalAsset": { "fields": { "window": { @@ -533,6 +435,11 @@ "iamPolicy": { "type": "google.iam.v1.Policy", "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 } } }, @@ -563,7 +470,20 @@ "id": 6 } } - }, + } + } + }, + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1beta1", + "cc_enable_arenas": true + }, + "nested": { "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -717,21 +637,40 @@ "RESOURCE": 1, "IAM_POLICY": 2 } - } - } - }, - "v1p1beta1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Asset.V1P1Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetServiceProto", - "java_package": "com.google.cloud.asset.v1p1beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1" - }, - "nested": { - "StandardResourceMetadata": { + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, "fields": { "name": { "type": "string", @@ -741,41 +680,57 @@ "type": "string", "id": 2 }, - "project": { - "type": "string", + "resource": { + "type": "Resource", "id": 3 }, - "displayName": { - "type": "string", + "iamPolicy": { + "type": "google.iam.v1.Policy", "id": 4 - }, - "description": { - "type": "string", - "id": 5 - }, - "additionalAttributes": { - "rule": "repeated", - "type": "string", - "id": 10 } } }, - "IamPolicySearchResult": { + "Resource": { "fields": { - "resource": { + "version": { "type": "string", "id": 1 }, - "project": { + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { "type": "string", "id": 3 }, - "policy": { - "type": "google.iam.v1.Policy", + "resourceUrl": { + "type": "string", "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 } } - }, + } + } + }, + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1", + "cc_enable_arenas": true + }, + "nested": { "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -1011,49 +966,8 @@ "id": 2 } } - } - } - }, - "v1p2beta1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Asset.V1p2Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetServiceProto", - "java_package": "com.google.cloud.asset.v1p2beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1p2Beta1" - }, - "nested": { - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } }, - "Asset": { + "StandardResourceMetadata": { "fields": { "name": { "type": "string", @@ -1063,49 +977,54 @@ "type": "string", "id": 2 }, - "resource": { - "type": "Resource", + "project": { + "type": "string", "id": 3 }, - "iamPolicy": { - "type": "google.iam.v1.Policy", + "displayName": { + "type": "string", "id": 4 }, - "ancestors": { + "description": { + "type": "string", + "id": 5 + }, + "additionalAttributes": { "rule": "repeated", "type": "string", - "id": 6 + "id": 10 } } }, - "Resource": { + "IamPolicySearchResult": { "fields": { - "version": { + "resource": { "type": "string", "id": 1 }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { + "project": { "type": "string", "id": 3 }, - "resourceUrl": { - "type": "string", + "policy": { + "type": "google.iam.v1.Policy", "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 } } - }, + } + } + }, + "v1p2beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.v1p2beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", + "cc_enable_arenas": true + }, + "nested": { "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -1339,6 +1258,87 @@ "RESOURCE": 1, "IAM_POLICY": 2 } + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } } } } @@ -1348,80 +1348,14 @@ }, "api": { "options": { - "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "FieldBehaviorProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI" + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true }, "nested": { - "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 - } - } - }, "http": { "type": "HttpRule", "id": 72295728, @@ -1540,6 +1474,72 @@ "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 + } + } } } }, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 611eaf99c74..663dbbd60b4 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -141,16 +141,15 @@ export class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assetPathTemplate: new gaxModule.PathTemplate('*'), - projectFeedPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/feeds/{feed}' - ), folderFeedPathTemplate: new gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), organizationFeedPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), + projectFeedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), }; // This API contains "long-running operations", which return a @@ -911,53 +910,6 @@ export class AssetServiceClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified asset resource name string. - * - * @returns {string} Resource name string. - */ - assetPath() { - return this._pathTemplates.assetPathTemplate.render({}); - } - - /** - * Return a fully-qualified projectFeed resource name string. - * - * @param {string} project - * @param {string} feed - * @returns {string} Resource name string. - */ - projectFeedPath(project: string, feed: string) { - return this._pathTemplates.projectFeedPathTemplate.render({ - project, - feed, - }); - } - - /** - * Parse the project from ProjectFeed resource. - * - * @param {string} projectFeedName - * A fully-qualified path representing project_feed resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) - .project; - } - - /** - * Parse the feed from ProjectFeed resource. - * - * @param {string} projectFeedName - * A fully-qualified path representing project_feed resource. - * @returns {string} A string representing the feed. - */ - matchFeedFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) - .feed; - } - /** * Return a fully-qualified folderFeed resource name string. * @@ -1036,6 +988,44 @@ export class AssetServiceClient { ).feed; } + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project: string, feed: string) { + return this._pathTemplates.projectFeedPathTemplate.render({ + project, + feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .feed; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 3f8fd209c29..37185e2cc13 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,4 +1,4 @@ [ - "../../protos/google/cloud/asset/v1/assets.proto", - "../../protos/google/cloud/asset/v1/asset_service.proto" + "../../protos/google/cloud/asset/v1/asset_service.proto", + "../../protos/google/cloud/asset/v1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index b123bc3bac6..0a8ee82024b 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -40,7 +40,6 @@ const version = require('../../../package.json').version; export class AssetServiceClient { private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; auth: gax.GoogleAuth; operationsClient: gax.OperationsClient; @@ -137,13 +136,6 @@ export class AssetServiceClient { opts.fallback ? 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 = { - assetPathTemplate: new gaxModule.PathTemplate('*'), - }; - // 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. @@ -504,18 +496,6 @@ export class AssetServiceClient { }); return this._innerApiCalls.exportAssets(request, options, callback); } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified asset resource name string. - * - * @returns {string} Resource name string. - */ - assetPath() { - return this._pathTemplates.assetPathTemplate.render({}); - } /** * Terminate the GRPC channel and close the client. diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json index e843e78ee54..6c8ef83a9be 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json @@ -1,4 +1,4 @@ [ - "../../protos/google/cloud/asset/v1beta1/assets.proto", - "../../protos/google/cloud/asset/v1beta1/asset_service.proto" + "../../protos/google/cloud/asset/v1beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 01acc772832..95d7889af6c 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -315,12 +315,13 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the supported asset types. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The value of this field is capped at 2000. If set to the - * zero value, server will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from + * to this method. `page_token` must be the value of `next_page_token` from * the previous response. The values of all other method parameters, must be * identical to those in the previous call. * @param {object} [options] @@ -401,12 +402,13 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the supported asset types. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The value of this field is capped at 2000. If set to the - * zero value, server will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from + * to this method. `page_token` must be the value of `next_page_token` from * the previous response. The values of all other method parameters, must be * identical to those in the previous call. * @param {object} [options] @@ -416,9 +418,10 @@ export class AssetServiceClient { */ searchResourcesStream( request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; const callSettings = new gax.CallSettings(options); return this._descriptors.page.searchResources.createStream( this._innerApiCalls.searchResources as gax.GaxCall, @@ -462,9 +465,10 @@ export class AssetServiceClient { * * "policy:myuser@mydomain.com" * * "policy:(myuser@mydomain.com viewer)" * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The maximum is 2000. If set to the zero value, the server - * will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, retrieve the next batch of results from the preceding call to * this method. `page_token` must be the value of `next_page_token` from the @@ -548,9 +552,10 @@ export class AssetServiceClient { * * "policy:myuser@mydomain.com" * * "policy:(myuser@mydomain.com viewer)" * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The maximum is 2000. If set to the zero value, the server - * will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, retrieve the next batch of results from the preceding call to * this method. `page_token` must be the value of `next_page_token` from the @@ -563,9 +568,10 @@ export class AssetServiceClient { */ searchIamPoliciesStream( request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options?: gax.CallOptions | {} + options?: gax.CallOptions ): Transform { request = request || {}; + options = options || {}; const callSettings = new gax.CallSettings(options); return this._descriptors.page.searchIamPolicies.createStream( this._innerApiCalls.searchIamPolicies as gax.GaxCall, @@ -614,9 +620,10 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the supported asset types. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The value of this field is capped at 2000. If set to the - * zero value, server will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the preceding call * to this method. `page_token` must be the value of `next_page_token` from @@ -707,9 +714,10 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the supported asset types. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The value of this field is capped at 2000. If set to the - * zero value, server will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the preceding call * to this method. `page_token` must be the value of `next_page_token` from @@ -722,9 +730,17 @@ export class AssetServiceClient { */ searchAllResourcesStream( request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions | {} + 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({ + scope: request.scope || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.searchAllResources.createStream( this._innerApiCalls.searchAllResources as gax.GaxCall, @@ -773,9 +789,10 @@ export class AssetServiceClient { * * "policy:myuser@mydomain.com" * * "policy:(myuser@mydomain.com viewer)" * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The maximum is 2000. If set to the zero value, the server - * will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, retrieve the next batch of results from the preceding call to * this method. `page_token` must be the value of `next_page_token` from the @@ -866,9 +883,10 @@ export class AssetServiceClient { * * "policy:myuser@mydomain.com" * * "policy:(myuser@mydomain.com viewer)" * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Returned results may be fewer - * than requested. The maximum is 2000. If set to the zero value, the server - * will pick an appropriate default. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] * Optional. If present, retrieve the next batch of results from the preceding call to * this method. `page_token` must be the value of `next_page_token` from the @@ -881,9 +899,17 @@ export class AssetServiceClient { */ searchAllIamPoliciesStream( request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions | {} + 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({ + scope: request.scope || '', + }); const callSettings = new gax.CallSettings(options); return this._descriptors.page.searchAllIamPolicies.createStream( this._innerApiCalls.searchAllIamPolicies as gax.GaxCall, diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json index 31c1cf27e9d..4eba2431088 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json @@ -1,4 +1,4 @@ [ - "../../protos/google/cloud/asset/v1p1beta1/assets.proto", - "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto" + "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p1beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index b57241e9943..c3bb3235020 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -139,15 +139,15 @@ export class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectFeedPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/feeds/{feed}' - ), folderFeedPathTemplate: new gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), organizationFeedPathTemplate: new gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), + projectFeedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), }; // Put together the default options sent with requests. @@ -660,44 +660,6 @@ export class AssetServiceClient { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified projectFeed resource name string. - * - * @param {string} project - * @param {string} feed - * @returns {string} Resource name string. - */ - projectFeedPath(project: string, feed: string) { - return this._pathTemplates.projectFeedPathTemplate.render({ - project, - feed, - }); - } - - /** - * Parse the project from ProjectFeed resource. - * - * @param {string} projectFeedName - * A fully-qualified path representing project_feed resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) - .project; - } - - /** - * Parse the feed from ProjectFeed resource. - * - * @param {string} projectFeedName - * A fully-qualified path representing project_feed resource. - * @returns {string} A string representing the feed. - */ - matchFeedFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) - .feed; - } - /** * Return a fully-qualified folderFeed resource name string. * @@ -776,6 +738,44 @@ export class AssetServiceClient { ).feed; } + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project: string, feed: string) { + return this._pathTemplates.projectFeedPathTemplate.render({ + project, + feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .feed; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json index 33e15d2df28..060b459873e 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json @@ -1,4 +1,4 @@ [ - "../../protos/google/cloud/asset/v1p2beta1/assets.proto", - "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto" + "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p2beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata new file mode 100644 index 00000000000..239eb264e84 --- /dev/null +++ b/packages/google-cloud-asset/synth.metadata @@ -0,0 +1,58 @@ +{ + "updateTime": "2020-02-08T12:09:13.326183Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e7d8a694f4559201e6913f6610069cb08b39274e", + "internalRef": "293903652" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2020.2.4" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p2beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts index 5a87d233785..f56860b8aa8 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts @@ -110,6 +110,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -132,6 +133,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -156,6 +158,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -178,6 +181,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -202,6 +206,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -224,6 +229,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -248,6 +254,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -270,6 +277,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -344,6 +352,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -366,6 +375,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -390,6 +400,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -419,6 +430,7 @@ describe('v1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts index a403153c98c..ad8df628733 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts @@ -112,6 +112,7 @@ describe('v1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -134,6 +135,7 @@ describe('v1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -158,6 +160,7 @@ describe('v1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -187,6 +190,7 @@ describe('v1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts index 1c0bf79c478..28e8691c20e 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -102,7 +102,7 @@ describe('v1p1beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.searchResources = ( actualRequest: {}, @@ -121,7 +121,7 @@ describe('v1p1beta1.AssetServiceClient', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); describe('searchIamPolicies', () => { @@ -159,7 +159,7 @@ describe('v1p1beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.searchIamPolicies = ( actualRequest: {}, @@ -178,7 +178,7 @@ describe('v1p1beta1.AssetServiceClient', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); describe('searchAllResources', () => { @@ -189,6 +189,7 @@ describe('v1p1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; + request.scope = ''; // Mock response const expectedResponse = {}; // Mock Grpc layer @@ -215,8 +216,9 @@ describe('v1p1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; + request.scope = ''; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.searchAllResources = ( actualRequest: {}, @@ -235,7 +237,7 @@ describe('v1p1beta1.AssetServiceClient', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); describe('searchAllIamPolicies', () => { @@ -246,6 +248,7 @@ describe('v1p1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; + request.scope = ''; // Mock response const expectedResponse = {}; // Mock Grpc layer @@ -272,8 +275,9 @@ describe('v1p1beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; + request.scope = ''; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.searchAllIamPolicies = ( actualRequest: {}, @@ -292,7 +296,7 @@ describe('v1p1beta1.AssetServiceClient', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); }); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts index 98e7b145c75..02fd1b88b57 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts @@ -91,6 +91,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -113,6 +114,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -137,6 +139,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -159,6 +162,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -183,6 +187,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -205,6 +210,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -279,6 +285,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -301,6 +308,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer From 05d984f2c7399094fc720543bc6dd29c2eb0325c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 12:49:48 -0800 Subject: [PATCH 174/429] chore: release 2.0.1 (#262) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 50279bde022..96cfdfe567a 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [2.0.1](https://www.github.com/googleapis/nodejs-asset/compare/v2.0.0...v2.0.1) (2020-02-10) + + +### Bug Fixes + +* useless path template methods removed ([af1c939](https://www.github.com/googleapis/nodejs-asset/commit/af1c9398a284e62346758a1ce29f88e5f6692e67)) + ## [2.0.0](https://www.github.com/googleapis/nodejs-asset/compare/v1.6.1...v2.0.0) (2020-01-30) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 040d4292382..6dd1fd12843 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "2.0.0", + "version": "2.0.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 82002017337..3b89e34bd66 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^2.0.0", + "@google-cloud/asset": "^2.0.1", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^15.0.0" From 29fe2740b3666ade5e3d735f5fd593b6ddee666c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 12 Feb 2020 15:20:17 -0800 Subject: [PATCH 175/429] build: add GitHub actions config for unit tests (#263) --- packages/google-cloud-asset/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 6dd1fd12843..b937f776cf3 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -39,7 +39,8 @@ "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" + "test": "c8 mocha build/test", + "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { "google-gax": "^1.14.1", From 9ebf4d0d752c1a7a3992e9aff8cd6040f63ccf21 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 12 Feb 2020 20:30:19 -0800 Subject: [PATCH 176/429] feat: bump release level to ga (#264) --- packages/google-cloud-asset/.repo-metadata.json | 2 +- packages/google-cloud-asset/README.md | 11 ++++++----- packages/google-cloud-asset/synth.metadata | 14 +++++++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index e36b2288b3f..a9c50b76169 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", "client_documentation": "https://googleapis.dev/nodejs/asset/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-asset", "distribution_name": "@google-cloud/asset", diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 380d1e3aa20..f4ca5737aae 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -4,7 +4,7 @@ # [Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) @@ -112,11 +112,12 @@ also contains samples. This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **General Availability (GA)**. This means it +is 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 **GA** libraries +are addressed with the highest priority. -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. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 239eb264e84..65fbc45acda 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,12 +1,20 @@ { - "updateTime": "2020-02-08T12:09:13.326183Z", + "updateTime": "2020-02-12T21:58:22.717995Z", "sources": [ + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "1672f14370c3d868439c09a8b2dda6ed4735f640" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e7d8a694f4559201e6913f6610069cb08b39274e", - "internalRef": "293903652" + "sha": "2c17ac33b226194041155bb5340c3f34733f1b3a", + "internalRef": "294734008", + "log": "2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" } }, { From a71493c9521afe5985213fe3e44f841136a8f239 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2020 12:42:44 -0800 Subject: [PATCH 177/429] chore: release 2.1.0 (#265) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 96cfdfe567a..92b9830fe16 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [2.1.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.0.1...v2.1.0) (2020-02-13) + + +### Features + +* bump release level to ga ([#264](https://www.github.com/googleapis/nodejs-asset/issues/264)) ([b432a76](https://www.github.com/googleapis/nodejs-asset/commit/b432a76f80b0499125cd091135bc1f215dbaae64)) + ### [2.0.1](https://www.github.com/googleapis/nodejs-asset/compare/v2.0.0...v2.0.1) (2020-02-10) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b937f776cf3..21af1d44a8d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "2.0.1", + "version": "2.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 3b89e34bd66..ffacf059a8a 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^2.0.1", + "@google-cloud/asset": "^2.1.0", "@google-cloud/storage": "^4.0.0", "uuid": "^3.3.2", "yargs": "^15.0.0" From 3a3fcb4d5e58f7892eaeea10b7a3efe82cc011d8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Feb 2020 21:34:29 +0100 Subject: [PATCH 178/429] fix(deps): update dependency uuid to v7 --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ffacf059a8a..4bea330294b 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -17,7 +17,7 @@ "dependencies": { "@google-cloud/asset": "^2.1.0", "@google-cloud/storage": "^4.0.0", - "uuid": "^3.3.2", + "uuid": "^7.0.0", "yargs": "^15.0.0" }, "devDependencies": { From de7581d2685fa0b3e24daf5fb1f0c4d45bb1f0da Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 26 Feb 2020 15:00:32 -0800 Subject: [PATCH 179/429] feat: export protos in src/index.ts --- packages/google-cloud-asset/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 41201327fc4..7f0992d1036 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -25,3 +25,5 @@ export {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; From 1c7bc195dac31f011a03e0b7d40ef62b3173dd44 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 11:52:39 -0800 Subject: [PATCH 180/429] chore: update jsdoc.js (#274) --- packages/google-cloud-asset/.jsdoc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 970aa2e9594..0b2d5ac7806 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -36,11 +36,14 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/asset', - theme: 'lumen' + theme: 'lumen', + default: { + "outputSourceFiles": false + } }, markdown: { idInHeadings: true From 4e216039ab3c556e9981c67beb6c7bb045edcc7f Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 21:40:54 -0800 Subject: [PATCH 181/429] chore: correct .jsdoc.js protos and double quotes (#276) --- packages/google-cloud-asset/.jsdoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 0b2d5ac7806..73b9551818e 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -31,7 +31,8 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'build/src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, @@ -42,7 +43,7 @@ module.exports = { systemName: '@google-cloud/asset', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { From 3552b6da882263bd5208c84a835fa7cdbfb07f2c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2020 19:54:10 +0000 Subject: [PATCH 182/429] chore: release 2.2.0 (#271) :robot: I have created a release \*beep\* \*boop\* --- ## [2.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.1.0...v2.2.0) (2020-02-27) ### Features * export protos in src/index.ts ([8f5e942](https://www.github.com/googleapis/nodejs-asset/commit/8f5e942bbe170dd2835c40c1d4354e822e2cbbce)) ### Bug Fixes * **deps:** update dependency uuid to v7 ([d83c322](https://www.github.com/googleapis/nodejs-asset/commit/d83c322d75e0b607cf019a837a040137a8925356)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-asset/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 92b9830fe16..b9d1dfc1637 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [2.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.1.0...v2.2.0) (2020-02-27) + + +### Features + +* export protos in src/index.ts ([8f5e942](https://www.github.com/googleapis/nodejs-asset/commit/8f5e942bbe170dd2835c40c1d4354e822e2cbbce)) + + +### Bug Fixes + +* **deps:** update dependency uuid to v7 ([d83c322](https://www.github.com/googleapis/nodejs-asset/commit/d83c322d75e0b607cf019a837a040137a8925356)) + ## [2.1.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.0.1...v2.1.0) (2020-02-13) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 21af1d44a8d..3ad8fabc021 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "2.1.0", + "version": "2.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 4bea330294b..b0dd96d8803 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^2.1.0", + "@google-cloud/asset": "^2.2.0", "@google-cloud/storage": "^4.0.0", "uuid": "^7.0.0", "yargs": "^15.0.0" From 2ff0fb9b6c7ad05df0da0f31ac06ee4e2c52f911 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Fri, 28 Feb 2020 21:13:18 -0800 Subject: [PATCH 183/429] chore: match jsdoc with macro license (#278) --- packages/google-cloud-asset/.jsdoc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 73b9551818e..61bbaaa9561 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -12,6 +12,9 @@ // 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'; From 10c0af9c4da2347d14fe2ea5bbbd5553f6206258 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 29 Feb 2020 10:25:34 -0800 Subject: [PATCH 184/429] feat!: removed SearchResources and SearchIamPolicies from v1p1beta1 client --- .../cloud/asset/v1p1beta1/asset_service.proto | 96 -- .../google-cloud-asset/protos/protos.d.ts | 456 ------- packages/google-cloud-asset/protos/protos.js | 1075 ----------------- .../google-cloud-asset/protos/protos.json | 114 -- .../src/v1p1beta1/asset_service_client.ts | 312 ----- .../asset_service_client_config.json | 10 - packages/google-cloud-asset/synth.metadata | 15 +- .../test/gapic-asset_service-v1p1beta1.ts | 114 -- 8 files changed, 4 insertions(+), 2188 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto index 2083e45706c..c75ce7adf0e 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -34,22 +34,6 @@ service AssetService { option (google.api.default_host) = "cloudasset.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - // Searches resources which are accessible with .get permission. - rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) { - option (google.api.http) = { - get: "/v1p1beta1/resources:search" - }; - option (google.api.method_signature) = "scope,query,asset_types"; - } - - // Searches IAM policies which are accessible with .getIamPolicy permission. - rpc SearchIamPolicies(SearchIamPoliciesRequest) returns (SearchIamPoliciesResponse) { - option (google.api.http) = { - get: "/v1p1beta1/iamPolicies:search" - }; - option (google.api.method_signature) = "scope,query"; - } - // Searches all the resources under a given accessible CRM scope // (project/folder/organization). This RPC gives callers // especially admins the ability to search all the resources under a scope, @@ -77,86 +61,6 @@ service AssetService { } } -// Search resource request. -message SearchResourcesRequest { - // Required. The relative name of an asset. The search is limited to the resources - // within the `scope`. The allowed value must be: - // * Organization number (such as "organizations/123") - // * Folder number(such as "folders/1234") - // * Project number (such as "projects/12345") - string scope = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The query statement. - string query = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of asset types that this request searches for. If empty, it will - // search all the supported asset types. - repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page size for search result pagination. Page size is capped at 500 even - // if a larger value is given. If set to zero, server will pick an appropriate - // default. Returned results may be fewer than requested. When this happens, - // there could be more results as long as `next_page_token` is returned. - int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, then retrieve the next batch of results from the preceding call - // to this method. `page_token` must be the value of `next_page_token` from - // the previous response. The values of all other method parameters, must be - // identical to those in the previous call. - string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Search resource response. -message SearchResourcesResponse { - // A list of resource that match the search query. - repeated StandardResourceMetadata results = 1; - - // If there are more results than those appearing in this response, then - // `next_page_token` is included. To get the next set of results, call this - // method again using the value of `next_page_token` as `page_token`. - string next_page_token = 2; -} - -// Search IAM policies request. -message SearchIamPoliciesRequest { - // Required. The relative name of an asset. The search is limited to the resources - // within the `scope`. The allowed value must be: - // * Organization number (such as "organizations/123") - // * Folder number(such as "folders/1234") - // * Project number (such as "projects/12345") - string scope = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The query statement. - // Examples: - // * "policy:myuser@mydomain.com" - // * "policy:(myuser@mydomain.com viewer)" - string query = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page size for search result pagination. Page size is capped at 500 even - // if a larger value is given. If set to zero, server will pick an appropriate - // default. Returned results may be fewer than requested. When this happens, - // there could be more results as long as `next_page_token` is returned. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, retrieve the next batch of results from the preceding call to - // this method. `page_token` must be the value of `next_page_token` from the - // previous response. The values of all other method parameters must be - // identical to those in the previous call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Search IAM policies response. -message SearchIamPoliciesResponse { - // A list of IamPolicy that match the search query. Related information such - // as the associated resource is returned along with the policy. - repeated IamPolicySearchResult results = 1; - - // Set if there are more results than those appearing in this response; to get - // the next set of results, call this method again, using this value as the - // `page_token`. - string next_page_token = 2; -} - // Search all resources request. message SearchAllResourcesRequest { // Required. The relative name of an asset. The search is limited to the resources diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 3396171ee31..9788e56fd5c 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -3328,34 +3328,6 @@ export namespace google { */ public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; - /** - * Calls SearchResources. - * @param request SearchResourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse - */ - public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback): void; - - /** - * Calls SearchResources. - * @param request SearchResourcesRequest message or plain object - * @returns Promise - */ - public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): Promise; - - /** - * Calls SearchIamPolicies. - * @param request SearchIamPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse - */ - public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback): void; - - /** - * Calls SearchIamPolicies. - * @param request SearchIamPoliciesRequest message or plain object - * @returns Promise - */ - public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): Promise; - /** * Calls SearchAllResources. * @param request SearchAllResourcesRequest message or plain object @@ -3387,20 +3359,6 @@ export namespace google { namespace AssetService { - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. - * @param error Error, if any - * @param [response] SearchResourcesResponse - */ - type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchResourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. - * @param error Error, if any - * @param [response] SearchIamPoliciesResponse - */ - type SearchIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) => void; - /** * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. * @param error Error, if any @@ -3416,420 +3374,6 @@ export namespace google { type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) => void; } - /** Properties of a SearchResourcesRequest. */ - interface ISearchResourcesRequest { - - /** SearchResourcesRequest scope */ - scope?: (string|null); - - /** SearchResourcesRequest query */ - query?: (string|null); - - /** SearchResourcesRequest assetTypes */ - assetTypes?: (string[]|null); - - /** SearchResourcesRequest pageSize */ - pageSize?: (number|null); - - /** SearchResourcesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchResourcesRequest. */ - class SearchResourcesRequest implements ISearchResourcesRequest { - - /** - * Constructs a new SearchResourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest); - - /** SearchResourcesRequest scope. */ - public scope: string; - - /** SearchResourcesRequest query. */ - public query: string; - - /** SearchResourcesRequest assetTypes. */ - public assetTypes: string[]; - - /** SearchResourcesRequest pageSize. */ - public pageSize: number; - - /** SearchResourcesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchResourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResourcesRequest instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): google.cloud.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @param message SearchResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @param message SearchResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResourcesRequest - * @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.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResourcesRequest - * @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.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Verifies a SearchResourcesRequest 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. - * @param message SearchResourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SearchResourcesResponse. */ - interface ISearchResourcesResponse { - - /** SearchResourcesResponse results */ - results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); - - /** SearchResourcesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchResourcesResponse. */ - class SearchResourcesResponse implements ISearchResourcesResponse { - - /** - * Constructs a new SearchResourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse); - - /** SearchResourcesResponse results. */ - public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; - - /** SearchResourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchResourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResourcesResponse instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse): google.cloud.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @param message SearchResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @param message SearchResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResourcesResponse - * @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.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResourcesResponse - * @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.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Verifies a SearchResourcesResponse 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 SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. - * @param message SearchResourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SearchIamPoliciesRequest. */ - interface ISearchIamPoliciesRequest { - - /** SearchIamPoliciesRequest scope */ - scope?: (string|null); - - /** SearchIamPoliciesRequest query */ - query?: (string|null); - - /** SearchIamPoliciesRequest pageSize */ - pageSize?: (number|null); - - /** SearchIamPoliciesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchIamPoliciesRequest. */ - class SearchIamPoliciesRequest implements ISearchIamPoliciesRequest { - - /** - * Constructs a new SearchIamPoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest); - - /** SearchIamPoliciesRequest scope. */ - public scope: string; - - /** SearchIamPoliciesRequest query. */ - public query: string; - - /** SearchIamPoliciesRequest pageSize. */ - public pageSize: number; - - /** SearchIamPoliciesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchIamPoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchIamPoliciesRequest instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @param message SearchIamPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @param message SearchIamPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchIamPoliciesRequest - * @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.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchIamPoliciesRequest - * @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.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Verifies a SearchIamPoliciesRequest 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 SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchIamPoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. - * @param message SearchIamPoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchIamPoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SearchIamPoliciesResponse. */ - interface ISearchIamPoliciesResponse { - - /** SearchIamPoliciesResponse results */ - results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); - - /** SearchIamPoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchIamPoliciesResponse. */ - class SearchIamPoliciesResponse implements ISearchIamPoliciesResponse { - - /** - * Constructs a new SearchIamPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse); - - /** SearchIamPoliciesResponse results. */ - public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; - - /** SearchIamPoliciesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchIamPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchIamPoliciesResponse instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @param message SearchIamPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @param message SearchIamPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchIamPoliciesResponse - * @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.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchIamPoliciesResponse - * @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.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Verifies a SearchIamPoliciesResponse 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 SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchIamPoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. - * @param message SearchIamPoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchIamPoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a SearchAllResourcesRequest. */ interface ISearchAllResourcesRequest { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 01e518fdca4..9f2c7eccfac 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -7849,72 +7849,6 @@ return new this(rpcImpl, requestDelimited, responseDelimited); }; - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} [response] SearchResourcesResponse - */ - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchResources = function searchResources(request, callback) { - return this.rpcCall(searchResources, $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse, request, callback); - }, "name", { value: "SearchResources" }); - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchIamPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} [response] SearchIamPoliciesResponse - */ - - /** - * Calls SearchIamPolicies. - * @function searchIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchIamPolicies = function searchIamPolicies(request, callback) { - return this.rpcCall(searchIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, request, callback); - }, "name", { value: "SearchIamPolicies" }); - - /** - * Calls SearchIamPolicies. - * @function searchIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. * @memberof google.cloud.asset.v1p1beta1.AssetService @@ -7984,1015 +7918,6 @@ return AssetService; })(); - v1p1beta1.SearchResourcesRequest = (function() { - - /** - * Properties of a SearchResourcesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchResourcesRequest - * @property {string|null} [scope] SearchResourcesRequest scope - * @property {string|null} [query] SearchResourcesRequest query - * @property {Array.|null} [assetTypes] SearchResourcesRequest assetTypes - * @property {number|null} [pageSize] SearchResourcesRequest pageSize - * @property {string|null} [pageToken] SearchResourcesRequest pageToken - */ - - /** - * Constructs a new SearchResourcesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchResourcesRequest. - * @implements ISearchResourcesRequest - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set - */ - function SearchResourcesRequest(properties) { - this.assetTypes = []; - 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]]; - } - - /** - * SearchResourcesRequest scope. - * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.scope = ""; - - /** - * SearchResourcesRequest query. - * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.query = ""; - - /** - * SearchResourcesRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.assetTypes = $util.emptyArray; - - /** - * SearchResourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.pageSize = 0; - - /** - * SearchResourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchResourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest instance - */ - SearchResourcesRequest.create = function create(properties) { - return new SearchResourcesRequest(properties); - }; - - /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesRequest.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.asset.v1p1beta1.SearchResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 5: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResourcesRequest message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResourcesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest - */ - SearchResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.query != null) - message.query = String(object.query); - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - 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 SearchResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.SearchResourcesRequest} message SearchResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; - if (options.defaults) { - object.scope = ""; - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this SearchResourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchResourcesRequest; - })(); - - v1p1beta1.SearchResourcesResponse = (function() { - - /** - * Properties of a SearchResourcesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchResourcesResponse - * @property {Array.|null} [results] SearchResourcesResponse results - * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken - */ - - /** - * Constructs a new SearchResourcesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchResourcesResponse. - * @implements ISearchResourcesResponse - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set - */ - function SearchResourcesResponse(properties) { - this.results = []; - 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]]; - } - - /** - * SearchResourcesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @instance - */ - SearchResourcesResponse.prototype.results = $util.emptyArray; - - /** - * SearchResourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @instance - */ - SearchResourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchResourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse instance - */ - SearchResourcesResponse.create = function create(properties) { - return new SearchResourcesResponse(properties); - }; - - /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesResponse.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.asset.v1p1beta1.SearchResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResourcesResponse message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse - */ - SearchResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} message SearchResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.results = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchResourcesResponse; - })(); - - v1p1beta1.SearchIamPoliciesRequest = (function() { - - /** - * Properties of a SearchIamPoliciesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchIamPoliciesRequest - * @property {string|null} [scope] SearchIamPoliciesRequest scope - * @property {string|null} [query] SearchIamPoliciesRequest query - * @property {number|null} [pageSize] SearchIamPoliciesRequest pageSize - * @property {string|null} [pageToken] SearchIamPoliciesRequest pageToken - */ - - /** - * Constructs a new SearchIamPoliciesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchIamPoliciesRequest. - * @implements ISearchIamPoliciesRequest - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set - */ - function SearchIamPoliciesRequest(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]]; - } - - /** - * SearchIamPoliciesRequest scope. - * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.scope = ""; - - /** - * SearchIamPoliciesRequest query. - * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.query = ""; - - /** - * SearchIamPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.pageSize = 0; - - /** - * SearchIamPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchIamPoliciesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest instance - */ - SearchIamPoliciesRequest.create = function create(properties) { - return new SearchIamPoliciesRequest(properties); - }; - - /** - * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.scope); - return writer; - }; - - /** - * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesRequest.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.asset.v1p1beta1.SearchIamPoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.scope = reader.string(); - break; - case 1: - message.query = 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 SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchIamPoliciesRequest message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchIamPoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: 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 SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest - */ - SearchIamPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.query != null) - message.query = String(object.query); - 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 SearchIamPoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} message SearchIamPoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchIamPoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - object.scope = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - return object; - }; - - /** - * Converts this SearchIamPoliciesRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchIamPoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchIamPoliciesRequest; - })(); - - v1p1beta1.SearchIamPoliciesResponse = (function() { - - /** - * Properties of a SearchIamPoliciesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchIamPoliciesResponse - * @property {Array.|null} [results] SearchIamPoliciesResponse results - * @property {string|null} [nextPageToken] SearchIamPoliciesResponse nextPageToken - */ - - /** - * Constructs a new SearchIamPoliciesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchIamPoliciesResponse. - * @implements ISearchIamPoliciesResponse - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set - */ - function SearchIamPoliciesResponse(properties) { - this.results = []; - 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]]; - } - - /** - * SearchIamPoliciesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @instance - */ - SearchIamPoliciesResponse.prototype.results = $util.emptyArray; - - /** - * SearchIamPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @instance - */ - SearchIamPoliciesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchIamPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse instance - */ - SearchIamPoliciesResponse.create = function create(properties) { - return new SearchIamPoliciesResponse(properties); - }; - - /** - * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesResponse.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.asset.v1p1beta1.SearchIamPoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchIamPoliciesResponse message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchIamPoliciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse - */ - SearchIamPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} message SearchIamPoliciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchIamPoliciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.results = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchIamPoliciesResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchIamPoliciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchIamPoliciesResponse; - })(); - v1p1beta1.SearchAllResourcesRequest = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index c1e58442a51..17c44fa8aff 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -737,22 +737,6 @@ "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "SearchResources": { - "requestType": "SearchResourcesRequest", - "responseType": "SearchResourcesResponse", - "options": { - "(google.api.http).get": "/v1p1beta1/resources:search", - "(google.api.method_signature)": "scope,query,asset_types" - } - }, - "SearchIamPolicies": { - "requestType": "SearchIamPoliciesRequest", - "responseType": "SearchIamPoliciesResponse", - "options": { - "(google.api.http).get": "/v1p1beta1/iamPolicies:search", - "(google.api.method_signature)": "scope,query" - } - }, "SearchAllResources": { "requestType": "SearchAllResourcesRequest", "responseType": "SearchAllResourcesResponse", @@ -771,104 +755,6 @@ } } }, - "SearchResourcesRequest": { - "fields": { - "scope": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "query": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "assetTypes": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SearchResourcesResponse": { - "fields": { - "results": { - "rule": "repeated", - "type": "StandardResourceMetadata", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SearchIamPoliciesRequest": { - "fields": { - "scope": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "query": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SearchIamPoliciesResponse": { - "fields": { - "results": { - "rule": "repeated", - "type": "IamPolicySearchResult", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, "SearchAllResourcesRequest": { "fields": { "scope": { diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 95d7889af6c..fce13d5f36c 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -141,16 +141,6 @@ export class AssetServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - searchResources: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'results' - ), - searchIamPolicies: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'results' - ), searchAllResources: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -191,8 +181,6 @@ export class AssetServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const assetServiceStubMethods = [ - 'searchResources', - 'searchIamPolicies', 'searchAllResources', 'searchAllIamPolicies', ]; @@ -279,306 +267,6 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- - searchResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - ] - >; - searchResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - > - ): void; - /** - * Searches resources which are accessible with .get permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the supported asset types. - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. - * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. - * 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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} 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 [SearchResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchResourcesRequest} - * 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 - * [SearchResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchResourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - searchResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - >, - callback?: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - > - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - return this._innerApiCalls.searchResources(request, options, callback); - } - - /** - * Equivalent to {@link searchResources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchResources} 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.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the supported asset types. - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. - * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. - */ - searchResourcesStream( - request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options?: gax.CallOptions - ): Transform { - request = request || {}; - options = options || {}; - const callSettings = new gax.CallSettings(options); - return this._descriptors.page.searchResources.createStream( - this._innerApiCalls.searchResources as gax.GaxCall, - request, - callSettings - ); - } - searchIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - ] - >; - searchIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - > - ): void; - /** - * Searches IAM policies which are accessible with .getIamPolicy permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * Examples: - * * "policy:myuser@mydomain.com" - * * "policy:(myuser@mydomain.com viewer)" - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. - * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. - * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} 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 [SearchIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} - * 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 - * [SearchIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - searchIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - >, - callback?: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - > - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - return this._innerApiCalls.searchIamPolicies(request, options, callback); - } - - /** - * Equivalent to {@link searchIamPolicies}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchIamPolicies} 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.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * Examples: - * * "policy:myuser@mydomain.com" - * * "policy:(myuser@mydomain.com viewer)" - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. - * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. - */ - searchIamPoliciesStream( - request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options?: gax.CallOptions - ): Transform { - request = request || {}; - options = options || {}; - const callSettings = new gax.CallSettings(options); - return this._descriptors.page.searchIamPolicies.createStream( - this._innerApiCalls.searchIamPolicies as gax.GaxCall, - request, - callSettings - ); - } searchAllResources( request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json index d033cf28f2b..fe7cd34beeb 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json @@ -20,16 +20,6 @@ } }, "methods": { - "SearchResources": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SearchIamPolicies": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, "SearchAllResources": { "timeout_millis": 15000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 65fbc45acda..debdd2c1626 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,20 +1,13 @@ { - "updateTime": "2020-02-12T21:58:22.717995Z", + "updateTime": "2020-02-29T12:11:41.085915Z", "sources": [ - { - "git": { - "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "1672f14370c3d868439c09a8b2dda6ed4735f640" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2c17ac33b226194041155bb5340c3f34733f1b3a", - "internalRef": "294734008", - "log": "2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" + "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", + "internalRef": "297918498", + "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n" } }, { diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts index 28e8691c20e..6a09509cdb1 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -67,120 +67,6 @@ describe('v1p1beta1.AssetServiceClient', () => { }); assert(client); }); - describe('searchResources', () => { - it('invokes searchResources without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.searchResources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.searchResources(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('searchResourcesStream', () => { - it('invokes searchResourcesStream without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.searchResources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .searchResourcesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('searchIamPolicies', () => { - it('invokes searchIamPolicies without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.searchIamPolicies = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.searchIamPolicies(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('searchIamPoliciesStream', () => { - it('invokes searchIamPoliciesStream without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.searchIamPolicies = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .searchIamPoliciesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); describe('searchAllResources', () => { it('invokes searchAllResources without error', done => { const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ From dcdeb701835c934bc4360a02b77899569629703c Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 00:14:05 +0000 Subject: [PATCH 185/429] feat: deferred client initialization (#281) This PR includes changes from https://github.com/googleapis/gapic-generator-typescript/pull/317 that will move the asynchronous initialization and authentication from the client constructor to an `initialize()` method. This method will be automatically called when the first RPC call is performed. The client library usage has not changed, there is no need to update any code. If you want to make sure the client is authenticated _before_ the first RPC call, you can do ```js await client.initialize(); ``` manually before calling any client method. --- .../src/v1/asset_service_client.ts | 92 +++++++++++++------ .../src/v1beta1/asset_service_client.ts | 81 +++++++++++----- .../src/v1p1beta1/asset_service_client.ts | 73 ++++++++++----- .../src/v1p2beta1/asset_service_client.ts | 76 ++++++++++----- packages/google-cloud-asset/synth.metadata | 8 +- .../test/gapic-asset_service-v1.ts | 44 +++++++++ .../test/gapic-asset_service-v1beta1.ts | 24 +++++ .../test/gapic-asset_service-v1p1beta1.ts | 24 +++++ .../test/gapic-asset_service-v1p2beta1.ts | 36 ++++++++ 9 files changed, 358 insertions(+), 100 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 663dbbd60b4..5efcd8e79b1 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -42,9 +42,14 @@ export class AssetServiceClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; 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; operationsClient: gax.OperationsClient; - assetServiceStub: Promise<{[name: string]: Function}>; + assetServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of AssetServiceClient. @@ -68,8 +73,6 @@ export class AssetServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -99,25 +102,28 @@ export class AssetServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -133,7 +139,7 @@ export class AssetServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -141,13 +147,13 @@ export class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - folderFeedPathTemplate: new gaxModule.PathTemplate( + folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), - organizationFeedPathTemplate: new gaxModule.PathTemplate( + organizationFeedPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), - projectFeedPathTemplate: new gaxModule.PathTemplate( + projectFeedPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/feeds/{feed}' ), }; @@ -156,13 +162,15 @@ export class AssetServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const exportAssetsResponse = protoFilesRoot.lookup( @@ -173,7 +181,7 @@ export class AssetServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - exportAssets: new gaxModule.LongrunningDescriptor( + exportAssets: new this._gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) @@ -181,7 +189,7 @@ export class AssetServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.asset.v1.AssetService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -192,17 +200,35 @@ export class AssetServiceClient { // 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.assetServiceStub) { + return this.assetServiceStub; + } // Put together the "service stub" for // google.cloud.asset.v1.AssetService. - this.assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1.AssetService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.asset.v1.AssetService, - opts + (this._protos as any).google.cloud.asset.v1.AssetService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -230,9 +256,9 @@ export class AssetServiceClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -246,6 +272,8 @@ export class AssetServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.assetServiceStub; } /** @@ -404,6 +432,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.batchGetAssetsHistory( request, options, @@ -493,6 +522,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createFeed(request, options, callback); } getFeed( @@ -567,6 +597,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getFeed(request, options, callback); } listFeeds( @@ -640,6 +671,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listFeeds(request, options, callback); } updateFeed( @@ -719,6 +751,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ 'feed.name': request.feed!.name || '', }); + this.initialize(); return this._innerApiCalls.updateFeed(request, options, callback); } deleteFeed( @@ -793,6 +826,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteFeed(request, options, callback); } @@ -824,7 +858,7 @@ export class AssetServiceClient { /** * Exports assets with time and resource types to a given Cloud Storage * location. The output format is newline-delimited JSON. - * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you + * This API implements the {@link google.longrunning.Operation|google.longrunning.Operation} API allowing you * to keep track of the export. * * @param {Object} request @@ -904,6 +938,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.exportAssets(request, options, callback); } // -------------------- @@ -1032,8 +1067,9 @@ export class AssetServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.assetServiceStub.then(stub => { + return this.assetServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 0a8ee82024b..dc6b2d88d12 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -41,9 +41,14 @@ export class AssetServiceClient { private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; private _innerApiCalls: {[name: string]: Function}; 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; operationsClient: gax.OperationsClient; - assetServiceStub: Promise<{[name: string]: Function}>; + assetServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of AssetServiceClient. @@ -67,8 +72,6 @@ export class AssetServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -98,25 +101,28 @@ export class AssetServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -132,7 +138,7 @@ export class AssetServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -140,13 +146,15 @@ export class AssetServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const exportAssetsResponse = protoFilesRoot.lookup( @@ -157,7 +165,7 @@ export class AssetServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - exportAssets: new gaxModule.LongrunningDescriptor( + exportAssets: new this._gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) @@ -165,7 +173,7 @@ export class AssetServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.asset.v1beta1.AssetService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -176,17 +184,35 @@ export class AssetServiceClient { // 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.assetServiceStub) { + return this.assetServiceStub; + } // Put together the "service stub" for // google.cloud.asset.v1beta1.AssetService. - this.assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1beta1.AssetService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.asset.v1beta1.AssetService, - opts + (this._protos as any).google.cloud.asset.v1beta1.AssetService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -206,9 +232,9 @@ export class AssetServiceClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -222,6 +248,8 @@ export class AssetServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.assetServiceStub; } /** @@ -378,6 +406,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.batchGetAssetsHistory( request, options, @@ -414,7 +443,7 @@ export class AssetServiceClient { * Exports assets with time and resource types to a given Cloud Storage * location. The output format is newline-delimited JSON. * This API implements the - * [google.longrunning.Operation][google.longrunning.Operation] API allowing + * {@link google.longrunning.Operation|google.longrunning.Operation} API allowing * you to keep track of the export. * * @param {Object} request @@ -494,6 +523,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.exportAssets(request, options, callback); } @@ -503,8 +533,9 @@ export class AssetServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.assetServiceStub.then(stub => { + return this.assetServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index fce13d5f36c..e53bdfd0e3f 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -43,8 +43,13 @@ export class AssetServiceClient { private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; private _innerApiCalls: {[name: string]: Function}; 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; - assetServiceStub: Promise<{[name: string]: Function}>; + assetServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of AssetServiceClient. @@ -68,8 +73,6 @@ export class AssetServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -99,25 +102,28 @@ export class AssetServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -133,7 +139,7 @@ export class AssetServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -141,12 +147,12 @@ export class AssetServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - searchAllResources: new gaxModule.PageDescriptor( + searchAllResources: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'results' ), - searchAllIamPolicies: new gaxModule.PageDescriptor( + searchAllIamPolicies: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'results' @@ -154,7 +160,7 @@ export class AssetServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.asset.v1p1beta1.AssetService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -165,17 +171,35 @@ export class AssetServiceClient { // 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.assetServiceStub) { + return this.assetServiceStub; + } // Put together the "service stub" for // google.cloud.asset.v1p1beta1.AssetService. - this.assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1p1beta1.AssetService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.asset.v1p1beta1.AssetService, - opts + (this._protos as any).google.cloud.asset.v1p1beta1.AssetService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -198,9 +222,9 @@ export class AssetServiceClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -214,6 +238,8 @@ export class AssetServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.assetServiceStub; } /** @@ -372,6 +398,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ scope: request.scope || '', }); + this.initialize(); return this._innerApiCalls.searchAllResources(request, options, callback); } @@ -430,6 +457,7 @@ export class AssetServiceClient { scope: request.scope || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.searchAllResources.createStream( this._innerApiCalls.searchAllResources as gax.GaxCall, request, @@ -541,6 +569,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ scope: request.scope || '', }); + this.initialize(); return this._innerApiCalls.searchAllIamPolicies(request, options, callback); } @@ -599,6 +628,7 @@ export class AssetServiceClient { scope: request.scope || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.searchAllIamPolicies.createStream( this._innerApiCalls.searchAllIamPolicies as gax.GaxCall, request, @@ -612,8 +642,9 @@ export class AssetServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.assetServiceStub.then(stub => { + return this.assetServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index c3bb3235020..00796f3e511 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -41,8 +41,13 @@ export class AssetServiceClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; 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; - assetServiceStub: Promise<{[name: string]: Function}>; + assetServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of AssetServiceClient. @@ -66,8 +71,6 @@ export class AssetServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -97,25 +100,28 @@ export class AssetServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -131,7 +137,7 @@ export class AssetServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -139,19 +145,19 @@ export class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - folderFeedPathTemplate: new gaxModule.PathTemplate( + folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), - organizationFeedPathTemplate: new gaxModule.PathTemplate( + organizationFeedPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), - projectFeedPathTemplate: new gaxModule.PathTemplate( + projectFeedPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/feeds/{feed}' ), }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.asset.v1p2beta1.AssetService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -162,17 +168,35 @@ export class AssetServiceClient { // 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.assetServiceStub) { + return this.assetServiceStub; + } // Put together the "service stub" for // google.cloud.asset.v1p2beta1.AssetService. - this.assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1p2beta1.AssetService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.asset.v1p2beta1.AssetService, - opts + (this._protos as any).google.cloud.asset.v1p2beta1.AssetService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -198,9 +222,9 @@ export class AssetServiceClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -214,6 +238,8 @@ export class AssetServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.assetServiceStub; } /** @@ -350,6 +376,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createFeed(request, options, callback); } getFeed( @@ -424,6 +451,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getFeed(request, options, callback); } listFeeds( @@ -498,6 +526,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listFeeds(request, options, callback); } updateFeed( @@ -578,6 +607,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ 'feed.name': request.feed!.name || '', }); + this.initialize(); return this._innerApiCalls.updateFeed(request, options, callback); } deleteFeed( @@ -653,6 +683,7 @@ export class AssetServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteFeed(request, options, callback); } @@ -782,8 +813,9 @@ export class AssetServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.assetServiceStub.then(stub => { + return this.assetServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index debdd2c1626..93e6a24b347 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-02-29T12:11:41.085915Z", + "updateTime": "2020-03-05T23:01:19.178450Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", - "internalRef": "297918498", - "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n" + "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", + "internalRef": "299181282", + "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" } }, { diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts index f56860b8aa8..d79fd23bb73 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts @@ -102,12 +102,30 @@ describe('v1.AssetServiceClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + it('has close method', () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('batchGetAssetsHistory', () => { it('invokes batchGetAssetsHistory without error', done => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; request.parent = ''; @@ -131,6 +149,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; request.parent = ''; @@ -156,6 +176,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; request.parent = ''; @@ -179,6 +201,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; request.parent = ''; @@ -204,6 +228,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; request.name = ''; @@ -227,6 +253,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; request.name = ''; @@ -252,6 +280,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; request.parent = ''; @@ -275,6 +305,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; request.parent = ''; @@ -300,6 +332,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; request.feed = {}; @@ -324,6 +358,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; request.feed = {}; @@ -350,6 +386,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; request.name = ''; @@ -373,6 +411,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; request.name = ''; @@ -398,6 +438,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; request.parent = ''; @@ -428,6 +470,8 @@ describe('v1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; request.parent = ''; diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts index ad8df628733..dfb52b9da76 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts @@ -104,12 +104,30 @@ describe('v1beta1.AssetServiceClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + it('has close method', () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('batchGetAssetsHistory', () => { it('invokes batchGetAssetsHistory without error', done => { const client = new assetserviceModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; request.parent = ''; @@ -133,6 +151,8 @@ describe('v1beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; request.parent = ''; @@ -158,6 +178,8 @@ describe('v1beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; request.parent = ''; @@ -188,6 +210,8 @@ describe('v1beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; request.parent = ''; diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts index 6a09509cdb1..9f1b560b792 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -67,12 +67,30 @@ describe('v1p1beta1.AssetServiceClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + it('has close method', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('searchAllResources', () => { it('invokes searchAllResources without error', done => { const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; request.scope = ''; @@ -100,6 +118,8 @@ describe('v1p1beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; request.scope = ''; @@ -132,6 +152,8 @@ describe('v1p1beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; request.scope = ''; @@ -159,6 +181,8 @@ describe('v1p1beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; request.scope = ''; diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts index 02fd1b88b57..73678598dfe 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts @@ -83,12 +83,30 @@ describe('v1p2beta1.AssetServiceClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + it('has close method', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('createFeed', () => { it('invokes createFeed without error', done => { const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; request.parent = ''; @@ -112,6 +130,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; request.parent = ''; @@ -137,6 +157,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; request.name = ''; @@ -160,6 +182,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; request.name = ''; @@ -185,6 +209,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; request.parent = ''; @@ -208,6 +234,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; request.parent = ''; @@ -233,6 +261,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; request.feed = {}; @@ -257,6 +287,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; request.feed = {}; @@ -283,6 +315,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; request.name = ''; @@ -306,6 +340,8 @@ describe('v1p2beta1.AssetServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; request.name = ''; From 6a39c0d1ff25381988b37fbc9954c057ab5b0b84 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 01:23:20 +0000 Subject: [PATCH 186/429] build: update linkinator config (#282) --- packages/google-cloud-asset/linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/linkinator.config.json b/packages/google-cloud-asset/linkinator.config.json index b555215ca02..29a223b6db6 100644 --- a/packages/google-cloud-asset/linkinator.config.json +++ b/packages/google-cloud-asset/linkinator.config.json @@ -4,5 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" - ] + ], + "silent": true, + "concurrency": 10 } From 8f7c3ce6d6e003a9c959c6c77beaf7c5d17f7c50 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Mar 2020 14:56:37 -0800 Subject: [PATCH 187/429] build(tests): fix coveralls and enable build cop (#283) --- packages/google-cloud-asset/.mocharc.js | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/google-cloud-asset/.mocharc.js diff --git a/packages/google-cloud-asset/.mocharc.js b/packages/google-cloud-asset/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-asset/.mocharc.js @@ -0,0 +1,28 @@ +// 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 +} +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 From 8d6100dbc6337dbbced370f3e3fc04e422df16c2 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 17 Mar 2020 11:45:03 -0700 Subject: [PATCH 188/429] feat: adds v1p4beta1 API surface (#285) --- .../cloud/asset/v1p4beta1/asset_service.proto | 343 ++ .../google/cloud/asset/v1p4beta1/assets.proto | 167 + .../google-cloud-asset/protos/protos.d.ts | 2221 +++++++ packages/google-cloud-asset/protos/protos.js | 5338 +++++++++++++++++ .../google-cloud-asset/protos/protos.json | 494 +- packages/google-cloud-asset/src/index.ts | 12 +- .../src/v1p4beta1/asset_service_client.ts | 511 ++ .../asset_service_client_config.json | 39 + .../v1p4beta1/asset_service_proto_list.json | 4 + .../google-cloud-asset/src/v1p4beta1/index.ts | 19 + packages/google-cloud-asset/synth.metadata | 16 +- packages/google-cloud-asset/synth.py | 2 +- .../test/gapic-asset_service-v1p4beta1.ts | 246 + 13 files changed, 9403 insertions(+), 9 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto create mode 100644 packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts create mode 100644 packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json create mode 100644 packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json create mode 100644 packages/google-cloud-asset/src/v1p4beta1/index.ts create mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto new file mode 100644 index 00000000000..db60941a567 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto @@ -0,0 +1,343 @@ +// 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.asset.v1p4beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p4beta1/assets.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P4Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p4beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p4beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Analyzes IAM policies based on the specified request. Returns + // a list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request. + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) { + option (google.api.http) = { + get: "/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy" + }; + } + + // Exports IAM policy analysis based on the specified request. This API + // implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep + // track of the export. The metadata contains the request to help callers to + // map responses to requests. + rpc ExportIamPolicyAnalysis(ExportIamPolicyAnalysisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse" + metadata_type: "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest" + }; + } +} + +// IAM policy analysis query message. +message IamPolicyAnalysisQuery { + // Specifies the resource to analyze for access policies, which may be set + // directly on the resource, or on ancestors such as organizations, folders or + // projects. At least one of [ResourceSelector][google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector], [IdentitySelector][google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector] or + // [AccessSelector][google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector] must be specified in a request. + message ResourceSelector { + // Required. The [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // . + string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies an identity for which to determine resource access, based on + // roles assigned either directly to them or to the groups they belong to, + // directly or indirectly. + message IdentitySelector { + // Required. The identity appear in the form of members in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + string identity = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies roles and/or permissions to analyze, to determine both the + // identities possessing them and the resources they control. If multiple + // values are specified, results will include identities and resources + // matching any of them. + message AccessSelector { + // Optional. The roles to appear in result. + repeated string roles = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The permissions to appear in result. + repeated string permissions = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The relative name of the root asset. Only resources and IAM policies within + // the parent will be analyzed. This can only be an organization number (such + // as "organizations/123") or a folder number (such as "folders/123"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies a resource for analysis. Leaving it empty means ANY. + ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies an identity for analysis. Leaving it empty means ANY. + IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies roles or permissions for analysis. Leaving it empty + // means ANY. + AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyRequest { + // Contains request options. + message Options { + // Optional. If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If [identity_selector][] is specified, the identity in the result will + // be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the access section of result will expand any roles + // appearing in IAM policy bindings to include their permissions. + // + // If [access_selector][] is specified, the access section of the result + // will be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the resource section of the result will expand any + // resource attached to an IAM policy to include resources lower in the + // resource hierarchy. + // + // For example, if the request analyzes for which resources user A has + // permission P, and the results include an IAM policy with P on a GCP + // folder, the results will also include resources in that folder with + // permission P. + // + // If [resource_selector][] is specified, the resource section of the result + // will be determined by the selector, and this flag will have no effect. + // Default is false. + bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output resource edges, starting + // from the policy attached resource, to any expanded resources. + // Default is false. + bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output group identity edges, starting + // from the binding's group members, to any expanded identities. + // Default is false. + bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the response will include access analysis from identities to + // resources via service account impersonation. This is a very expensive + // operation, because many derived queries will be executed. We highly + // recommend you use ExportIamPolicyAnalysis rpc instead. + // + // For example, if the request analyzes for which resources user A has + // permission P, and there's an IAM policy states user A has + // iam.serviceAccounts.getAccessToken permission to a service account SA, + // and there's another IAM policy states service account SA has permission P + // to a GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a GCP folder F, and there's an IAM policy states user A + // has iam.serviceAccounts.actAs permission to a service account SA, and + // there's another IAM policy states service account SA has permission P to + // the GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Default is false. + bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Amount of time executable has to complete. See JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + // + // If this field is set with a value less than the RPC deadline, and the + // execution of your query hasn't finished in the specified + // execution timeout, you will get a response with partial result. + // Otherwise, your query's execution will continue until the RPC deadline. + // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + // + // Default is empty. + google.protobuf.Duration execution_timeout = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The request options. + Options options = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyResponse { + // An analysis message to group the query and results. + message IamPolicyAnalysis { + // The analysis query. + IamPolicyAnalysisQuery analysis_query = 1; + + // A list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] that matches the analysis query, or + // empty if no result is found. + repeated IamPolicyAnalysisResult analysis_results = 2; + + // Represents whether all entries in the [analysis_results][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been + // fully explored to answer the query. + bool fully_explored = 3; + } + + // The main analysis that matches the original request. + IamPolicyAnalysis main_analysis = 1; + + // The service account impersonation analysis if + // [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + // enabled. + repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; + + // Represents whether all entries in the [main_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.main_analysis] and + // [service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to + // answer the query in the request. + bool fully_explored = 3; + + // A list of non-critical errors happened during the request handling to + // explain why `fully_explored` is false, or empty if no error happened. + repeated IamPolicyAnalysisResult.AnalysisState non_critical_errors = 4; +} + +// Output configuration for export IAM policy analysis destination. +message IamPolicyAnalysisOutputConfig { + // A Cloud Storage location. + message GcsDestination { + // Required. The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // IAM policy analysis export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + } +} + +// A request message for [AssetService.ExportIamPolicyAnalysis][google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis]. +message ExportIamPolicyAnalysisRequest { + // Contains request options. + message Options { + // Optional. If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If [identity_selector][] is specified, the identity in the result will + // be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the access section of result will expand any roles + // appearing in IAM policy bindings to include their permissions. + // + // If [access_selector][] is specified, the access section of the result + // will be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the resource section of the result will expand any + // resource attached to an IAM policy to include resources lower in the + // resource hierarchy. + // + // For example, if the request analyzes for which resources user A has + // permission P, and the results include an IAM policy with P on a GCP + // folder, the results will also include resources in that folder with + // permission P. + // + // If [resource_selector][] is specified, the resource section of the result + // will be determined by the selector, and this flag will have no effect. + // Default is false. + bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output resource edges, starting + // from the policy attached resource, to any expanded resources. + // Default is false. + bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output group identity edges, starting + // from the binding's group members, to any expanded identities. + // Default is false. + bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the response will include access analysis from identities to + // resources via service account impersonation. This is a very expensive + // operation, because many derived queries will be executed. + // + // For example, if the request analyzes for which resources user A has + // permission P, and there's an IAM policy states user A has + // iam.serviceAccounts.getAccessToken permission to a service account SA, + // and there's another IAM policy states service account SA has permission P + // to a GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a GCP folder F, and there's an IAM policy states user A + // has iam.serviceAccounts.actAs permission to a service account SA, and + // there's another IAM policy states service account SA has permission P to + // the GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Default is false. + bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The request options. + Options options = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Output configuration indicating where the results will be output to. + IamPolicyAnalysisOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The export IAM policy analysis response. This message is returned by the +// [google.longrunning.Operations.GetOperation][] method in the returned +// [google.longrunning.Operation.response][] field. +message ExportIamPolicyAnalysisResponse { + // Output configuration indicating where the results were output to. + IamPolicyAnalysisOutputConfig output_config = 1; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto new file mode 100644 index 00000000000..0d7c5e055be --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto @@ -0,0 +1,167 @@ +// 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.asset.v1p4beta1; + +import "google/iam/v1/policy.proto"; +import "google/rpc/code.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1P4Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p4beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p4beta1"; + +// IAM Policy analysis result, consisting of one IAM policy binding and derived +// access control lists. +message IamPolicyAnalysisResult { + // Represents analysis state of each node in the result graph or non-critical + // errors in the response. + message AnalysisState { + // The Google standard error code that best describes the state. + // For example: + // - OK means the node has been successfully explored; + // - PERMISSION_DENIED means an access denied error is encountered; + // - DEADLINE_EXCEEDED means the node hasn't been explored in time; + google.rpc.Code code = 1; + + // The human-readable description of the cause of failure. + string cause = 2; + } + + // A GCP resource that appears in an access control list. + message Resource { + // The [full resource name](https://aip.dev/122#full-resource-names). + string full_resource_name = 1; + + // The analysis state of this resource node. + AnalysisState analysis_state = 2; + } + + // A role or permission that appears in an access control list. + message Access { + oneof oneof_access { + // The role. + string role = 1; + + // The permission. + string permission = 2; + } + + // The analysis state of this access node. + AnalysisState analysis_state = 3; + } + + // A directional edge. + message Edge { + // The source node of the edge. + string source_node = 1; + + // The target node of the edge. + string target_node = 2; + } + + // An identity that appears in an access control list. + message Identity { + // The identity name in any form of members appear in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such + // as: + // - user:foo@google.com + // - group:group1@google.com + // - serviceAccount:s1@prj1.iam.gserviceaccount.com + // - projectOwner:some_project_id + // - domain:google.com + // - allUsers + // - etc. + string name = 1; + + // The analysis state of this identity node. + AnalysisState analysis_state = 2; + } + + // An access control list, derived from the above IAM policy binding, which + // contains a set of resources and accesses. May include one + // item from each set to compose an access control entry. + // + // NOTICE that there could be multiple access control lists for one IAM policy + // binding. The access control lists are created based on resource and access + // combinations. + // + // For example, assume we have the following cases in one IAM policy binding: + // - Permission P1 and P2 apply to resource R1 and R2; + // - Permission P3 applies to resource R2 and R3; + // + // This will result in the following access control lists: + // - AccessControlList 1: [R1, R2], [P1, P2] + // - AccessControlList 2: [R2, R3], [P3] + message AccessControlList { + // The resources that match one of the following conditions: + // - The resource_selector, if it is specified in request; + // - Otherwise, resources reachable from the policy attached resource. + repeated Resource resources = 1; + + // The accesses that match one of the following conditions: + // - The access_selector, if it is specified in request; + // - Otherwise, access specifiers reachable from the policy binding's role. + repeated Access accesses = 2; + + // Resource edges of the graph starting from the policy attached + // resource to any descendant resources. The [Edge.source_node][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.source_node] contains + // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.target_node] + // contains the full resource name of a child resource. This field is + // present only if the output_resource_edges option is enabled in request. + repeated Edge resource_edges = 3; + } + + message IdentityList { + // Only the identities that match one of the following conditions will be + // presented: + // - The identity_selector, if it is specified in request; + // - Otherwise, identities reachable from the policy binding's members. + repeated Identity identities = 1; + + // Group identity edges of the graph starting from the binding's + // group members to any node of the [identities][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.source_node] + // contains a group, such as "group:parent@google.com". The + // [Edge.target_node][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.target_node] contains a member of the group, + // such as "group:child@google.com" or "user:foo@google.com". + // This field is present only if the output_group_edges option is enabled in + // request. + repeated Edge group_edges = 2; + } + + // The full name of the resource to which the [iam_binding][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] policy attaches. + string attached_resource_full_name = 1; + + // The Cloud IAM policy binding under analysis. + google.iam.v1.Binding iam_binding = 2; + + // The access control lists derived from the [iam_binding][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match resource and access selectors specified in the request. + repeated AccessControlList access_control_lists = 3; + + // The identity list derived from members of the [iam_binding][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match identity selector specified in the request. + IdentityList identity_list = 4; + + // Represents whether all nodes in the transitive closure of the + // [iam_binding][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] node have been explored. + bool fully_explored = 5; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 9788e56fd5c..172eabfcca5 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -5623,6 +5623,2206 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Namespace v1p4beta1. */ + namespace v1p4beta1 { + + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + */ + public analyzeIamPolicy(request: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, callback: google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicyCallback): void; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicy(request: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest): Promise; + + /** + * Calls ExportIamPolicyAnalysis. + * @param request ExportIamPolicyAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportIamPolicyAnalysis(request: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, callback: google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysisCallback): void; + + /** + * Calls ExportIamPolicyAnalysis. + * @param request ExportIamPolicyAnalysisRequest message or plain object + * @returns Promise + */ + public exportIamPolicyAnalysis(request: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#analyzeIamPolicy}. + * @param error Error, if any + * @param [response] AnalyzeIamPolicyResponse + */ + type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#exportIamPolicyAnalysis}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportIamPolicyAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an IamPolicyAnalysisQuery. */ + interface IIamPolicyAnalysisQuery { + + /** IamPolicyAnalysisQuery parent */ + parent?: (string|null); + + /** IamPolicyAnalysisQuery resourceSelector */ + resourceSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null); + + /** IamPolicyAnalysisQuery identitySelector */ + identitySelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null); + + /** IamPolicyAnalysisQuery accessSelector */ + accessSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null); + } + + /** Represents an IamPolicyAnalysisQuery. */ + class IamPolicyAnalysisQuery implements IIamPolicyAnalysisQuery { + + /** + * Constructs a new IamPolicyAnalysisQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery); + + /** IamPolicyAnalysisQuery parent. */ + public parent: string; + + /** IamPolicyAnalysisQuery resourceSelector. */ + public resourceSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null); + + /** IamPolicyAnalysisQuery identitySelector. */ + public identitySelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null); + + /** IamPolicyAnalysisQuery accessSelector. */ + public accessSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null); + + /** + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisQuery instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisQuery + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisQuery + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Verifies an IamPolicyAnalysisQuery 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 IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisQuery { + + /** Properties of a ResourceSelector. */ + interface IResourceSelector { + + /** ResourceSelector fullResourceName */ + fullResourceName?: (string|null); + } + + /** Represents a ResourceSelector. */ + class ResourceSelector implements IResourceSelector { + + /** + * Constructs a new ResourceSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector); + + /** ResourceSelector fullResourceName. */ + public fullResourceName: string; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSelector instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSelector + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSelector + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Verifies a ResourceSelector 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 ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @param message ResourceSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IdentitySelector. */ + interface IIdentitySelector { + + /** IdentitySelector identity */ + identity?: (string|null); + } + + /** Represents an IdentitySelector. */ + class IdentitySelector implements IIdentitySelector { + + /** + * Constructs a new IdentitySelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector); + + /** IdentitySelector identity. */ + public identity: string; + + /** + * Creates a new IdentitySelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentitySelector instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentitySelector + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentitySelector + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Verifies an IdentitySelector 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 IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentitySelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @param message IdentitySelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentitySelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AccessSelector. */ + interface IAccessSelector { + + /** AccessSelector roles */ + roles?: (string[]|null); + + /** AccessSelector permissions */ + permissions?: (string[]|null); + } + + /** Represents an AccessSelector. */ + class AccessSelector implements IAccessSelector { + + /** + * Constructs a new AccessSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector); + + /** AccessSelector roles. */ + public roles: string[]; + + /** AccessSelector permissions. */ + public permissions: string[]; + + /** + * Creates a new AccessSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSelector instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSelector + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSelector + * @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.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Verifies an AccessSelector 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 AccessSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @param message AccessSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeIamPolicyRequest. */ + interface IAnalyzeIamPolicyRequest { + + /** AnalyzeIamPolicyRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest options */ + options?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null); + } + + /** Represents an AnalyzeIamPolicyRequest. */ + class AnalyzeIamPolicyRequest implements IAnalyzeIamPolicyRequest { + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest); + + /** AnalyzeIamPolicyRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest options. */ + public options?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null); + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyRequest instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyRequest + * @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.asset.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyRequest + * @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.asset.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Verifies an AnalyzeIamPolicyRequest 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 AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnalyzeIamPolicyRequest { + + /** Properties of an Options. */ + interface IOptions { + + /** Options expandGroups */ + expandGroups?: (boolean|null); + + /** Options expandRoles */ + expandRoles?: (boolean|null); + + /** Options expandResources */ + expandResources?: (boolean|null); + + /** Options outputResourceEdges */ + outputResourceEdges?: (boolean|null); + + /** Options outputGroupEdges */ + outputGroupEdges?: (boolean|null); + + /** Options analyzeServiceAccountImpersonation */ + analyzeServiceAccountImpersonation?: (boolean|null); + + /** Options executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an Options. */ + class Options implements IOptions { + + /** + * Constructs a new Options. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions); + + /** Options expandGroups. */ + public expandGroups: boolean; + + /** Options expandRoles. */ + public expandRoles: boolean; + + /** Options expandResources. */ + public expandResources: boolean; + + /** Options outputResourceEdges. */ + public outputResourceEdges: boolean; + + /** Options outputGroupEdges. */ + public outputGroupEdges: boolean; + + /** Options analyzeServiceAccountImpersonation. */ + public analyzeServiceAccountImpersonation: boolean; + + /** Options executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new Options instance using the specified properties. + * @param [properties] Properties to set + * @returns Options instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Options message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Options + * @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.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Options + * @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.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Verifies an Options 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 Options message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Options + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @param message Options + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeIamPolicyResponse. */ + interface IAnalyzeIamPolicyResponse { + + /** AnalyzeIamPolicyResponse mainAnalysis */ + mainAnalysis?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis */ + serviceAccountImpersonationAnalysis?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]|null); + + /** AnalyzeIamPolicyResponse fullyExplored */ + fullyExplored?: (boolean|null); + + /** AnalyzeIamPolicyResponse nonCriticalErrors */ + nonCriticalErrors?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState[]|null); + } + + /** Represents an AnalyzeIamPolicyResponse. */ + class AnalyzeIamPolicyResponse implements IAnalyzeIamPolicyResponse { + + /** + * Constructs a new AnalyzeIamPolicyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse); + + /** AnalyzeIamPolicyResponse mainAnalysis. */ + public mainAnalysis?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. */ + public serviceAccountImpersonationAnalysis: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]; + + /** AnalyzeIamPolicyResponse fullyExplored. */ + public fullyExplored: boolean; + + /** AnalyzeIamPolicyResponse nonCriticalErrors. */ + public nonCriticalErrors: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState[]; + + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyResponse instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyResponse + * @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.asset.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyResponse + * @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.asset.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Verifies an AnalyzeIamPolicyResponse 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 AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnalyzeIamPolicyResponse { + + /** Properties of an IamPolicyAnalysis. */ + interface IIamPolicyAnalysis { + + /** IamPolicyAnalysis analysisQuery */ + analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults */ + analysisResults?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult[]|null); + + /** IamPolicyAnalysis fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysis. */ + class IamPolicyAnalysis implements IIamPolicyAnalysis { + + /** + * Constructs a new IamPolicyAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis); + + /** IamPolicyAnalysis analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults. */ + public analysisResults: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult[]; + + /** IamPolicyAnalysis fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysis instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysis + * @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.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysis + * @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.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Verifies an IamPolicyAnalysis 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 IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @param message IamPolicyAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an IamPolicyAnalysisOutputConfig. */ + interface IIamPolicyAnalysisOutputConfig { + + /** IamPolicyAnalysisOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + } + + /** Represents an IamPolicyAnalysisOutputConfig. */ + class IamPolicyAnalysisOutputConfig implements IIamPolicyAnalysisOutputConfig { + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig); + + /** IamPolicyAnalysisOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + + /** IamPolicyAnalysisOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisOutputConfig + * @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.asset.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisOutputConfig + * @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.asset.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Verifies an IamPolicyAnalysisOutputConfig 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 IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisOutputConfig { + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExportIamPolicyAnalysisRequest. */ + interface IExportIamPolicyAnalysisRequest { + + /** ExportIamPolicyAnalysisRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** ExportIamPolicyAnalysisRequest options */ + options?: (google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null); + + /** ExportIamPolicyAnalysisRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an ExportIamPolicyAnalysisRequest. */ + class ExportIamPolicyAnalysisRequest implements IExportIamPolicyAnalysisRequest { + + /** + * Constructs a new ExportIamPolicyAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest); + + /** ExportIamPolicyAnalysisRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** ExportIamPolicyAnalysisRequest options. */ + public options?: (google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null); + + /** ExportIamPolicyAnalysisRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIamPolicyAnalysisRequest instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @param message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @param message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIamPolicyAnalysisRequest + * @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.asset.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIamPolicyAnalysisRequest + * @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.asset.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Verifies an ExportIamPolicyAnalysisRequest 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 ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIamPolicyAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. + * @param message ExportIamPolicyAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIamPolicyAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExportIamPolicyAnalysisRequest { + + /** Properties of an Options. */ + interface IOptions { + + /** Options expandGroups */ + expandGroups?: (boolean|null); + + /** Options expandRoles */ + expandRoles?: (boolean|null); + + /** Options expandResources */ + expandResources?: (boolean|null); + + /** Options outputResourceEdges */ + outputResourceEdges?: (boolean|null); + + /** Options outputGroupEdges */ + outputGroupEdges?: (boolean|null); + + /** Options analyzeServiceAccountImpersonation */ + analyzeServiceAccountImpersonation?: (boolean|null); + } + + /** Represents an Options. */ + class Options implements IOptions { + + /** + * Constructs a new Options. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions); + + /** Options expandGroups. */ + public expandGroups: boolean; + + /** Options expandRoles. */ + public expandRoles: boolean; + + /** Options expandResources. */ + public expandResources: boolean; + + /** Options outputResourceEdges. */ + public outputResourceEdges: boolean; + + /** Options outputGroupEdges. */ + public outputGroupEdges: boolean; + + /** Options analyzeServiceAccountImpersonation. */ + public analyzeServiceAccountImpersonation: boolean; + + /** + * Creates a new Options instance using the specified properties. + * @param [properties] Properties to set + * @returns Options instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Options message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Options + * @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.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Options + * @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.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Verifies an Options 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 Options message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Options + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @param message Options + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExportIamPolicyAnalysisResponse. */ + interface IExportIamPolicyAnalysisResponse { + + /** ExportIamPolicyAnalysisResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an ExportIamPolicyAnalysisResponse. */ + class ExportIamPolicyAnalysisResponse implements IExportIamPolicyAnalysisResponse { + + /** + * Constructs a new ExportIamPolicyAnalysisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse); + + /** ExportIamPolicyAnalysisResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new ExportIamPolicyAnalysisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIamPolicyAnalysisResponse instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @param message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @param message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIamPolicyAnalysisResponse + * @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.asset.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIamPolicyAnalysisResponse + * @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.asset.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Verifies an ExportIamPolicyAnalysisResponse 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 ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIamPolicyAnalysisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. + * @param message ExportIamPolicyAnalysisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIamPolicyAnalysisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicyAnalysisResult. */ + interface IIamPolicyAnalysisResult { + + /** IamPolicyAnalysisResult attachedResourceFullName */ + attachedResourceFullName?: (string|null); + + /** IamPolicyAnalysisResult iamBinding */ + iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists */ + accessControlLists?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysisResult. */ + class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + + /** + * Constructs a new IamPolicyAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisResult + * @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.asset.v1p4beta1.IamPolicyAnalysisResult; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisResult + * @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.asset.v1p4beta1.IamPolicyAnalysisResult; + + /** + * Verifies an IamPolicyAnalysisResult 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of an AnalysisState. */ + interface IAnalysisState { + + /** AnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** AnalysisState cause */ + cause?: (string|null); + } + + /** Represents an AnalysisState. */ + class AnalysisState implements IAnalysisState { + + /** + * Constructs a new AnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState); + + /** AnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** AnalysisState cause. */ + public cause: string; + + /** + * Creates a new AnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Encodes the specified AnalysisState message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @param message AnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @param message AnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalysisState + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Decodes an AnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalysisState + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Verifies an AnalysisState 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 AnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Creates a plain object from an AnalysisState message. Also converts values to other types if specified. + * @param message AnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Access. */ + interface IAccess { + + /** Access role */ + role?: (string|null); + + /** Access permission */ + permission?: (string|null); + + /** Access analysisState */ + analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess); + + /** Access role. */ + public role: string; + + /** Access permission. */ + public permission: string; + + /** Access analysisState. */ + public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + + /** Access oneofAccess. */ + public oneofAccess?: ("role"|"permission"); + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Verifies an Access 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 Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Edge. */ + interface IEdge { + + /** Edge sourceNode */ + sourceNode?: (string|null); + + /** Edge targetNode */ + targetNode?: (string|null); + } + + /** Represents an Edge. */ + class Edge implements IEdge { + + /** + * Constructs a new Edge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge); + + /** Edge sourceNode. */ + public sourceNode: string; + + /** Edge targetNode. */ + public targetNode: string; + + /** + * Creates a new Edge instance using the specified properties. + * @param [properties] Properties to set + * @returns Edge instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Edge + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Edge + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Verifies an Edge 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 Edge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Edge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @param message Edge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Edge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Identity. */ + interface IIdentity { + + /** Identity name */ + name?: (string|null); + + /** Identity analysisState */ + analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + } + + /** Represents an Identity. */ + class Identity implements IIdentity { + + /** + * Constructs a new Identity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity); + + /** Identity name. */ + public name: string; + + /** Identity analysisState. */ + public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + + /** + * Creates a new Identity instance using the specified properties. + * @param [properties] Properties to set + * @returns Identity instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Identity + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Identity + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Verifies an Identity 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 Identity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Identity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @param message Identity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Identity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AccessControlList. */ + interface IAccessControlList { + + /** AccessControlList resources */ + resources?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource[]|null); + + /** AccessControlList accesses */ + accesses?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess[]|null); + + /** AccessControlList resourceEdges */ + resourceEdges?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]|null); + } + + /** Represents an AccessControlList. */ + class AccessControlList implements IAccessControlList { + + /** + * Constructs a new AccessControlList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList); + + /** AccessControlList resources. */ + public resources: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource[]; + + /** AccessControlList accesses. */ + public accesses: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess[]; + + /** AccessControlList resourceEdges. */ + public resourceEdges: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessControlList instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessControlList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessControlList + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessControlList + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Verifies an AccessControlList 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 AccessControlList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessControlList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @param message AccessControlList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessControlList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IdentityList. */ + interface IIdentityList { + + /** IdentityList identities */ + identities?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity[]|null); + + /** IdentityList groupEdges */ + groupEdges?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]|null); + } + + /** Represents an IdentityList. */ + class IdentityList implements IIdentityList { + + /** + * Constructs a new IdentityList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList); + + /** IdentityList identities. */ + public identities: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity[]; + + /** IdentityList groupEdges. */ + public groupEdges: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]; + + /** + * Creates a new IdentityList instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityList instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentityList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityList + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityList + * @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.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Verifies an IdentityList 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 IdentityList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * @param message IdentityList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } } } @@ -11778,5 +13978,26 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Code enum. */ + enum Code { + OK = 0, + CANCELLED = 1, + UNKNOWN = 2, + INVALID_ARGUMENT = 3, + DEADLINE_EXCEEDED = 4, + NOT_FOUND = 5, + ALREADY_EXISTS = 6, + PERMISSION_DENIED = 7, + UNAUTHENTICATED = 16, + RESOURCE_EXHAUSTED = 8, + FAILED_PRECONDITION = 9, + ABORTED = 10, + OUT_OF_RANGE = 11, + UNIMPLEMENTED = 12, + INTERNAL = 13, + UNAVAILABLE = 14, + DATA_LOSS = 15 + } } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 9f2c7eccfac..9de100bbaec 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -13151,6 +13151,5300 @@ return v1p2beta1; })(); + asset.v1p4beta1 = (function() { + + /** + * Namespace v1p4beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p4beta1 = {}; + + v1p4beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#analyzeIamPolicy}. + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @typedef AnalyzeIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} [response] AnalyzeIamPolicyResponse + */ + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @param {google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicyCallback} callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeIamPolicy = function analyzeIamPolicy(request, callback) { + return this.rpcCall(analyzeIamPolicy, $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest, $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse, request, callback); + }, "name", { value: "AnalyzeIamPolicy" }); + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#exportIamPolicyAnalysis}. + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @typedef ExportIamPolicyAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportIamPolicyAnalysis. + * @function exportIamPolicyAnalysis + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object + * @param {google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysisCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportIamPolicyAnalysis = function exportIamPolicyAnalysis(request, callback) { + return this.rpcCall(exportIamPolicyAnalysis, $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportIamPolicyAnalysis" }); + + /** + * Calls ExportIamPolicyAnalysis. + * @function exportIamPolicyAnalysis + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p4beta1.IamPolicyAnalysisQuery = (function() { + + /** + * Properties of an IamPolicyAnalysisQuery. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IIamPolicyAnalysisQuery + * @property {string|null} [parent] IamPolicyAnalysisQuery parent + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null} [resourceSelector] IamPolicyAnalysisQuery resourceSelector + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector + */ + + /** + * Constructs a new IamPolicyAnalysisQuery. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an IamPolicyAnalysisQuery. + * @implements IIamPolicyAnalysisQuery + * @constructor + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery=} [properties] Properties to set + */ + function IamPolicyAnalysisQuery(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]]; + } + + /** + * IamPolicyAnalysisQuery parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.parent = ""; + + /** + * IamPolicyAnalysisQuery resourceSelector. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null|undefined} resourceSelector + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.resourceSelector = null; + + /** + * IamPolicyAnalysisQuery identitySelector. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null|undefined} identitySelector + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.identitySelector = null; + + /** + * IamPolicyAnalysisQuery accessSelector. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null|undefined} accessSelector + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.accessSelector = null; + + /** + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery instance + */ + IamPolicyAnalysisQuery.create = function create(properties) { + return new IamPolicyAnalysisQuery(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisQuery.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.asset.v1p4beta1.IamPolicyAnalysisQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); + break; + case 3: + message.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); + break; + case 4: + message.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisQuery message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisQuery.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.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify(message.resourceSelector); + if (error) + return "resourceSelector." + error; + } + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify(message.identitySelector); + if (error) + return "identitySelector." + error; + } + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify(message.accessSelector); + if (error) + return "accessSelector." + error; + } + return null; + }; + + /** + * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + */ + IamPolicyAnalysisQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceSelector != null) { + if (typeof object.resourceSelector !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.resourceSelector: object expected"); + message.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.fromObject(object.resourceSelector); + } + if (object.identitySelector != null) { + if (typeof object.identitySelector !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.identitySelector: object expected"); + message.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.fromObject(object.identitySelector); + } + if (object.accessSelector != null) { + if (typeof object.accessSelector !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.accessSelector: object expected"); + message.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.fromObject(object.accessSelector); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} message IamPolicyAnalysisQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceSelector = null; + object.identitySelector = null; + object.accessSelector = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + object.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.toObject(message.resourceSelector, options); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + object.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.toObject(message.identitySelector, options); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + object.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); + return object; + }; + + /** + * Converts this IamPolicyAnalysisQuery to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisQuery.ResourceSelector = (function() { + + /** + * Properties of a ResourceSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @interface IResourceSelector + * @property {string|null} [fullResourceName] ResourceSelector fullResourceName + */ + + /** + * Constructs a new ResourceSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @classdesc Represents a ResourceSelector. + * @implements IResourceSelector + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + */ + function ResourceSelector(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]]; + } + + /** + * ResourceSelector fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + */ + ResourceSelector.prototype.fullResourceName = ""; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector instance + */ + ResourceSelector.create = function create(properties) { + return new ResourceSelector(properties); + }; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + return writer; + }; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.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.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSelector message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + return null; + }; + + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + */ + ResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + return message; + }; + + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} message ResourceSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + return object; + }; + + /** + * Converts this ResourceSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + * @returns {Object.} JSON object + */ + ResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSelector; + })(); + + IamPolicyAnalysisQuery.IdentitySelector = (function() { + + /** + * Properties of an IdentitySelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @interface IIdentitySelector + * @property {string|null} [identity] IdentitySelector identity + */ + + /** + * Constructs a new IdentitySelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @classdesc Represents an IdentitySelector. + * @implements IIdentitySelector + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + */ + function IdentitySelector(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]]; + } + + /** + * IdentitySelector identity. + * @member {string} identity + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + */ + IdentitySelector.prototype.identity = ""; + + /** + * Creates a new IdentitySelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector instance + */ + IdentitySelector.create = function create(properties) { + return new IdentitySelector(properties); + }; + + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && message.hasOwnProperty("identity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity); + return writer; + }; + + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.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.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitySelector message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitySelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + return null; + }; + + /** + * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + */ + IdentitySelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector(); + if (object.identity != null) + message.identity = String(object.identity); + return message; + }; + + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} message IdentitySelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitySelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.identity = ""; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + return object; + }; + + /** + * Converts this IdentitySelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + * @returns {Object.} JSON object + */ + IdentitySelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitySelector; + })(); + + IamPolicyAnalysisQuery.AccessSelector = (function() { + + /** + * Properties of an AccessSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @interface IAccessSelector + * @property {Array.|null} [roles] AccessSelector roles + * @property {Array.|null} [permissions] AccessSelector permissions + */ + + /** + * Constructs a new AccessSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @classdesc Represents an AccessSelector. + * @implements IAccessSelector + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + */ + function AccessSelector(properties) { + this.roles = []; + this.permissions = []; + 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]]; + } + + /** + * AccessSelector roles. + * @member {Array.} roles + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.roles = $util.emptyArray; + + /** + * AccessSelector permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.permissions = $util.emptyArray; + + /** + * Creates a new AccessSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector instance + */ + AccessSelector.create = function create(properties) { + return new AccessSelector(properties); + }; + + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.roles[i]); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.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.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + case 2: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSelector message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + if (!$util.isString(message.roles[i])) + return "roles: string[] expected"; + } + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + */ + AccessSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + message.roles[i] = String(object.roles[i]); + } + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} message AccessSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.roles = []; + object.permissions = []; + } + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = message.roles[j]; + } + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this AccessSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @instance + * @returns {Object.} JSON object + */ + AccessSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessSelector; + })(); + + return IamPolicyAnalysisQuery; + })(); + + v1p4beta1.AnalyzeIamPolicyRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IAnalyzeIamPolicyRequest + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null} [options] AnalyzeIamPolicyRequest options + */ + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an AnalyzeIamPolicyRequest. + * @implements IAnalyzeIamPolicyRequest + * @constructor + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + */ + function AnalyzeIamPolicyRequest(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]]; + } + + /** + * AnalyzeIamPolicyRequest analysisQuery. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyRequest options. + * @member {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.options = null; + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest instance + */ + AnalyzeIamPolicyRequest.create = function create(properties) { + return new AnalyzeIamPolicyRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyRequest.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.asset.v1p4beta1.AnalyzeIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyRequest message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + */ + AnalyzeIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.options: object expected"); + message.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.options = null; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.toObject(message.options, options); + return object; + }; + + /** + * Converts this AnalyzeIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnalyzeIamPolicyRequest.Options = (function() { + + /** + * Properties of an Options. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @interface IOptions + * @property {boolean|null} [expandGroups] Options expandGroups + * @property {boolean|null} [expandRoles] Options expandRoles + * @property {boolean|null} [expandResources] Options expandResources + * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges + * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges + * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation + * @property {google.protobuf.IDuration|null} [executionTimeout] Options executionTimeout + */ + + /** + * Constructs a new Options. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions=} [properties] Properties to set + */ + function Options(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]]; + } + + /** + * Options expandGroups. + * @member {boolean} expandGroups + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.expandGroups = false; + + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.expandRoles = false; + + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.expandResources = false; + + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; + + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; + + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; + + /** + * Options executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.executionTimeout = null; + + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Options message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.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.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandGroups = reader.bool(); + break; + case 2: + message.expandRoles = reader.bool(); + break; + case 3: + message.expandResources = reader.bool(); + break; + case 4: + message.outputResourceEdges = reader.bool(); + break; + case 5: + message.outputGroupEdges = reader.bool(); + break; + case 6: + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + case 7: + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Options message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Options.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (typeof message.expandGroups !== "boolean") + return "expandGroups: boolean expected"; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (typeof message.expandRoles !== "boolean") + return "expandRoles: boolean expected"; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (typeof message.expandResources !== "boolean") + return "expandResources: boolean expected"; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (typeof message.outputResourceEdges !== "boolean") + return "outputResourceEdges: boolean expected"; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (typeof message.outputGroupEdges !== "boolean") + return "outputGroupEdges: boolean expected"; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (typeof message.analyzeServiceAccountImpersonation !== "boolean") + return "analyzeServiceAccountImpersonation: boolean expected"; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + error; + } + return null; + }; + + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options(); + if (object.expandGroups != null) + message.expandGroups = Boolean(object.expandGroups); + if (object.expandRoles != null) + message.expandRoles = Boolean(object.expandRoles); + if (object.expandResources != null) + message.expandResources = Boolean(object.expandResources); + if (object.outputResourceEdges != null) + message.outputResourceEdges = Boolean(object.outputResourceEdges); + if (object.outputGroupEdges != null) + message.outputGroupEdges = Boolean(object.outputGroupEdges); + if (object.analyzeServiceAccountImpersonation != null) + message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + } + return message; + }; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} message Options + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Options.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandGroups = false; + object.expandRoles = false; + object.expandResources = false; + object.outputResourceEdges = false; + object.outputGroupEdges = false; + object.analyzeServiceAccountImpersonation = false; + object.executionTimeout = null; + } + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + object.expandGroups = message.expandGroups; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + object.expandRoles = message.expandRoles; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + object.expandResources = message.expandResources; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + object.outputResourceEdges = message.outputResourceEdges; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + object.outputGroupEdges = message.outputGroupEdges; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + return object; + }; + + /** + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + return AnalyzeIamPolicyRequest; + })(); + + v1p4beta1.AnalyzeIamPolicyResponse = (function() { + + /** + * Properties of an AnalyzeIamPolicyResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IAnalyzeIamPolicyResponse + * @property {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null} [mainAnalysis] AnalyzeIamPolicyResponse mainAnalysis + * @property {Array.|null} [serviceAccountImpersonationAnalysis] AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis + * @property {boolean|null} [fullyExplored] AnalyzeIamPolicyResponse fullyExplored + * @property {Array.|null} [nonCriticalErrors] AnalyzeIamPolicyResponse nonCriticalErrors + */ + + /** + * Constructs a new AnalyzeIamPolicyResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an AnalyzeIamPolicyResponse. + * @implements IAnalyzeIamPolicyResponse + * @constructor + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + */ + function AnalyzeIamPolicyResponse(properties) { + this.serviceAccountImpersonationAnalysis = []; + this.nonCriticalErrors = []; + 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]]; + } + + /** + * AnalyzeIamPolicyResponse mainAnalysis. + * @member {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null|undefined} mainAnalysis + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.mainAnalysis = null; + + /** + * AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. + * @member {Array.} serviceAccountImpersonationAnalysis + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.serviceAccountImpersonationAnalysis = $util.emptyArray; + + /** + * AnalyzeIamPolicyResponse fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.fullyExplored = false; + + /** + * AnalyzeIamPolicyResponse nonCriticalErrors. + * @member {Array.} nonCriticalErrors + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.nonCriticalErrors = $util.emptyArray; + + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse instance + */ + AnalyzeIamPolicyResponse.create = function create(properties) { + return new AnalyzeIamPolicyResponse(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.mainAnalysis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.serviceAccountImpersonationAnalysis != null && message.serviceAccountImpersonationAnalysis.length) + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) + $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + if (message.nonCriticalErrors != null && message.nonCriticalErrors.length) + for (var i = 0; i < message.nonCriticalErrors.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.nonCriticalErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyResponse.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.asset.v1p4beta1.AnalyzeIamPolicyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); + break; + case 3: + message.fullyExplored = reader.bool(); + break; + case 4: + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyResponse message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) { + var error = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.mainAnalysis); + if (error) + return "mainAnalysis." + error; + } + if (message.serviceAccountImpersonationAnalysis != null && message.hasOwnProperty("serviceAccountImpersonationAnalysis")) { + if (!Array.isArray(message.serviceAccountImpersonationAnalysis)) + return "serviceAccountImpersonationAnalysis: array expected"; + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.serviceAccountImpersonationAnalysis[i]); + if (error) + return "serviceAccountImpersonationAnalysis." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + if (message.nonCriticalErrors != null && message.hasOwnProperty("nonCriticalErrors")) { + if (!Array.isArray(message.nonCriticalErrors)) + return "nonCriticalErrors: array expected"; + for (var i = 0; i < message.nonCriticalErrors.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.nonCriticalErrors[i]); + if (error) + return "nonCriticalErrors." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + */ + AnalyzeIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse(); + if (object.mainAnalysis != null) { + if (typeof object.mainAnalysis !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.mainAnalysis: object expected"); + message.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.mainAnalysis); + } + if (object.serviceAccountImpersonationAnalysis) { + if (!Array.isArray(object.serviceAccountImpersonationAnalysis)) + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: array expected"); + message.serviceAccountImpersonationAnalysis = []; + for (var i = 0; i < object.serviceAccountImpersonationAnalysis.length; ++i) { + if (typeof object.serviceAccountImpersonationAnalysis[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: object expected"); + message.serviceAccountImpersonationAnalysis[i] = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.serviceAccountImpersonationAnalysis[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + if (object.nonCriticalErrors) { + if (!Array.isArray(object.nonCriticalErrors)) + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.nonCriticalErrors: array expected"); + message.nonCriticalErrors = []; + for (var i = 0; i < object.nonCriticalErrors.length; ++i) { + if (typeof object.nonCriticalErrors[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.nonCriticalErrors: object expected"); + message.nonCriticalErrors[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.nonCriticalErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serviceAccountImpersonationAnalysis = []; + object.nonCriticalErrors = []; + } + if (options.defaults) { + object.mainAnalysis = null; + object.fullyExplored = false; + } + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + object.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.mainAnalysis, options); + if (message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length) { + object.serviceAccountImpersonationAnalysis = []; + for (var j = 0; j < message.serviceAccountImpersonationAnalysis.length; ++j) + object.serviceAccountImpersonationAnalysis[j] = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.serviceAccountImpersonationAnalysis[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + if (message.nonCriticalErrors && message.nonCriticalErrors.length) { + object.nonCriticalErrors = []; + for (var j = 0; j < message.nonCriticalErrors.length; ++j) + object.nonCriticalErrors[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.nonCriticalErrors[j], options); + } + return object; + }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { + + /** + * Properties of an IamPolicyAnalysis. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @interface IIamPolicyAnalysis + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null} [analysisQuery] IamPolicyAnalysis analysisQuery + * @property {Array.|null} [analysisResults] IamPolicyAnalysis analysisResults + * @property {boolean|null} [fullyExplored] IamPolicyAnalysis fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysis. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @classdesc Represents an IamPolicyAnalysis. + * @implements IIamPolicyAnalysis + * @constructor + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + */ + function IamPolicyAnalysis(properties) { + this.analysisResults = []; + 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]]; + } + + /** + * IamPolicyAnalysis analysisQuery. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisQuery = null; + + /** + * IamPolicyAnalysis analysisResults. + * @member {Array.} analysisResults + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisResults = $util.emptyArray; + + /** + * IamPolicyAnalysis fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis instance + */ + IamPolicyAnalysis.create = function create(properties) { + return new IamPolicyAnalysis(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.analysisResults != null && message.analysisResults.length) + for (var i = 0; i < message.analysisResults.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.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.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + case 3: + message.fullyExplored = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysis message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.analysisResults != null && message.hasOwnProperty("analysisResults")) { + if (!Array.isArray(message.analysisResults)) + return "analysisResults: array expected"; + for (var i = 0; i < message.analysisResults.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify(message.analysisResults[i]); + if (error) + return "analysisResults." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + */ + IamPolicyAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.analysisResults) { + if (!Array.isArray(object.analysisResults)) + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: array expected"); + message.analysisResults = []; + for (var i = 0; i < object.analysisResults.length; ++i) { + if (typeof object.analysisResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: object expected"); + message.analysisResults[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.fromObject(object.analysisResults[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} message IamPolicyAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.analysisResults = []; + if (options.defaults) { + object.analysisQuery = null; + object.fullyExplored = false; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.analysisResults && message.analysisResults.length) { + object.analysisResults = []; + for (var j = 0; j < message.analysisResults.length; ++j) + object.analysisResults[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.toObject(message.analysisResults[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicyAnalysis; + })(); + + return AnalyzeIamPolicyResponse; + })(); + + v1p4beta1.IamPolicyAnalysisOutputConfig = (function() { + + /** + * Properties of an IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IIamPolicyAnalysisOutputConfig + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null} [gcsDestination] IamPolicyAnalysisOutputConfig gcsDestination + */ + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an IamPolicyAnalysisOutputConfig. + * @implements IIamPolicyAnalysisOutputConfig + * @constructor + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + */ + function IamPolicyAnalysisOutputConfig(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]]; + } + + /** + * IamPolicyAnalysisOutputConfig gcsDestination. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @instance + */ + IamPolicyAnalysisOutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IamPolicyAnalysisOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @instance + */ + Object.defineProperty(IamPolicyAnalysisOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig instance + */ + IamPolicyAnalysisOutputConfig.create = function create(properties) { + return new IamPolicyAnalysisOutputConfig(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisOutputConfig.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.asset.v1p4beta1.IamPolicyAnalysisOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + */ + IamPolicyAnalysisOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + return IamPolicyAnalysisOutputConfig; + })(); + + v1p4beta1.ExportIamPolicyAnalysisRequest = (function() { + + /** + * Properties of an ExportIamPolicyAnalysisRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IExportIamPolicyAnalysisRequest + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null} [analysisQuery] ExportIamPolicyAnalysisRequest analysisQuery + * @property {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null} [options] ExportIamPolicyAnalysisRequest options + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] ExportIamPolicyAnalysisRequest outputConfig + */ + + /** + * Constructs a new ExportIamPolicyAnalysisRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an ExportIamPolicyAnalysisRequest. + * @implements IExportIamPolicyAnalysisRequest + * @constructor + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set + */ + function ExportIamPolicyAnalysisRequest(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]]; + } + + /** + * ExportIamPolicyAnalysisRequest analysisQuery. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.analysisQuery = null; + + /** + * ExportIamPolicyAnalysisRequest options. + * @member {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.options = null; + + /** + * ExportIamPolicyAnalysisRequest outputConfig. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest instance + */ + ExportIamPolicyAnalysisRequest.create = function create(properties) { + return new ExportIamPolicyAnalysisRequest(properties); + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisRequest.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.asset.v1p4beta1.ExportIamPolicyAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.decode(reader, reader.uint32()); + break; + case 3: + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIamPolicyAnalysisRequest message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIamPolicyAnalysisRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify(message.options); + if (error) + return "options." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + */ + ExportIamPolicyAnalysisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.options: object expected"); + message.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.fromObject(object.options); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIamPolicyAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.options = null; + object.outputConfig = null; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.toObject(message.options, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportIamPolicyAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + ExportIamPolicyAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ExportIamPolicyAnalysisRequest.Options = (function() { + + /** + * Properties of an Options. + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @interface IOptions + * @property {boolean|null} [expandGroups] Options expandGroups + * @property {boolean|null} [expandRoles] Options expandRoles + * @property {boolean|null} [expandResources] Options expandResources + * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges + * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges + * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation + */ + + /** + * Constructs a new Options. + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions=} [properties] Properties to set + */ + function Options(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]]; + } + + /** + * Options expandGroups. + * @member {boolean} expandGroups + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.expandGroups = false; + + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.expandRoles = false; + + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.expandResources = false; + + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; + + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; + + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; + + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); + return writer; + }; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Options message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.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.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandGroups = reader.bool(); + break; + case 2: + message.expandRoles = reader.bool(); + break; + case 3: + message.expandResources = reader.bool(); + break; + case 4: + message.outputResourceEdges = reader.bool(); + break; + case 5: + message.outputGroupEdges = reader.bool(); + break; + case 6: + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Options message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Options.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (typeof message.expandGroups !== "boolean") + return "expandGroups: boolean expected"; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (typeof message.expandRoles !== "boolean") + return "expandRoles: boolean expected"; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (typeof message.expandResources !== "boolean") + return "expandResources: boolean expected"; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (typeof message.outputResourceEdges !== "boolean") + return "outputResourceEdges: boolean expected"; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (typeof message.outputGroupEdges !== "boolean") + return "outputGroupEdges: boolean expected"; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (typeof message.analyzeServiceAccountImpersonation !== "boolean") + return "analyzeServiceAccountImpersonation: boolean expected"; + return null; + }; + + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options(); + if (object.expandGroups != null) + message.expandGroups = Boolean(object.expandGroups); + if (object.expandRoles != null) + message.expandRoles = Boolean(object.expandRoles); + if (object.expandResources != null) + message.expandResources = Boolean(object.expandResources); + if (object.outputResourceEdges != null) + message.outputResourceEdges = Boolean(object.outputResourceEdges); + if (object.outputGroupEdges != null) + message.outputGroupEdges = Boolean(object.outputGroupEdges); + if (object.analyzeServiceAccountImpersonation != null) + message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); + return message; + }; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} message Options + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Options.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandGroups = false; + object.expandRoles = false; + object.expandResources = false; + object.outputResourceEdges = false; + object.outputGroupEdges = false; + object.analyzeServiceAccountImpersonation = false; + } + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + object.expandGroups = message.expandGroups; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + object.expandRoles = message.expandRoles; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + object.expandResources = message.expandResources; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + object.outputResourceEdges = message.outputResourceEdges; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + object.outputGroupEdges = message.outputGroupEdges; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; + return object; + }; + + /** + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + return ExportIamPolicyAnalysisRequest; + })(); + + v1p4beta1.ExportIamPolicyAnalysisResponse = (function() { + + /** + * Properties of an ExportIamPolicyAnalysisResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IExportIamPolicyAnalysisResponse + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] ExportIamPolicyAnalysisResponse outputConfig + */ + + /** + * Constructs a new ExportIamPolicyAnalysisResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an ExportIamPolicyAnalysisResponse. + * @implements IExportIamPolicyAnalysisResponse + * @constructor + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set + */ + function ExportIamPolicyAnalysisResponse(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]]; + } + + /** + * ExportIamPolicyAnalysisResponse outputConfig. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @instance + */ + ExportIamPolicyAnalysisResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportIamPolicyAnalysisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse instance + */ + ExportIamPolicyAnalysisResponse.create = function create(properties) { + return new ExportIamPolicyAnalysisResponse(properties); + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisResponse.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.asset.v1p4beta1.ExportIamPolicyAnalysisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIamPolicyAnalysisResponse message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIamPolicyAnalysisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + */ + ExportIamPolicyAnalysisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIamPolicyAnalysisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportIamPolicyAnalysisResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @instance + * @returns {Object.} JSON object + */ + ExportIamPolicyAnalysisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportIamPolicyAnalysisResponse; + })(); + + v1p4beta1.IamPolicyAnalysisResult = (function() { + + /** + * Properties of an IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IIamPolicyAnalysisResult + * @property {string|null} [attachedResourceFullName] IamPolicyAnalysisResult attachedResourceFullName + * @property {google.iam.v1.IBinding|null} [iamBinding] IamPolicyAnalysisResult iamBinding + * @property {Array.|null} [accessControlLists] IamPolicyAnalysisResult accessControlLists + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList|null} [identityList] IamPolicyAnalysisResult identityList + * @property {boolean|null} [fullyExplored] IamPolicyAnalysisResult fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an IamPolicyAnalysisResult. + * @implements IIamPolicyAnalysisResult + * @constructor + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult=} [properties] Properties to set + */ + function IamPolicyAnalysisResult(properties) { + this.accessControlLists = []; + 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]]; + } + + /** + * IamPolicyAnalysisResult attachedResourceFullName. + * @member {string} attachedResourceFullName + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.attachedResourceFullName = ""; + + /** + * IamPolicyAnalysisResult iamBinding. + * @member {google.iam.v1.IBinding|null|undefined} iamBinding + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.iamBinding = null; + + /** + * IamPolicyAnalysisResult accessControlLists. + * @member {Array.} accessControlLists + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.accessControlLists = $util.emptyArray; + + /** + * IamPolicyAnalysisResult identityList. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList|null|undefined} identityList + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.identityList = null; + + /** + * IamPolicyAnalysisResult fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult instance + */ + IamPolicyAnalysisResult.create = function create(properties) { + return new IamPolicyAnalysisResult(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + $root.google.iam.v1.Binding.encode(message.iamBinding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessControlLists != null && message.accessControlLists.length) + for (var i = 0; i < message.accessControlLists.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.identityList != null && message.hasOwnProperty("identityList")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.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.asset.v1p4beta1.IamPolicyAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attachedResourceFullName = reader.string(); + break; + case 2: + message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.accessControlLists && message.accessControlLists.length)) + message.accessControlLists = []; + message.accessControlLists.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + case 4: + message.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); + break; + case 5: + message.fullyExplored = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + if (!$util.isString(message.attachedResourceFullName)) + return "attachedResourceFullName: string expected"; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) { + var error = $root.google.iam.v1.Binding.verify(message.iamBinding); + if (error) + return "iamBinding." + error; + } + if (message.accessControlLists != null && message.hasOwnProperty("accessControlLists")) { + if (!Array.isArray(message.accessControlLists)) + return "accessControlLists: array expected"; + for (var i = 0; i < message.accessControlLists.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify(message.accessControlLists[i]); + if (error) + return "accessControlLists." + error; + } + } + if (message.identityList != null && message.hasOwnProperty("identityList")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify(message.identityList); + if (error) + return "identityList." + error; + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + */ + IamPolicyAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult(); + if (object.attachedResourceFullName != null) + message.attachedResourceFullName = String(object.attachedResourceFullName); + if (object.iamBinding != null) { + if (typeof object.iamBinding !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iamBinding: object expected"); + message.iamBinding = $root.google.iam.v1.Binding.fromObject(object.iamBinding); + } + if (object.accessControlLists) { + if (!Array.isArray(object.accessControlLists)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.accessControlLists: array expected"); + message.accessControlLists = []; + for (var i = 0; i < object.accessControlLists.length; ++i) { + if (typeof object.accessControlLists[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.accessControlLists: object expected"); + message.accessControlLists[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.fromObject(object.accessControlLists[i]); + } + } + if (object.identityList != null) { + if (typeof object.identityList !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.identityList: object expected"); + message.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.fromObject(object.identityList); + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} message IamPolicyAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accessControlLists = []; + if (options.defaults) { + object.attachedResourceFullName = ""; + object.iamBinding = null; + object.identityList = null; + object.fullyExplored = false; + } + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + object.attachedResourceFullName = message.attachedResourceFullName; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + object.iamBinding = $root.google.iam.v1.Binding.toObject(message.iamBinding, options); + if (message.accessControlLists && message.accessControlLists.length) { + object.accessControlLists = []; + for (var j = 0; j < message.accessControlLists.length; ++j) + object.accessControlLists[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.toObject(message.accessControlLists[j], options); + } + if (message.identityList != null && message.hasOwnProperty("identityList")) + object.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.toObject(message.identityList, options); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisResult.AnalysisState = (function() { + + /** + * Properties of an AnalysisState. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IAnalysisState + * @property {google.rpc.Code|null} [code] AnalysisState code + * @property {string|null} [cause] AnalysisState cause + */ + + /** + * Constructs a new AnalysisState. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an AnalysisState. + * @implements IAnalysisState + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState=} [properties] Properties to set + */ + function AnalysisState(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]]; + } + + /** + * AnalysisState code. + * @member {google.rpc.Code} code + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @instance + */ + AnalysisState.prototype.code = 0; + + /** + * AnalysisState cause. + * @member {string} cause + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @instance + */ + AnalysisState.prototype.cause = ""; + + /** + * Creates a new AnalysisState instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState instance + */ + AnalysisState.create = function create(properties) { + return new AnalysisState(properties); + }; + + /** + * Encodes the specified AnalysisState message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState} message AnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalysisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.cause != null && message.hasOwnProperty("cause")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); + return writer; + }; + + /** + * Encodes the specified AnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState} message AnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalysisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalysisState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalysisState.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.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.cause = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalysisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalysisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalysisState message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalysisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.cause != null && message.hasOwnProperty("cause")) + if (!$util.isString(message.cause)) + return "cause: string expected"; + return null; + }; + + /** + * Creates an AnalysisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState + */ + AnalysisState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState(); + switch (object.code) { + case "OK": + case 0: + message.code = 0; + break; + case "CANCELLED": + case 1: + message.code = 1; + break; + case "UNKNOWN": + case 2: + message.code = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.code = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.code = 4; + break; + case "NOT_FOUND": + case 5: + message.code = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.code = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.code = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.code = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.code = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.code = 9; + break; + case "ABORTED": + case 10: + message.code = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.code = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.code = 12; + break; + case "INTERNAL": + case 13: + message.code = 13; + break; + case "UNAVAILABLE": + case 14: + message.code = 14; + break; + case "DATA_LOSS": + case 15: + message.code = 15; + break; + } + if (object.cause != null) + message.cause = String(object.cause); + return message; + }; + + /** + * Creates a plain object from an AnalysisState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} message AnalysisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalysisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "OK" : 0; + object.cause = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; + if (message.cause != null && message.hasOwnProperty("cause")) + object.cause = message.cause; + return object; + }; + + /** + * Converts this AnalysisState to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @instance + * @returns {Object.} JSON object + */ + AnalysisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalysisState; + })(); + + IamPolicyAnalysisResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IResource + * @property {string|null} [fullResourceName] Resource fullResourceName + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null} [analysisState] Resource analysisState + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.fullResourceName = ""; + + /** + * Resource analysisState. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.analysisState = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1p4beta1.IamPolicyAnalysisResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fullResourceName = ""; + object.analysisState = null; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + IamPolicyAnalysisResult.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IAccess + * @property {string|null} [role] Access role + * @property {string|null} [permission] Access permission + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null} [analysisState] Access analysisState + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + */ + function Access(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]]; + } + + /** + * Access role. + * @member {string} role + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.role = ""; + + /** + * Access permission. + * @member {string} permission + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.permission = ""; + + /** + * Access analysisState. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.analysisState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Access oneofAccess. + * @member {"role"|"permission"|undefined} oneofAccess + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Object.defineProperty(Access.prototype, "oneofAccess", { + get: $util.oneOfGetter($oneOfFields = ["role", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.permission != null && message.hasOwnProperty("permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.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.asset.v1p4beta1.IamPolicyAnalysisResult.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.permission = reader.string(); + break; + case 3: + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.role != null && message.hasOwnProperty("role")) { + properties.oneofAccess = 1; + if (!$util.isString(message.role)) + return "role: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.oneofAccess === 1) + return "oneofAccess: multiple values"; + properties.oneofAccess = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access(); + if (object.role != null) + message.role = String(object.role); + if (object.permission != null) + message.permission = String(object.permission); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analysisState = null; + if (message.role != null && message.hasOwnProperty("role")) { + object.role = message.role; + if (options.oneofs) + object.oneofAccess = "role"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.oneofAccess = "permission"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Access; + })(); + + IamPolicyAnalysisResult.Edge = (function() { + + /** + * Properties of an Edge. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IEdge + * @property {string|null} [sourceNode] Edge sourceNode + * @property {string|null} [targetNode] Edge targetNode + */ + + /** + * Constructs a new Edge. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an Edge. + * @implements IEdge + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + */ + function Edge(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]]; + } + + /** + * Edge sourceNode. + * @member {string} sourceNode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.sourceNode = ""; + + /** + * Edge targetNode. + * @member {string} targetNode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.targetNode = ""; + + /** + * Creates a new Edge instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge instance + */ + Edge.create = function create(properties) { + return new Edge(properties); + }; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetNode); + return writer; + }; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.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.asset.v1p4beta1.IamPolicyAnalysisResult.Edge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceNode = reader.string(); + break; + case 2: + message.targetNode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Edge message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Edge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + if (!$util.isString(message.sourceNode)) + return "sourceNode: string expected"; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + if (!$util.isString(message.targetNode)) + return "targetNode: string expected"; + return null; + }; + + /** + * Creates an Edge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge + */ + Edge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge(); + if (object.sourceNode != null) + message.sourceNode = String(object.sourceNode); + if (object.targetNode != null) + message.targetNode = String(object.targetNode); + return message; + }; + + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} message Edge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Edge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceNode = ""; + object.targetNode = ""; + } + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + object.sourceNode = message.sourceNode; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + object.targetNode = message.targetNode; + return object; + }; + + /** + * Converts this Edge to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @instance + * @returns {Object.} JSON object + */ + Edge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Edge; + })(); + + IamPolicyAnalysisResult.Identity = (function() { + + /** + * Properties of an Identity. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IIdentity + * @property {string|null} [name] Identity name + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null} [analysisState] Identity analysisState + */ + + /** + * Constructs a new Identity. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an Identity. + * @implements IIdentity + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + */ + function Identity(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]]; + } + + /** + * Identity name. + * @member {string} name + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.name = ""; + + /** + * Identity analysisState. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.analysisState = null; + + /** + * Creates a new Identity instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity instance + */ + Identity.create = function create(properties) { + return new Identity(properties); + }; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.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.asset.v1p4beta1.IamPolicyAnalysisResult.Identity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Identity message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Identity.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.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity + */ + Identity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity(); + if (object.name != null) + message.name = String(object.name); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} message Identity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Identity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.analysisState = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Identity to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @instance + * @returns {Object.} JSON object + */ + Identity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Identity; + })(); + + IamPolicyAnalysisResult.AccessControlList = (function() { + + /** + * Properties of an AccessControlList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IAccessControlList + * @property {Array.|null} [resources] AccessControlList resources + * @property {Array.|null} [accesses] AccessControlList accesses + * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges + */ + + /** + * Constructs a new AccessControlList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an AccessControlList. + * @implements IAccessControlList + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + */ + function AccessControlList(properties) { + this.resources = []; + this.accesses = []; + this.resourceEdges = []; + 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]]; + } + + /** + * AccessControlList resources. + * @member {Array.} resources + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resources = $util.emptyArray; + + /** + * AccessControlList accesses. + * @member {Array.} accesses + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.accesses = $util.emptyArray; + + /** + * AccessControlList resourceEdges. + * @member {Array.} resourceEdges + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resourceEdges = $util.emptyArray; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList instance + */ + AccessControlList.create = function create(properties) { + return new AccessControlList(properties); + }; + + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.accesses != null && message.accesses.length) + for (var i = 0; i < message.accesses.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.encode(message.accesses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceEdges != null && message.resourceEdges.length) + for (var i = 0; i < message.resourceEdges.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessControlList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.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.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessControlList message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessControlList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.accesses != null && message.hasOwnProperty("accesses")) { + if (!Array.isArray(message.accesses)) + return "accesses: array expected"; + for (var i = 0; i < message.accesses.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify(message.accesses[i]); + if (error) + return "accesses." + error; + } + } + if (message.resourceEdges != null && message.hasOwnProperty("resourceEdges")) { + if (!Array.isArray(message.resourceEdges)) + return "resourceEdges: array expected"; + for (var i = 0; i < message.resourceEdges.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify(message.resourceEdges[i]); + if (error) + return "resourceEdges." + error; + } + } + return null; + }; + + /** + * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + */ + AccessControlList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resources: object expected"); + message.resources[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.fromObject(object.resources[i]); + } + } + if (object.accesses) { + if (!Array.isArray(object.accesses)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.accesses: array expected"); + message.accesses = []; + for (var i = 0; i < object.accesses.length; ++i) { + if (typeof object.accesses[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.accesses: object expected"); + message.accesses[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.fromObject(object.accesses[i]); + } + } + if (object.resourceEdges) { + if (!Array.isArray(object.resourceEdges)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: array expected"); + message.resourceEdges = []; + for (var i = 0; i < object.resourceEdges.length; ++i) { + if (typeof object.resourceEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: object expected"); + message.resourceEdges[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} message AccessControlList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessControlList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accesses = []; + object.resourceEdges = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.toObject(message.resources[j], options); + } + if (message.accesses && message.accesses.length) { + object.accesses = []; + for (var j = 0; j < message.accesses.length; ++j) + object.accesses[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.toObject(message.accesses[j], options); + } + if (message.resourceEdges && message.resourceEdges.length) { + object.resourceEdges = []; + for (var j = 0; j < message.resourceEdges.length; ++j) + object.resourceEdges[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); + } + return object; + }; + + /** + * Converts this AccessControlList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + * @returns {Object.} JSON object + */ + AccessControlList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessControlList; + })(); + + IamPolicyAnalysisResult.IdentityList = (function() { + + /** + * Properties of an IdentityList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IIdentityList + * @property {Array.|null} [identities] IdentityList identities + * @property {Array.|null} [groupEdges] IdentityList groupEdges + */ + + /** + * Constructs a new IdentityList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an IdentityList. + * @implements IIdentityList + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + */ + function IdentityList(properties) { + this.identities = []; + this.groupEdges = []; + 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]]; + } + + /** + * IdentityList identities. + * @member {Array.} identities + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.identities = $util.emptyArray; + + /** + * IdentityList groupEdges. + * @member {Array.} groupEdges + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.groupEdges = $util.emptyArray; + + /** + * Creates a new IdentityList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList instance + */ + IdentityList.create = function create(properties) { + return new IdentityList(properties); + }; + + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.encode(message.identities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupEdges != null && message.groupEdges.length) + for (var i = 0; i < message.groupEdges.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.encode(message.groupEdges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityList.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.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityList message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identities != null && message.hasOwnProperty("identities")) { + if (!Array.isArray(message.identities)) + return "identities: array expected"; + for (var i = 0; i < message.identities.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify(message.identities[i]); + if (error) + return "identities." + error; + } + } + if (message.groupEdges != null && message.hasOwnProperty("groupEdges")) { + if (!Array.isArray(message.groupEdges)) + return "groupEdges: array expected"; + for (var i = 0; i < message.groupEdges.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify(message.groupEdges[i]); + if (error) + return "groupEdges." + error; + } + } + return null; + }; + + /** + * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList + */ + IdentityList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) { + if (typeof object.identities[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities: object expected"); + message.identities[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.fromObject(object.identities[i]); + } + } + if (object.groupEdges) { + if (!Array.isArray(object.groupEdges)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.groupEdges: array expected"); + message.groupEdges = []; + for (var i = 0; i < object.groupEdges.length; ++i) { + if (typeof object.groupEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.groupEdges: object expected"); + message.groupEdges[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.fromObject(object.groupEdges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} message IdentityList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identities = []; + object.groupEdges = []; + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.toObject(message.identities[j], options); + } + if (message.groupEdges && message.groupEdges.length) { + object.groupEdges = []; + for (var j = 0; j < message.groupEdges.length; ++j) + object.groupEdges[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.toObject(message.groupEdges[j], options); + } + return object; + }; + + /** + * Converts this IdentityList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @instance + * @returns {Object.} JSON object + */ + IdentityList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityList; + })(); + + return IamPolicyAnalysisResult; + })(); + + return v1p4beta1; + })(); + return asset; })(); @@ -29080,6 +34374,50 @@ return Status; })(); + /** + * Code enum. + * @name google.rpc.Code + * @enum {string} + * @property {number} OK=0 OK value + * @property {number} CANCELLED=1 CANCELLED value + * @property {number} UNKNOWN=2 UNKNOWN value + * @property {number} INVALID_ARGUMENT=3 INVALID_ARGUMENT value + * @property {number} DEADLINE_EXCEEDED=4 DEADLINE_EXCEEDED value + * @property {number} NOT_FOUND=5 NOT_FOUND value + * @property {number} ALREADY_EXISTS=6 ALREADY_EXISTS value + * @property {number} PERMISSION_DENIED=7 PERMISSION_DENIED value + * @property {number} UNAUTHENTICATED=16 UNAUTHENTICATED value + * @property {number} RESOURCE_EXHAUSTED=8 RESOURCE_EXHAUSTED value + * @property {number} FAILED_PRECONDITION=9 FAILED_PRECONDITION value + * @property {number} ABORTED=10 ABORTED value + * @property {number} OUT_OF_RANGE=11 OUT_OF_RANGE value + * @property {number} UNIMPLEMENTED=12 UNIMPLEMENTED value + * @property {number} INTERNAL=13 INTERNAL value + * @property {number} UNAVAILABLE=14 UNAVAILABLE value + * @property {number} DATA_LOSS=15 DATA_LOSS value + */ + rpc.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "CANCELLED"] = 1; + values[valuesById[2] = "UNKNOWN"] = 2; + values[valuesById[3] = "INVALID_ARGUMENT"] = 3; + values[valuesById[4] = "DEADLINE_EXCEEDED"] = 4; + values[valuesById[5] = "NOT_FOUND"] = 5; + values[valuesById[6] = "ALREADY_EXISTS"] = 6; + values[valuesById[7] = "PERMISSION_DENIED"] = 7; + values[valuesById[16] = "UNAUTHENTICATED"] = 16; + values[valuesById[8] = "RESOURCE_EXHAUSTED"] = 8; + values[valuesById[9] = "FAILED_PRECONDITION"] = 9; + values[valuesById[10] = "ABORTED"] = 10; + values[valuesById[11] = "OUT_OF_RANGE"] = 11; + values[valuesById[12] = "UNIMPLEMENTED"] = 12; + values[valuesById[13] = "INTERNAL"] = 13; + values[valuesById[14] = "UNAVAILABLE"] = 14; + values[valuesById[15] = "DATA_LOSS"] = 15; + return values; + })(); + return rpc; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 17c44fa8aff..2728c4efb84 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1227,6 +1227,475 @@ } } } + }, + "v1p4beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1P4Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p4beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p4beta1", + "cc_enable_arenas": true + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnalyzeIamPolicy": { + "requestType": "AnalyzeIamPolicyRequest", + "responseType": "AnalyzeIamPolicyResponse", + "options": { + "(google.api.http).get": "/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy" + } + }, + "ExportIamPolicyAnalysis": { + "requestType": "ExportIamPolicyAnalysisRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest" + } + } + } + }, + "IamPolicyAnalysisQuery": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceSelector": { + "type": "ResourceSelector", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identitySelector": { + "type": "IdentitySelector", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessSelector": { + "type": "AccessSelector", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ResourceSelector": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IdentitySelector": { + "fields": { + "identity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AccessSelector": { + "fields": { + "roles": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AnalyzeIamPolicyRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "options": { + "type": "Options", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Options": { + "fields": { + "expandGroups": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandRoles": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputResourceEdges": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputGroupEdges": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "analyzeServiceAccountImpersonation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AnalyzeIamPolicyResponse": { + "fields": { + "mainAnalysis": { + "type": "IamPolicyAnalysis", + "id": 1 + }, + "serviceAccountImpersonationAnalysis": { + "rule": "repeated", + "type": "IamPolicyAnalysis", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + }, + "nonCriticalErrors": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult.AnalysisState", + "id": 4 + } + }, + "nested": { + "IamPolicyAnalysis": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + }, + "analysisResults": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "IamPolicyAnalysisOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + }, + "nested": { + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ExportIamPolicyAnalysisRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "options": { + "type": "Options", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Options": { + "fields": { + "expandGroups": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandRoles": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputResourceEdges": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputGroupEdges": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "analyzeServiceAccountImpersonation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ExportIamPolicyAnalysisResponse": { + "fields": { + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 1 + } + } + }, + "IamPolicyAnalysisResult": { + "fields": { + "attachedResourceFullName": { + "type": "string", + "id": 1 + }, + "iamBinding": { + "type": "google.iam.v1.Binding", + "id": 2 + }, + "accessControlLists": { + "rule": "repeated", + "type": "AccessControlList", + "id": 3 + }, + "identityList": { + "type": "IdentityList", + "id": 4 + }, + "fullyExplored": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AnalysisState": { + "fields": { + "code": { + "type": "google.rpc.Code", + "id": 1 + }, + "cause": { + "type": "string", + "id": 2 + } + } + }, + "Resource": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "AnalysisState", + "id": 2 + } + } + }, + "Access": { + "oneofs": { + "oneofAccess": { + "oneof": [ + "role", + "permission" + ] + } + }, + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + }, + "analysisState": { + "type": "AnalysisState", + "id": 3 + } + } + }, + "Edge": { + "fields": { + "sourceNode": { + "type": "string", + "id": 1 + }, + "targetNode": { + "type": "string", + "id": 2 + } + } + }, + "Identity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "AnalysisState", + "id": 2 + } + } + }, + "AccessControlList": { + "fields": { + "resources": { + "rule": "repeated", + "type": "Resource", + "id": 1 + }, + "accesses": { + "rule": "repeated", + "type": "Access", + "id": 2 + }, + "resourceEdges": { + "rule": "repeated", + "type": "Edge", + "id": 3 + } + } + }, + "IdentityList": { + "fields": { + "identities": { + "rule": "repeated", + "type": "Identity", + "id": 1 + }, + "groupEdges": { + "rule": "repeated", + "type": "Edge", + "id": 2 + } + } + } + } + } + } } } } @@ -2757,9 +3226,9 @@ }, "rpc": { "options": { - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "go_package": "google.golang.org/genproto/googleapis/rpc/code;code", "java_multiple_files": true, - "java_outer_classname": "StatusProto", + "java_outer_classname": "CodeProto", "java_package": "com.google.rpc", "objc_class_prefix": "RPC" }, @@ -2780,6 +3249,27 @@ "id": 3 } } + }, + "Code": { + "values": { + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15 + } } } } diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 7f0992d1036..d10510bfa80 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -20,10 +20,18 @@ import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; +import * as v1p4beta1 from './v1p4beta1'; const AssetServiceClient = v1.AssetServiceClient; -export {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +export {v1, v1beta1, v1p1beta1, v1p4beta1, v1p2beta1, AssetServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export -export default {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +export default { + v1, + v1beta1, + v1p1beta1, + v1p2beta1, + v1p4beta1, + AssetServiceClient, +}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts new file mode 100644 index 00000000000..18be1e8c02b --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -0,0 +1,511 @@ +// Copyright 2019 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p4beta1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + 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; + operationsClient: gax.OperationsClient; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @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 AssetServiceClient; + 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; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).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 ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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( + 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 exportIamPolicyAnalysisResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse' + ) as gax.protobuf.Type; + const exportIamPolicyAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + exportIamPolicyAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportIamPolicyAnalysisResponse.decode.bind( + exportIamPolicyAnalysisResponse + ), + exportIamPolicyAnalysisMetadata.decode.bind( + exportIamPolicyAnalysisMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p4beta1.AssetService', + 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.assetServiceStub) { + return this.assetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.asset.v1p4beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p4beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.cloud.asset.v1p4beta1.AssetService, + 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 assetServiceStubMethods = [ + 'analyzeIamPolicy', + 'exportIamPolicyAnalysis', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.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 -- + // ------------------- + analyzeIamPolicy( + request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + ( + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined + ), + {} | undefined + ] + >; + analyzeIamPolicy( + request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Analyzes IAM policies based on the specified request. Returns + * a list of {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult|IamPolicyAnalysisResult} matching the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} [request.options] + * Optional. The request options. + * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + analyzeIamPolicy( + request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + ( + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | 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({ + 'analysis_query.parent': request.analysisQuery!.parent || '', + }); + this.initialize(); + return this._innerApiCalls.analyzeIamPolicy(request, options, callback); + } + + exportIamPolicyAnalysis( + request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportIamPolicyAnalysis( + request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Exports IAM policy analysis based on the specified request. This API + * implements the {@link google.longrunning.Operation|google.longrunning.Operation} API allowing you to keep + * track of the export. The metadata contains the request to help callers to + * map responses to requests. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} [request.options] + * Optional. The request options. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output to. + * @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. + */ + exportIamPolicyAnalysis( + request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.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({ + 'analysis_query.parent': request.analysisQuery!.parent || '', + }); + this.initialize(); + return this._innerApiCalls.exportIamPolicyAnalysis( + request, + options, + callback + ); + } + + /** + * 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.assetServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json new file mode 100644 index 00000000000..9f0c6639043 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.asset.v1p4beta1.AssetService": { + "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 + } + }, + "methods": { + "AnalyzeIamPolicy": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportIamPolicyAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..081fb125b33 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/asset/v1p4beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p4beta1/assets.proto" +] diff --git a/packages/google-cloud-asset/src/v1p4beta1/index.ts b/packages/google-cloud-asset/src/v1p4beta1/index.ts new file mode 100644 index 00000000000..6890c43379a --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2019 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 {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 93e6a24b347..dde248d4b06 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,13 +1,12 @@ { - "updateTime": "2020-03-05T23:01:19.178450Z", + "updateTime": "2020-03-17T01:42:52.620638Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" + "sha": "1976b9981e2900c8172b7d34b4220bdb18c5db42", + "internalRef": "301205325" } }, { @@ -54,6 +53,15 @@ "language": "typescript", "generator": "gapic-generator-typescript" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p4beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index aaeb2aa1df8..0cafdb0d148 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -21,7 +21,7 @@ logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1'] +versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1'] name = 'asset' for version in versions: library = gapic.typescript_library( diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts new file mode 100644 index 00000000000..9a8ce3c619e --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts @@ -0,0 +1,246 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1p4beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p4beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p4beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = assetserviceModule.v1p4beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + it('has close method', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + describe('analyzeIamPolicy', () => { + it('invokes analyzeIamPolicy without error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.analyzeIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes analyzeIamPolicy with error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.analyzeIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('exportIamPolicyAnalysis', () => { + it('invokes exportIamPolicyAnalysis without error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .exportIamPolicyAnalysis(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes exportIamPolicyAnalysis with error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .exportIamPolicyAnalysis(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); From 23850277dfd7ada9648e8836bd0d91ba601604ce Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 18 Mar 2020 13:02:15 -0700 Subject: [PATCH 189/429] docs: mention templates in contributing section of README (#286) --- packages/google-cloud-asset/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index f4ca5737aae..d544977ff31 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -130,6 +130,12 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/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 From 8ebe57444c61709fd2e5c00120306646e5d075dd Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 19 Mar 2020 08:52:12 -0700 Subject: [PATCH 190/429] chore: remove snippet leading whitespace (#288) --- packages/google-cloud-asset/README.md | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index d544977ff31..dd4d5352df8 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -55,32 +55,32 @@ npm install @google-cloud/asset ### Using the client library ```javascript - const util = require('util'); - const {AssetServiceClient} = require('@google-cloud/asset'); - - const client = new AssetServiceClient(); - - async function quickstart() { - const projectId = await client.getProjectId(); - const projectResource = `projects/${projectId}`; - // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. - // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; - - const request = { - parent: projectResource, - assetNames: assetNames.split(','), - contentType: 'RESOURCE', - readTimeWindow: { - startTime: { - seconds: Math.floor(new Date().getTime() / 1000), - }, +const util = require('util'); +const {AssetServiceClient} = require('@google-cloud/asset'); + +const client = new AssetServiceClient(); + +async function quickstart() { + const projectId = await client.getProjectId(); + const projectResource = `projects/${projectId}`; + // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. + // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; + + const request = { + parent: projectResource, + assetNames: assetNames.split(','), + contentType: 'RESOURCE', + readTimeWindow: { + startTime: { + seconds: Math.floor(new Date().getTime() / 1000), }, - }; + }, + }; - // Handle the operation using the promise pattern. - const result = await client.batchGetAssetsHistory(request); - // Do things with with the response. - console.log(util.inspect(result, {depth: null})); + // Handle the operation using the promise pattern. + const result = await client.batchGetAssetsHistory(request); + // Do things with with the response. + console.log(util.inspect(result, {depth: null})); ``` From c2cb80bc77bd67fc84d2157f6ddd21e7913c8866 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Mar 2020 18:28:32 -0700 Subject: [PATCH 191/429] docs: document version support goals (#293) --- packages/google-cloud-asset/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index dd4d5352df8..219f8e1f82a 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -107,6 +107,27 @@ has instructions for running the samples. The [Cloud Asset Inventory 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/). From aa028d087bb71e835a1e249e2b1ddc76ebd2485c Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Tue, 24 Mar 2020 15:46:15 -0700 Subject: [PATCH 192/429] update dependency (#294) --- packages/google-cloud-asset/.eslintrc.json | 3 ++ packages/google-cloud-asset/.eslintrc.yml | 15 ------- packages/google-cloud-asset/.prettierrc | 8 ---- packages/google-cloud-asset/.prettierrc.js | 17 ++++++++ packages/google-cloud-asset/package.json | 39 ++++++++----------- .../src/v1/asset_service_client.ts | 5 ++- .../src/v1beta1/asset_service_client.ts | 5 ++- .../src/v1p1beta1/asset_service_client.ts | 6 +-- .../src/v1p2beta1/asset_service_client.ts | 4 +- .../src/v1p4beta1/asset_service_client.ts | 5 ++- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-asset/system-test/install.ts | 4 +- .../test/gapic-asset_service-v1.ts | 17 ++------ .../test/gapic-asset_service-v1beta1.ts | 7 ++-- .../test/gapic-asset_service-v1p1beta1.ts | 5 ++- .../test/gapic-asset_service-v1p2beta1.ts | 13 ++----- .../test/gapic-asset_service-v1p4beta1.ts | 7 ++-- packages/google-cloud-asset/webpack.config.js | 12 +++--- 19 files changed, 79 insertions(+), 96 deletions(-) create mode 100644 packages/google-cloud-asset/.eslintrc.json delete mode 100644 packages/google-cloud-asset/.eslintrc.yml delete mode 100644 packages/google-cloud-asset/.prettierrc create mode 100644 packages/google-cloud-asset/.prettierrc.js diff --git a/packages/google-cloud-asset/.eslintrc.json b/packages/google-cloud-asset/.eslintrc.json new file mode 100644 index 00000000000..eb23147be61 --- /dev/null +++ b/packages/google-cloud-asset/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-asset/.eslintrc.yml b/packages/google-cloud-asset/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-asset/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-asset/.prettierrc b/packages/google-cloud-asset/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-asset/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-asset/.prettierrc.js b/packages/google-cloud-asset/.prettierrc.js new file mode 100644 index 00000000000..21df107092c --- /dev/null +++ b/packages/google-cloud-asset/.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 +// +// 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 3ad8fabc021..51e7fec41c6 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8.10.0" + "node": ">=10.0.0" }, "repository": "googleapis/nodejs-asset", "main": "build/src/index.js", @@ -43,30 +43,25 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^1.14.1", - "protobufjs": "^6.8.0" + "google-gax": "^1.15.1", + "protobufjs": "^6.8.9" }, "devDependencies": { - "@types/mocha": "^7.0.0", - "@types/node": "^12.0.0", - "c8": "^7.0.1", - "codecov": "^3.0.4", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", - "gts": "^1.0.0", - "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", - "linkinator": "^2.0.0", - "mocha": "^7.0.0", + "@types/mocha": "^7.0.2", + "@types/node": "^13.9.3", + "c8": "^7.1.0", + "codecov": "^3.6.5", + "gts": "^2.0.0-alpha.5", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.0.4", + "mocha": "^7.1.1", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.13.7", - "ts-loader": "^6.2.1", - "typescript": "~3.6.4", - "webpack": "^4.41.2", - "webpack-cli": "^3.3.10" + "ts-loader": "^6.2.2", + "typescript": "~3.8.3", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11" } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 5efcd8e79b1..ee309055227 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -163,6 +163,7 @@ export class AssetServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + /* eslint-disable @typescript-eslint/no-var-requires */ require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -227,6 +228,7 @@ export class AssetServiceClient { 'google.cloud.asset.v1.AssetService' ) : // tslint:disable-next-line no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ (this._protos as any).google.cloud.asset.v1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -249,7 +251,8 @@ export class AssetServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index dc6b2d88d12..563a9dcd703 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -147,6 +147,7 @@ export class AssetServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + /* eslint-disable @typescript-eslint/no-var-requires */ require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -211,6 +212,7 @@ export class AssetServiceClient { 'google.cloud.asset.v1beta1.AssetService' ) : // tslint:disable-next-line no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ (this._protos as any).google.cloud.asset.v1beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -225,7 +227,8 @@ export class AssetServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index e53bdfd0e3f..fd965c29efb 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -23,8 +23,6 @@ import { CallOptions, Descriptors, ClientOptions, - PaginationCallback, - PaginationResponse, } from 'google-gax'; import * as path from 'path'; @@ -198,6 +196,7 @@ export class AssetServiceClient { 'google.cloud.asset.v1p1beta1.AssetService' ) : // tslint:disable-next-line no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ (this._protos as any).google.cloud.asset.v1p1beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -215,7 +214,8 @@ export class AssetServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 00796f3e511..3348b8c0a4b 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -195,6 +195,7 @@ export class AssetServiceClient { 'google.cloud.asset.v1p2beta1.AssetService' ) : // tslint:disable-next-line no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ (this._protos as any).google.cloud.asset.v1p2beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -215,7 +216,8 @@ export class AssetServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 18be1e8c02b..d7ea8f96a7a 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -147,6 +147,7 @@ export class AssetServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + /* eslint-disable @typescript-eslint/no-var-requires */ require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -215,6 +216,7 @@ export class AssetServiceClient { 'google.cloud.asset.v1p4beta1.AssetService' ) : // tslint:disable-next-line no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ (this._protos as any).google.cloud.asset.v1p4beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -232,7 +234,8 @@ export class AssetServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js index 6f3575b6c25..77608a15112 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** 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 asset = require('@google-cloud/asset'); diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index 1c292d6b651..6ba56206311 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {AssetServiceClient} from '@google-cloud/asset'; function main() { - const assetServiceClient = new AssetServiceClient(); + new AssetServiceClient(); } main(); diff --git a/packages/google-cloud-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts index c9aa74ec221..0581f7fc273 100644 --- a/packages/google-cloud-asset/system-test/install.ts +++ b/packages/google-cloud-asset/system-test/install.ts @@ -21,7 +21,7 @@ import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. @@ -35,7 +35,7 @@ describe('typescript consumer tests', () => { await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts index d79fd23bb73..532b495fc55 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts @@ -19,6 +19,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; import {describe, it} from 'mocha'; +/* eslint-disable @typescript-eslint/no-var-requires */ const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; @@ -38,7 +39,9 @@ export interface Callback { } export class Operation { + /* eslint-disable @typescript-eslint/no-empty-function */ constructor() {} + /* eslint-disable @typescript-eslint/no-empty-function */ promise() {} } function mockSimpleGrpcMethod( @@ -154,8 +157,6 @@ describe('v1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( request, @@ -206,8 +207,6 @@ describe('v1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.createFeed = mockSimpleGrpcMethod( request, @@ -258,8 +257,6 @@ describe('v1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; request.name = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.getFeed = mockSimpleGrpcMethod( request, @@ -310,8 +307,6 @@ describe('v1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( request, @@ -364,8 +359,6 @@ describe('v1.AssetServiceClient', () => { const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; request.feed = {}; request.feed.name = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( request, @@ -416,8 +409,6 @@ describe('v1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; request.name = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( request, @@ -475,8 +466,6 @@ describe('v1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( request, diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts index dfb52b9da76..d132ea66896 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts @@ -19,6 +19,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; import {describe, it} from 'mocha'; +/* eslint-disable @typescript-eslint/no-var-requires */ const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; @@ -38,7 +39,9 @@ export interface Callback { } export class Operation { + /* eslint-disable @typescript-eslint/no-empty-function */ constructor() {} + /* eslint-disable @typescript-eslint/no-empty-function */ promise() {} } function mockSimpleGrpcMethod( @@ -156,8 +159,6 @@ describe('v1beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( request, @@ -215,8 +216,6 @@ describe('v1beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( request, diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts index 9f1b560b792..d6fabc35216 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -19,9 +19,9 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; import {describe, it} from 'mocha'; +/* eslint-disable @typescript-eslint/no-var-requires */ const assetserviceModule = require('../src'); -const FAKE_STATUS_CODE = 1; class FakeError { name: string; message: string; @@ -32,13 +32,14 @@ class FakeError { this.code = n; } } -const error = new FakeError(FAKE_STATUS_CODE); export interface Callback { (err: FakeError | null, response?: {} | null): void; } export class Operation { + /* eslint-disable @typescript-eslint/no-empty-function */ constructor() {} + /* eslint-disable @typescript-eslint/no-empty-function */ promise() {} } describe('v1p1beta1.AssetServiceClient', () => { diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts index 73678598dfe..391eed09912 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts @@ -19,6 +19,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; import {describe, it} from 'mocha'; +/* eslint-disable @typescript-eslint/no-var-requires */ const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; @@ -38,7 +39,9 @@ export interface Callback { } export class Operation { + /* eslint-disable @typescript-eslint/no-empty-function */ constructor() {} + /* eslint-disable @typescript-eslint/no-empty-function */ promise() {} } function mockSimpleGrpcMethod( @@ -135,8 +138,6 @@ describe('v1p2beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.createFeed = mockSimpleGrpcMethod( request, @@ -187,8 +188,6 @@ describe('v1p2beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; request.name = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.getFeed = mockSimpleGrpcMethod( request, @@ -239,8 +238,6 @@ describe('v1p2beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; request.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( request, @@ -293,8 +290,6 @@ describe('v1p2beta1.AssetServiceClient', () => { const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; request.feed = {}; request.feed.name = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( request, @@ -345,8 +340,6 @@ describe('v1p2beta1.AssetServiceClient', () => { // Mock request const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; request.name = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( request, diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts index 9a8ce3c619e..521a5aa2b73 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts @@ -19,6 +19,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; import {describe, it} from 'mocha'; +/* eslint-disable @typescript-eslint/no-var-requires */ const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; @@ -38,7 +39,9 @@ export interface Callback { } export class Operation { + /* eslint-disable @typescript-eslint/no-empty-function */ constructor() {} + /* eslint-disable @typescript-eslint/no-empty-function */ promise() {} } function mockSimpleGrpcMethod( @@ -158,8 +161,6 @@ describe('v1p4beta1.AssetServiceClient', () => { const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; request.analysisQuery = {}; request.analysisQuery.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( request, @@ -219,8 +220,6 @@ describe('v1p4beta1.AssetServiceClient', () => { const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; request.analysisQuery = {}; request.analysisQuery.parent = ''; - // Mock response - const expectedResponse = {}; // Mock gRPC layer client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( request, diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js index c49be15531d..55345f33a87 100644 --- a/packages/google-cloud-asset/webpack.config.js +++ b/packages/google-cloud-asset/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From ba01bc68855152985900fdf6431cce45f2ea9edc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Mar 2020 01:34:33 -0700 Subject: [PATCH 193/429] chore: regenerate the code Co-authored-by: Alexander Fenster --- packages/google-cloud-asset/.jsdoc.js | 2 +- .../src/v1/asset_service_client.ts | 9 +++++++-- packages/google-cloud-asset/src/v1/index.ts | 2 +- .../src/v1beta1/asset_service_client.ts | 9 +++++++-- packages/google-cloud-asset/src/v1beta1/index.ts | 2 +- .../src/v1p1beta1/asset_service_client.ts | 9 +++++++-- .../google-cloud-asset/src/v1p1beta1/index.ts | 2 +- .../src/v1p2beta1/asset_service_client.ts | 9 +++++++-- .../google-cloud-asset/src/v1p2beta1/index.ts | 2 +- .../src/v1p4beta1/asset_service_client.ts | 9 +++++++-- .../google-cloud-asset/src/v1p4beta1/index.ts | 2 +- packages/google-cloud-asset/synth.metadata | 15 ++++++++------- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-asset/system-test/install.ts | 2 +- .../test/gapic-asset_service-v1.ts | 2 +- .../test/gapic-asset_service-v1beta1.ts | 2 +- .../test/gapic-asset_service-v1p1beta1.ts | 2 +- .../test/gapic-asset_service-v1p2beta1.ts | 2 +- .../test/gapic-asset_service-v1p4beta1.ts | 2 +- packages/google-cloud-asset/webpack.config.js | 2 +- 21 files changed, 58 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 61bbaaa9561..ee0bcb61a13 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index ee309055227..e51b67c07be 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -38,7 +38,12 @@ const version = require('../../../package.json').version; * @memberof v1 */ export class AssetServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; diff --git a/packages/google-cloud-asset/src/v1/index.ts b/packages/google-cloud-asset/src/v1/index.ts index 6890c43379a..275cf4b6f1b 100644 --- a/packages/google-cloud-asset/src/v1/index.ts +++ b/packages/google-cloud-asset/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 563a9dcd703..5abbac7b2c9 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -38,7 +38,12 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; diff --git a/packages/google-cloud-asset/src/v1beta1/index.ts b/packages/google-cloud-asset/src/v1beta1/index.ts index 6890c43379a..275cf4b6f1b 100644 --- a/packages/google-cloud-asset/src/v1beta1/index.ts +++ b/packages/google-cloud-asset/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index fd965c29efb..c7bc4df359f 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -38,7 +38,12 @@ const version = require('../../../package.json').version; * @memberof v1p1beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; diff --git a/packages/google-cloud-asset/src/v1p1beta1/index.ts b/packages/google-cloud-asset/src/v1p1beta1/index.ts index 6890c43379a..275cf4b6f1b 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 3348b8c0a4b..dfa83cf501f 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -37,7 +37,12 @@ const version = require('../../../package.json').version; * @memberof v1p2beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; diff --git a/packages/google-cloud-asset/src/v1p2beta1/index.ts b/packages/google-cloud-asset/src/v1p2beta1/index.ts index 6890c43379a..275cf4b6f1b 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index d7ea8f96a7a..b9a00090125 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -38,7 +38,12 @@ const version = require('../../../package.json').version; * @memberof v1p4beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; diff --git a/packages/google-cloud-asset/src/v1p4beta1/index.ts b/packages/google-cloud-asset/src/v1p4beta1/index.ts index 6890c43379a..275cf4b6f1b 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index dde248d4b06..e100fc0ff6b 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-03-17T01:42:52.620638Z", + "updateTime": "2020-03-22T11:12:34.874761Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1976b9981e2900c8172b7d34b4220bdb18c5db42", - "internalRef": "301205325" + "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", + "internalRef": "302154871", + "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" } } ], diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js index 77608a15112..d987f511fce 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index 6ba56206311..f1056a37fb9 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts index 0581f7fc273..4c1ba3eb79a 100644 --- a/packages/google-cloud-asset/system-test/install.ts +++ b/packages/google-cloud-asset/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts index 532b495fc55..c9798180976 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts index d132ea66896..43c9d7ea8b0 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts index d6fabc35216..8134a403b13 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts index 391eed09912..32df8f6e4cc 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts index 521a5aa2b73..a2d176205ad 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js index 55345f33a87..e1e2d012941 100644 --- a/packages/google-cloud-asset/webpack.config.js +++ b/packages/google-cloud-asset/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. From 838e475227fb28f45c406ef6768ecc82819c73cb Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 11:25:15 -0700 Subject: [PATCH 194/429] feat!: drop node8 support, support for async iterators (#299) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. --- packages/google-cloud-asset/.eslintrc.json | 2 +- packages/google-cloud-asset/.prettierrc.js | 2 +- packages/google-cloud-asset/package.json | 10 +- .../src/v1/asset_service_client.ts | 408 +++--- .../src/v1beta1/asset_service_client.ts | 157 ++- .../src/v1p1beta1/asset_service_client.ts | 301 +++-- .../src/v1p2beta1/asset_service_client.ts | 298 +++-- .../src/v1p4beta1/asset_service_client.ts | 159 +-- packages/google-cloud-asset/synth.metadata | 20 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../test/gapic-asset_service-v1.ts | 491 ------- .../test/gapic-asset_service-v1beta1.ts | 241 ---- .../test/gapic-asset_service-v1p1beta1.ts | 213 --- .../test/gapic-asset_service-v1p2beta1.ts | 357 ----- .../test/gapic-asset_service-v1p4beta1.ts | 245 ---- .../test/gapic_asset_service_v1.ts | 1160 +++++++++++++++++ .../test/gapic_asset_service_v1beta1.ts | 440 +++++++ .../test/gapic_asset_service_v1p1beta1.ts | 850 ++++++++++++ .../test/gapic_asset_service_v1p2beta1.ts | 857 ++++++++++++ .../test/gapic_asset_service_v1p4beta1.ts | 447 +++++++ 20 files changed, 4557 insertions(+), 2103 deletions(-) delete mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1.ts delete mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts delete mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts delete mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts delete mode 100644 packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts create mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1.ts create mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts create mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts create mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts create mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts diff --git a/packages/google-cloud-asset/.eslintrc.json b/packages/google-cloud-asset/.eslintrc.json index eb23147be61..78215349546 100644 --- a/packages/google-cloud-asset/.eslintrc.json +++ b/packages/google-cloud-asset/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "./node_modules/gts" } diff --git a/packages/google-cloud-asset/.prettierrc.js b/packages/google-cloud-asset/.prettierrc.js index 21df107092c..08cba3775be 100644 --- a/packages/google-cloud-asset/.prettierrc.js +++ b/packages/google-cloud-asset/.prettierrc.js @@ -13,5 +13,5 @@ // limitations under the License. module.exports = { - ...require('gts/.prettierrc.json') + ...require('gts/.prettierrc.json') } diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 51e7fec41c6..22d7e0a264b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10.0.0" + "node": ">=10" }, "repository": "googleapis/nodejs-asset", "main": "build/src/index.js", @@ -43,15 +43,16 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^1.15.1", + "google-gax": "^2.0.1", "protobufjs": "^6.8.9" }, "devDependencies": { "@types/mocha": "^7.0.2", "@types/node": "^13.9.3", + "@types/sinon": "^7.5.2", "c8": "^7.1.0", "codecov": "^3.6.5", - "gts": "^2.0.0-alpha.5", + "gts": "2.0.0-alpha.9", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", @@ -59,8 +60,9 @@ "mocha": "^7.1.1", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", + "sinon": "^9.0.1", "ts-loader": "^6.2.2", - "typescript": "~3.8.3", + "typescript": "^3.8.3", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index e51b67c07be..d448909d2d7 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -18,7 +18,7 @@ import * as gax from 'google-gax'; import { - APICallback, + GaxCall, Callback, CallOptions, Descriptors, @@ -27,7 +27,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -38,14 +38,6 @@ const version = require('../../../package.json').version; * @memberof v1 */ export class AssetServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -53,6 +45,14 @@ export class AssetServiceClient { 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; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -145,13 +145,16 @@ export class AssetServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + 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 = { + this.pathTemplates = { folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), @@ -168,7 +171,7 @@ export class AssetServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( - /* eslint-disable @typescript-eslint/no-var-requires */ + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -186,7 +189,7 @@ export class AssetServiceClient { '.google.cloud.asset.v1.ExportAssetsRequest' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { exportAssets: new this._gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), @@ -205,7 +208,7 @@ export class AssetServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -232,8 +235,7 @@ export class AssetServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1.AssetService' ) - : // tslint:disable-next-line no-any - /* eslint-disable @typescript-eslint/no-explicit-any */ + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -249,9 +251,8 @@ export class AssetServiceClient { 'updateFeed', 'deleteFeed', ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = this.assetServiceStub.then( + const callPromise = this.assetServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -265,20 +266,14 @@ export class AssetServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.assetServiceStub; @@ -335,26 +330,34 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- batchGetAssetsHistory( - request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - ( - | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest - | undefined - ), + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | undefined, {} | undefined ] >; batchGetAssetsHistory( - request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + batchGetAssetsHistory( + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -399,28 +402,27 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ batchGetAssetsHistory( - request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - ( - | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest - | undefined - ), + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | undefined, {} | undefined ] > | void { @@ -441,29 +443,33 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.batchGetAssetsHistory( - request, - options, - callback - ); + return this.innerApiCalls.batchGetAssetsHistory(request, options, callback); } createFeed( - request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + request: protos.google.cloud.asset.v1.ICreateFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | undefined, {} | undefined ] >; createFeed( - request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + request: protos.google.cloud.asset.v1.ICreateFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + createFeed( + request: protos.google.cloud.asset.v1.ICreateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -494,23 +500,23 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createFeed( - request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + request: protos.google.cloud.asset.v1.ICreateFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | undefined, {} | undefined ] > | void { @@ -531,25 +537,33 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createFeed(request, options, callback); + return this.innerApiCalls.createFeed(request, options, callback); } getFeed( - request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + request: protos.google.cloud.asset.v1.IGetFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | undefined, {} | undefined ] >; getFeed( - request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + request: protos.google.cloud.asset.v1.IGetFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + getFeed( + request: protos.google.cloud.asset.v1.IGetFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -569,23 +583,23 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getFeed( - request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + request: protos.google.cloud.asset.v1.IGetFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | undefined, {} | undefined ] > | void { @@ -606,25 +620,33 @@ export class AssetServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getFeed(request, options, callback); + return this.innerApiCalls.getFeed(request, options, callback); } listFeeds( - request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + request: protos.google.cloud.asset.v1.IListFeedsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | undefined, {} | undefined ] >; listFeeds( - request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + request: protos.google.cloud.asset.v1.IListFeedsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, + {} | null | undefined + > + ): void; + listFeeds( + request: protos.google.cloud.asset.v1.IListFeedsRequest, + callback: Callback< + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -643,23 +665,23 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listFeeds( - request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + request: protos.google.cloud.asset.v1.IListFeedsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | undefined, {} | undefined ] > | void { @@ -680,25 +702,33 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listFeeds(request, options, callback); + return this.innerApiCalls.listFeeds(request, options, callback); } updateFeed( - request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + request: protos.google.cloud.asset.v1.IUpdateFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | undefined, {} | undefined ] >; updateFeed( - request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + request: protos.google.cloud.asset.v1.IUpdateFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + updateFeed( + request: protos.google.cloud.asset.v1.IUpdateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -723,23 +753,23 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateFeed( - request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + request: protos.google.cloud.asset.v1.IUpdateFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1.IFeed, - protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | undefined, {} | undefined ] > | void { @@ -760,25 +790,33 @@ export class AssetServiceClient { 'feed.name': request.feed!.name || '', }); this.initialize(); - return this._innerApiCalls.updateFeed(request, options, callback); + return this.innerApiCalls.updateFeed(request, options, callback); } deleteFeed( - request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + request: protos.google.cloud.asset.v1.IDeleteFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | undefined, {} | undefined ] >; deleteFeed( - request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + request: protos.google.cloud.asset.v1.IDeleteFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, - {} | undefined + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteFeed( + request: protos.google.cloud.asset.v1.IDeleteFeedRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -798,23 +836,23 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteFeed( - request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + request: protos.google.cloud.asset.v1.IDeleteFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, - {} | undefined + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, - {} | undefined + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | undefined, {} | undefined ] > | void { @@ -835,32 +873,43 @@ export class AssetServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteFeed(request, options, callback); + return this.innerApiCalls.deleteFeed(request, options, callback); } exportAssets( - request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + request: protos.google.cloud.asset.v1.IExportAssetsRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.asset.v1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1.IExportAssetsRequest + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; exportAssets( - request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + request: protos.google.cloud.asset.v1.IExportAssetsRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.asset.v1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1.IExportAssetsRequest + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportAssets( + request: protos.google.cloud.asset.v1.IExportAssetsRequest, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -901,32 +950,32 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ exportAssets( - request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + request: protos.google.cloud.asset.v1.IExportAssetsRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.asset.v1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1.IExportAssetsRequest + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.asset.v1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1.IExportAssetsRequest + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.asset.v1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1.IExportAssetsRequest + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -947,7 +996,7 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.exportAssets(request, options, callback); + return this.innerApiCalls.exportAssets(request, options, callback); } // -------------------- // -- Path templates -- @@ -961,9 +1010,9 @@ export class AssetServiceClient { * @returns {string} Resource name string. */ folderFeedPath(folder: string, feed: string) { - return this._pathTemplates.folderFeedPathTemplate.render({ - folder, - feed, + return this.pathTemplates.folderFeedPathTemplate.render({ + folder: folder, + feed: feed, }); } @@ -975,7 +1024,7 @@ export class AssetServiceClient { * @returns {string} A string representing the folder. */ matchFolderFromFolderFeedName(folderFeedName: string) { - return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName) .folder; } @@ -987,8 +1036,7 @@ export class AssetServiceClient { * @returns {string} A string representing the feed. */ matchFeedFromFolderFeedName(folderFeedName: string) { - return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) - .feed; + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; } /** @@ -999,9 +1047,9 @@ export class AssetServiceClient { * @returns {string} Resource name string. */ organizationFeedPath(organization: string, feed: string) { - return this._pathTemplates.organizationFeedPathTemplate.render({ - organization, - feed, + return this.pathTemplates.organizationFeedPathTemplate.render({ + organization: organization, + feed: feed, }); } @@ -1013,7 +1061,7 @@ export class AssetServiceClient { * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { - return this._pathTemplates.organizationFeedPathTemplate.match( + return this.pathTemplates.organizationFeedPathTemplate.match( organizationFeedName ).organization; } @@ -1026,7 +1074,7 @@ export class AssetServiceClient { * @returns {string} A string representing the feed. */ matchFeedFromOrganizationFeedName(organizationFeedName: string) { - return this._pathTemplates.organizationFeedPathTemplate.match( + return this.pathTemplates.organizationFeedPathTemplate.match( organizationFeedName ).feed; } @@ -1039,9 +1087,9 @@ export class AssetServiceClient { * @returns {string} Resource name string. */ projectFeedPath(project: string, feed: string) { - return this._pathTemplates.projectFeedPathTemplate.render({ - project, - feed, + return this.pathTemplates.projectFeedPathTemplate.render({ + project: project, + feed: feed, }); } @@ -1053,7 +1101,7 @@ export class AssetServiceClient { * @returns {string} A string representing the project. */ matchProjectFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName) .project; } @@ -1065,7 +1113,7 @@ export class AssetServiceClient { * @returns {string} A string representing the feed. */ matchFeedFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName) .feed; } diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 5abbac7b2c9..e4ffaf4a5d4 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -18,7 +18,7 @@ import * as gax from 'google-gax'; import { - APICallback, + GaxCall, Callback, CallOptions, Descriptors, @@ -27,7 +27,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -38,13 +38,6 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -52,6 +45,13 @@ export class AssetServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; operationsClient: gax.OperationsClient; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -144,7 +144,10 @@ export class AssetServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "long-running operations", which return a @@ -152,7 +155,7 @@ export class AssetServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( - /* eslint-disable @typescript-eslint/no-var-requires */ + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -170,7 +173,7 @@ export class AssetServiceClient { '.google.cloud.asset.v1beta1.ExportAssetsRequest' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { exportAssets: new this._gaxModule.LongrunningDescriptor( this.operationsClient, exportAssetsResponse.decode.bind(exportAssetsResponse), @@ -189,7 +192,7 @@ export class AssetServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -216,8 +219,7 @@ export class AssetServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1beta1.AssetService' ) - : // tslint:disable-next-line no-any - /* eslint-disable @typescript-eslint/no-explicit-any */ + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -225,9 +227,8 @@ export class AssetServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = this.assetServiceStub.then( + const callPromise = this.assetServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -241,20 +242,14 @@ export class AssetServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.assetServiceStub; @@ -311,26 +306,37 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- batchGetAssetsHistory( - request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, ( - | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest | undefined ), {} | undefined ] >; batchGetAssetsHistory( - request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + batchGetAssetsHistory( + request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + callback: Callback< + protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -373,26 +379,28 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ batchGetAssetsHistory( - request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, ( - | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest | undefined ), {} | undefined @@ -415,36 +423,43 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.batchGetAssetsHistory( - request, - options, - callback - ); + return this.innerApiCalls.batchGetAssetsHistory(request, options, callback); } exportAssets( - request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; exportAssets( - request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportAssets( + request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -486,32 +501,32 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ exportAssets( - request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, - protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -532,7 +547,7 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.exportAssets(request, options, callback); + return this.innerApiCalls.exportAssets(request, options, callback); } /** diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index c7bc4df359f..937679f38fa 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -18,16 +18,18 @@ import * as gax from 'google-gax'; import { - APICallback, + GaxCall, Callback, CallOptions, Descriptors, ClientOptions, + PaginationCallback, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -38,13 +40,6 @@ const version = require('../../../package.json').version; * @memberof v1p1beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -52,6 +47,13 @@ export class AssetServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; assetServiceStub?: Promise<{[name: string]: Function}>; /** @@ -143,13 +145,16 @@ export class AssetServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // 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 = { + this.descriptors.page = { searchAllResources: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -173,7 +178,7 @@ export class AssetServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -200,8 +205,7 @@ export class AssetServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1p1beta1.AssetService' ) - : // tslint:disable-next-line no-any - /* eslint-disable @typescript-eslint/no-explicit-any */ + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p1beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -212,9 +216,8 @@ export class AssetServiceClient { 'searchAllResources', 'searchAllIamPolicies', ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = this.assetServiceStub.then( + const callPromise = this.assetServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -228,20 +231,14 @@ export class AssetServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.assetServiceStub; @@ -299,22 +296,34 @@ export class AssetServiceClient { // ------------------- searchAllResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse ] >; searchAllResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata + > + ): void; + searchAllResources( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata > ): void; /** @@ -367,24 +376,28 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ searchAllResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata >, - callback?: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + callback?: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata > ): Promise< [ - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse ] > | void { request = request || {}; @@ -404,7 +417,7 @@ export class AssetServiceClient { scope: request.scope || '', }); this.initialize(); - return this._innerApiCalls.searchAllResources(request, options, callback); + return this.innerApiCalls.searchAllResources(request, options, callback); } /** @@ -449,7 +462,7 @@ export class AssetServiceClient { * An object stream which emits an object representing [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. */ searchAllResourcesStream( - request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -463,29 +476,101 @@ export class AssetServiceClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.searchAllResources.createStream( - this._innerApiCalls.searchAllResources as gax.GaxCall, + return this.descriptors.page.searchAllResources.createStream( + this.innerApiCalls.searchAllResources as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link searchAllResources}, 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.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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. + */ + searchAllResourcesAsync( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: gax.CallOptions + ): AsyncIterable< + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + scope: request.scope || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.searchAllResources.asyncIterate( + this.innerApiCalls['searchAllResources'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata + >; + } searchAllIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse ] >; searchAllIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult + > + ): void; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult > ): void; /** @@ -538,24 +623,28 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ searchAllIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult >, - callback?: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + callback?: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult > ): Promise< [ - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse ] > | void { request = request || {}; @@ -575,7 +664,7 @@ export class AssetServiceClient { scope: request.scope || '', }); this.initialize(); - return this._innerApiCalls.searchAllIamPolicies(request, options, callback); + return this.innerApiCalls.searchAllIamPolicies(request, options, callback); } /** @@ -620,7 +709,7 @@ export class AssetServiceClient { * An object stream which emits an object representing [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. */ searchAllIamPoliciesStream( - request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -634,13 +723,71 @@ export class AssetServiceClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.searchAllIamPolicies.createStream( - this._innerApiCalls.searchAllIamPolicies as gax.GaxCall, + return this.descriptors.page.searchAllIamPolicies.createStream( + this.innerApiCalls.searchAllIamPolicies as gax.GaxCall, request, callSettings ); } + /** + * Equivalent to {@link searchAllIamPolicies}, 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.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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. + */ + searchAllIamPoliciesAsync( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + 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({ + scope: request.scope || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.asyncIterate( + this.innerApiCalls['searchAllIamPolicies'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult + >; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index dfa83cf501f..0a5683d7769 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -18,7 +18,7 @@ import * as gax from 'google-gax'; import { - APICallback, + GaxCall, Callback, CallOptions, Descriptors, @@ -26,7 +26,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -37,14 +37,6 @@ const version = require('../../../package.json').version; * @memberof v1p2beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -52,6 +44,14 @@ export class AssetServiceClient { 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}; assetServiceStub?: Promise<{[name: string]: Function}>; /** @@ -143,13 +143,16 @@ export class AssetServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + 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 = { + this.pathTemplates = { folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), @@ -172,7 +175,7 @@ export class AssetServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -199,8 +202,7 @@ export class AssetServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1p2beta1.AssetService' ) - : // tslint:disable-next-line no-any - /* eslint-disable @typescript-eslint/no-explicit-any */ + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p2beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -214,9 +216,8 @@ export class AssetServiceClient { 'updateFeed', 'deleteFeed', ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = this.assetServiceStub.then( + const callPromise = this.assetServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -230,20 +231,14 @@ export class AssetServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.assetServiceStub; @@ -300,22 +295,30 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- createFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, {} | undefined ] >; createFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + createFeed( + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -346,24 +349,25 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - | protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest + protos.google.cloud.asset.v1p2beta1.IFeed, + | protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, {} | undefined ] > | void { @@ -384,25 +388,33 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createFeed(request, options, callback); + return this.innerApiCalls.createFeed(request, options, callback); } getFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, {} | undefined ] >; getFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + getFeed( + request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -422,23 +434,25 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + | protos.google.cloud.asset.v1p2beta1.IGetFeedRequest + | null + | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, {} | undefined ] > | void { @@ -459,25 +473,33 @@ export class AssetServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getFeed(request, options, callback); + return this.innerApiCalls.getFeed(request, options, callback); } listFeeds( - request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, {} | undefined ] >; listFeeds( - request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | null | undefined, + {} | null | undefined + > + ): void; + listFeeds( + request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -496,24 +518,25 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listFeeds( - request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, - | protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + | protos.google.cloud.asset.v1p2beta1.IListFeedsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, - protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, {} | undefined ] > | void { @@ -534,25 +557,33 @@ export class AssetServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listFeeds(request, options, callback); + return this.innerApiCalls.listFeeds(request, options, callback); } updateFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, {} | undefined ] >; updateFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + updateFeed( + request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -577,24 +608,25 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - | protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest + protos.google.cloud.asset.v1p2beta1.IFeed, + | protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, - {} | undefined + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1p2beta1.IFeed, - protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, {} | undefined ] > | void { @@ -615,25 +647,33 @@ export class AssetServiceClient { 'feed.name': request.feed!.name || '', }); this.initialize(); - return this._innerApiCalls.updateFeed(request, options, callback); + return this.innerApiCalls.updateFeed(request, options, callback); } deleteFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, {} | undefined ] >; deleteFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, - {} | undefined + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteFeed( + request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -653,24 +693,25 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteFeed( - request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, - {} | undefined + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, - protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, {} | undefined ] > | void { @@ -691,7 +732,7 @@ export class AssetServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteFeed(request, options, callback); + return this.innerApiCalls.deleteFeed(request, options, callback); } // -------------------- @@ -706,9 +747,9 @@ export class AssetServiceClient { * @returns {string} Resource name string. */ folderFeedPath(folder: string, feed: string) { - return this._pathTemplates.folderFeedPathTemplate.render({ - folder, - feed, + return this.pathTemplates.folderFeedPathTemplate.render({ + folder: folder, + feed: feed, }); } @@ -720,7 +761,7 @@ export class AssetServiceClient { * @returns {string} A string representing the folder. */ matchFolderFromFolderFeedName(folderFeedName: string) { - return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName) .folder; } @@ -732,8 +773,7 @@ export class AssetServiceClient { * @returns {string} A string representing the feed. */ matchFeedFromFolderFeedName(folderFeedName: string) { - return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) - .feed; + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; } /** @@ -744,9 +784,9 @@ export class AssetServiceClient { * @returns {string} Resource name string. */ organizationFeedPath(organization: string, feed: string) { - return this._pathTemplates.organizationFeedPathTemplate.render({ - organization, - feed, + return this.pathTemplates.organizationFeedPathTemplate.render({ + organization: organization, + feed: feed, }); } @@ -758,7 +798,7 @@ export class AssetServiceClient { * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { - return this._pathTemplates.organizationFeedPathTemplate.match( + return this.pathTemplates.organizationFeedPathTemplate.match( organizationFeedName ).organization; } @@ -771,7 +811,7 @@ export class AssetServiceClient { * @returns {string} A string representing the feed. */ matchFeedFromOrganizationFeedName(organizationFeedName: string) { - return this._pathTemplates.organizationFeedPathTemplate.match( + return this.pathTemplates.organizationFeedPathTemplate.match( organizationFeedName ).feed; } @@ -784,9 +824,9 @@ export class AssetServiceClient { * @returns {string} Resource name string. */ projectFeedPath(project: string, feed: string) { - return this._pathTemplates.projectFeedPathTemplate.render({ - project, - feed, + return this.pathTemplates.projectFeedPathTemplate.render({ + project: project, + feed: feed, }); } @@ -798,7 +838,7 @@ export class AssetServiceClient { * @returns {string} A string representing the project. */ matchProjectFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName) .project; } @@ -810,7 +850,7 @@ export class AssetServiceClient { * @returns {string} A string representing the feed. */ matchFeedFromProjectFeedName(projectFeedName: string) { - return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName) .feed; } diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index b9a00090125..c42076f8f5d 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -18,7 +18,7 @@ import * as gax from 'google-gax'; import { - APICallback, + GaxCall, Callback, CallOptions, Descriptors, @@ -27,7 +27,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -38,13 +38,6 @@ const version = require('../../../package.json').version; * @memberof v1p4beta1 */ export class AssetServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -52,6 +45,13 @@ export class AssetServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; operationsClient: gax.OperationsClient; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -144,7 +144,10 @@ export class AssetServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "long-running operations", which return a @@ -152,7 +155,7 @@ export class AssetServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( - /* eslint-disable @typescript-eslint/no-var-requires */ + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -170,7 +173,7 @@ export class AssetServiceClient { '.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { exportIamPolicyAnalysis: new this._gaxModule.LongrunningDescriptor( this.operationsClient, exportIamPolicyAnalysisResponse.decode.bind( @@ -193,7 +196,7 @@ export class AssetServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -220,8 +223,7 @@ export class AssetServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.asset.v1p4beta1.AssetService' ) - : // tslint:disable-next-line no-any - /* eslint-disable @typescript-eslint/no-explicit-any */ + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p4beta1.AssetService, this._opts ) as Promise<{[method: string]: Function}>; @@ -232,9 +234,8 @@ export class AssetServiceClient { 'analyzeIamPolicy', 'exportIamPolicyAnalysis', ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = this.assetServiceStub.then( + const callPromise = this.assetServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -248,20 +249,14 @@ export class AssetServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.assetServiceStub; @@ -318,26 +313,34 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- analyzeIamPolicy( - request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, - ( - | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest - | undefined - ), + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | undefined, {} | undefined ] >; analyzeIamPolicy( - request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, - | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + callback: Callback< + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -357,28 +360,27 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ analyzeIamPolicy( - request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, - | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, - | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, - ( - | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest - | undefined - ), + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | undefined, {} | undefined ] > | void { @@ -399,32 +401,43 @@ export class AssetServiceClient { 'analysis_query.parent': request.analysisQuery!.parent || '', }); this.initialize(); - return this._innerApiCalls.analyzeIamPolicy(request, options, callback); + return this.innerApiCalls.analyzeIamPolicy(request, options, callback); } exportIamPolicyAnalysis( - request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; exportIamPolicyAnalysis( - request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportIamPolicyAnalysis( + request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -448,32 +461,32 @@ export class AssetServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ exportIamPolicyAnalysis( - request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, - protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -494,7 +507,7 @@ export class AssetServiceClient { 'analysis_query.parent': request.analysisQuery!.parent || '', }); this.initialize(); - return this._innerApiCalls.exportIamPolicyAnalysis( + return this.innerApiCalls.exportIamPolicyAnalysis( request, options, callback diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e100fc0ff6b..a173bac08e3 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,23 +1,5 @@ { - "updateTime": "2020-03-22T11:12:34.874761Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", - "internalRef": "302154871", - "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" - } - } - ], + "updateTime": "2020-03-31T10:43:55.667140Z", "destinations": [ { "client": { diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index f1056a37fb9..3282c4bfd27 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {AssetServiceClient} from '@google-cloud/asset'; function main() { - new AssetServiceClient(); + const assetServiceClient = new AssetServiceClient(); } main(); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts deleted file mode 100644 index c9798180976..00000000000 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1.ts +++ /dev/null @@ -1,491 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -/* eslint-disable @typescript-eslint/no-var-requires */ -const assetserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - /* eslint-disable @typescript-eslint/no-empty-function */ - constructor() {} - /* eslint-disable @typescript-eslint/no-empty-function */ - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = assetserviceModule.v1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1.AssetServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method', () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.batchGetAssetsHistory(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchGetAssetsHistory with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - null, - error - ); - client.batchGetAssetsHistory(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createFeed', () => { - it('invokes createFeed without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFeed with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getFeed', () => { - it('invokes getFeed without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getFeed with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; - request.name = ''; - // Mock gRPC layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('listFeeds', () => { - it('invokes listFeeds without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.listFeeds(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listFeeds with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - null, - error - ); - client.listFeeds(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateFeed', () => { - it('invokes updateFeed without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; - request.feed = {}; - request.feed.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFeed with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; - request.feed = {}; - request.feed.name = ''; - // Mock gRPC layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('deleteFeed', () => { - it('invokes deleteFeed without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.deleteFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes deleteFeed with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; - request.name = ''; - // Mock gRPC layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.deleteFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('exportAssets', () => { - it('invokes exportAssets without error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .exportAssets(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes exportAssets with error', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .exportAssets(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts deleted file mode 100644 index 43c9d7ea8b0..00000000000 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts +++ /dev/null @@ -1,241 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -/* eslint-disable @typescript-eslint/no-var-requires */ -const assetserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - /* eslint-disable @typescript-eslint/no-empty-function */ - constructor() {} - /* eslint-disable @typescript-eslint/no-empty-function */ - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = assetserviceModule.v1beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method', () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', done => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.batchGetAssetsHistory(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchGetAssetsHistory with error', done => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - null, - error - ); - client.batchGetAssetsHistory(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('exportAssets', () => { - it('invokes exportAssets without error', done => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .exportAssets(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes exportAssets with error', done => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .exportAssets(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts deleted file mode 100644 index 8134a403b13..00000000000 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ /dev/null @@ -1,213 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -/* eslint-disable @typescript-eslint/no-var-requires */ -const assetserviceModule = require('../src'); - -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - /* eslint-disable @typescript-eslint/no-empty-function */ - constructor() {} - /* eslint-disable @typescript-eslint/no-empty-function */ - promise() {} -} -describe('v1p1beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method', () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('searchAllResources', () => { - it('invokes searchAllResources without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; - request.scope = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.searchAllResources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.searchAllResources(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('searchAllResourcesStream', () => { - it('invokes searchAllResourcesStream without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; - request.scope = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.searchAllResources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .searchAllResourcesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('searchAllIamPolicies', () => { - it('invokes searchAllIamPolicies without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; - request.scope = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.searchAllIamPolicies = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.searchAllIamPolicies(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('searchAllIamPoliciesStream', () => { - it('invokes searchAllIamPoliciesStream without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; - request.scope = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.searchAllIamPolicies = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .searchAllIamPoliciesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts deleted file mode 100644 index 32df8f6e4cc..00000000000 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts +++ /dev/null @@ -1,357 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -/* eslint-disable @typescript-eslint/no-var-requires */ -const assetserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - /* eslint-disable @typescript-eslint/no-empty-function */ - constructor() {} - /* eslint-disable @typescript-eslint/no-empty-function */ - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -describe('v1p2beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method', () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('createFeed', () => { - it('invokes createFeed without error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFeed with error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getFeed', () => { - it('invokes getFeed without error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getFeed with error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; - request.name = ''; - // Mock gRPC layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('listFeeds', () => { - it('invokes listFeeds without error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.listFeeds(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listFeeds with error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; - request.parent = ''; - // Mock gRPC layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - null, - error - ); - client.listFeeds(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateFeed', () => { - it('invokes updateFeed without error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; - request.feed = {}; - request.feed.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFeed with error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; - request.feed = {}; - request.feed.name = ''; - // Mock gRPC layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('deleteFeed', () => { - it('invokes deleteFeed without error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.deleteFeed(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes deleteFeed with error', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; - request.name = ''; - // Mock gRPC layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - client.deleteFeed(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts deleted file mode 100644 index a2d176205ad..00000000000 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts +++ /dev/null @@ -1,245 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -/* eslint-disable @typescript-eslint/no-var-requires */ -const assetserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - /* eslint-disable @typescript-eslint/no-empty-function */ - constructor() {} - /* eslint-disable @typescript-eslint/no-empty-function */ - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1p4beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1p4beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1p4beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = assetserviceModule.v1p4beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method', () => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('analyzeIamPolicy', () => { - it('invokes analyzeIamPolicy without error', done => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; - request.analysisQuery = {}; - request.analysisQuery.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.analyzeIamPolicy(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes analyzeIamPolicy with error', done => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; - request.analysisQuery = {}; - request.analysisQuery.parent = ''; - // Mock gRPC layer - client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - client.analyzeIamPolicy(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('exportIamPolicyAnalysis', () => { - it('invokes exportIamPolicyAnalysis without error', done => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; - request.analysisQuery = {}; - request.analysisQuery.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .exportIamPolicyAnalysis(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes exportIamPolicyAnalysis with error', done => { - const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; - request.analysisQuery = {}; - request.analysisQuery.parent = ''; - // Mock gRPC layer - client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .exportIamPolicyAnalysis(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts new file mode 100644 index 00000000000..770390fa80a --- /dev/null +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -0,0 +1,1160 @@ +// 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 assetserviceModule from '../src'; + +import {protobuf, LROperation} 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); +} + +describe('v1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetserviceModule.v1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + + it('has close method', () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() + ); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( + expectedResponse + ); + const [response] = await client.batchGetAssetsHistory(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchGetAssetsHistory without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() + ); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchGetAssetsHistory( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchGetAssetsHistory with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.batchGetAssetsHistory(request); + }, expectedError); + assert( + (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createFeed', () => { + it('invokes createFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCall(expectedResponse); + const [response] = await client.createFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createFeed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IFeed | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeed = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.createFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getFeed', () => { + it('invokes getFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCall(expectedResponse); + const [response] = await client.getFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getFeed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IFeed | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.getFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listFeeds', () => { + it('invokes listFeeds without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCall(expectedResponse); + const [response] = await client.listFeeds(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFeeds without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listFeeds( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IListFeedsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listFeeds with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.listFeeds(request); + }, expectedError); + assert( + (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateFeed', () => { + it('invokes updateFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCall(expectedResponse); + const [response] = await client.updateFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateFeed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IFeed | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeed = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteFeed', () => { + it('invokes deleteFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteFeed( + 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.deleteFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeed = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('exportAssets', () => { + it('invokes exportAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAssets(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.exportAssets( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportAssets with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.exportAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportAssets(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('Path templates', () => { + describe('folderFeed', () => { + const fakePath = '/rendered/path/folderFeed'; + const expectedParameters = { + folder: 'folderValue', + feed: 'feedValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderFeedPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderFeedPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderFeedPath', () => { + const result = client.folderFeedPath('folderValue', 'feedValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderFeedPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderFeedName', () => { + const result = client.matchFolderFromFolderFeedName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeedFromFolderFeedName', () => { + const result = client.matchFeedFromFolderFeedName(fakePath); + assert.strictEqual(result, 'feedValue'); + assert( + (client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationFeed', () => { + const fakePath = '/rendered/path/organizationFeed'; + const expectedParameters = { + organization: 'organizationValue', + feed: 'feedValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationFeedPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationFeedPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationFeedPath', () => { + const result = client.organizationFeedPath( + 'organizationValue', + 'feedValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationFeedPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationFeedName', () => { + const result = client.matchOrganizationFromOrganizationFeedName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeedFromOrganizationFeedName', () => { + const result = client.matchFeedFromOrganizationFeedName(fakePath); + assert.strictEqual(result, 'feedValue'); + assert( + (client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectFeed', () => { + const fakePath = '/rendered/path/projectFeed'; + const expectedParameters = { + project: 'projectValue', + feed: 'feedValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectFeedPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectFeedPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectFeedPath', () => { + const result = client.projectFeedPath('projectValue', 'feedValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectFeedPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectFeedName', () => { + const result = client.matchProjectFromProjectFeedName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeedFromProjectFeedName', () => { + const result = client.matchFeedFromProjectFeedName(fakePath); + assert.strictEqual(result, 'feedValue'); + assert( + (client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts new file mode 100644 index 00000000000..c9d73b9ca26 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts @@ -0,0 +1,440 @@ +// 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 assetserviceModule from '../src'; + +import {protobuf, LROperation} 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); +} + +describe('v1beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetserviceModule.v1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + + it('has close method', () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + 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 assetserviceModule.v1beta1.AssetServiceClient({ + 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('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse() + ); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( + expectedResponse + ); + const [response] = await client.batchGetAssetsHistory(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchGetAssetsHistory without error using callback', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse() + ); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchGetAssetsHistory( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchGetAssetsHistory with error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.batchGetAssetsHistory(request); + }, expectedError); + assert( + (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('exportAssets', () => { + it('invokes exportAssets without error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAssets(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets without error using callback', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.exportAssets( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1beta1.IExportAssetsRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportAssets with call error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.exportAssets(request); + }, expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets with LRO error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportAssets(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts new file mode 100644 index 00000000000..5baae883e2d --- /dev/null +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -0,0 +1,850 @@ +// 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 assetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v1p1beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + + it('has close method', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + 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 assetserviceModule.v1p1beta1.AssetServiceClient({ + 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('searchAllResources', () => { + it('invokes searchAllResources without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCall( + expectedResponse + ); + const [response] = await client.searchAllResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResources without error using callback', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.searchAllResources( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllResources with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllResources = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.searchAllResources(request); + }, expectedError); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResourcesStream without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + ]; + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata + ) => { + 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.searchAllResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllResources, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes searchAllResourcesStream with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllResources, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllResources without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() + ), + ]; + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; + const iterable = client.searchAllResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllResources with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchAllResourcesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( + expectedResponse + ); + const [response] = await client.searchAllIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.searchAllIamPolicies( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.searchAllIamPolicies(request); + }, expectedError); + assert( + (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllIamPoliciesStream without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + ]; + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult + ) => { + 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.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes searchAllIamPoliciesStream with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() + ), + ]; + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; + const iterable = client.searchAllIamPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchAllIamPoliciesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts new file mode 100644 index 00000000000..e17900d4efb --- /dev/null +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -0,0 +1,857 @@ +// 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 assetserviceModule from '../src'; + +import {protobuf} 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); +} + +describe('v1p2beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + + it('has close method', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + 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 assetserviceModule.v1p2beta1.AssetServiceClient({ + 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('createFeed', () => { + it('invokes createFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCall(expectedResponse); + const [response] = await client.createFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createFeed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1p2beta1.IFeed | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeed = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.createFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getFeed', () => { + it('invokes getFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCall(expectedResponse); + const [response] = await client.getFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getFeed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1p2beta1.IFeed | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.getFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listFeeds', () => { + it('invokes listFeeds without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCall(expectedResponse); + const [response] = await client.listFeeds(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listFeeds without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listFeeds( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1p2beta1.IListFeedsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listFeeds with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.listFeeds(request); + }, expectedError); + assert( + (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateFeed', () => { + it('invokes updateFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCall(expectedResponse); + const [response] = await client.updateFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateFeed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1p2beta1.IFeed | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeed = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteFeed', () => { + it('invokes deleteFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFeed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteFeed( + 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.deleteFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeed = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteFeed(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('Path templates', () => { + describe('folderFeed', () => { + const fakePath = '/rendered/path/folderFeed'; + const expectedParameters = { + folder: 'folderValue', + feed: 'feedValue', + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderFeedPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderFeedPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderFeedPath', () => { + const result = client.folderFeedPath('folderValue', 'feedValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderFeedPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderFeedName', () => { + const result = client.matchFolderFromFolderFeedName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeedFromFolderFeedName', () => { + const result = client.matchFeedFromFolderFeedName(fakePath); + assert.strictEqual(result, 'feedValue'); + assert( + (client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationFeed', () => { + const fakePath = '/rendered/path/organizationFeed'; + const expectedParameters = { + organization: 'organizationValue', + feed: 'feedValue', + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationFeedPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationFeedPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationFeedPath', () => { + const result = client.organizationFeedPath( + 'organizationValue', + 'feedValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationFeedPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationFeedName', () => { + const result = client.matchOrganizationFromOrganizationFeedName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeedFromOrganizationFeedName', () => { + const result = client.matchFeedFromOrganizationFeedName(fakePath); + assert.strictEqual(result, 'feedValue'); + assert( + (client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectFeed', () => { + const fakePath = '/rendered/path/projectFeed'; + const expectedParameters = { + project: 'projectValue', + feed: 'feedValue', + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectFeedPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectFeedPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectFeedPath', () => { + const result = client.projectFeedPath('projectValue', 'feedValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectFeedPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectFeedName', () => { + const result = client.matchProjectFromProjectFeedName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeedFromProjectFeedName', () => { + const result = client.matchFeedFromProjectFeedName(fakePath); + assert.strictEqual(result, 'feedValue'); + assert( + (client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts new file mode 100644 index 00000000000..c34b29853b2 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts @@ -0,0 +1,447 @@ +// 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 assetserviceModule from '../src'; + +import {protobuf, LROperation} 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); +} + +describe('v1p4beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p4beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p4beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetserviceModule.v1p4beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + + it('has close method', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + 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 assetserviceModule.v1p4beta1.AssetServiceClient({ + 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('analyzeIamPolicy', () => { + it('invokes analyzeIamPolicy without error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicy without error using callback', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeIamPolicy with error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.analyzeIamPolicy(request); + }, expectedError); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('exportIamPolicyAnalysis', () => { + it('invokes exportIamPolicyAnalysis without error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.exportIamPolicyAnalysis(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportIamPolicyAnalysis without error using callback', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.exportIamPolicyAnalysis( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportIamPolicyAnalysis with call error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.exportIamPolicyAnalysis(request); + }, expectedError); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportIamPolicyAnalysis with LRO error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportIamPolicyAnalysis(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); +}); From d57b79477e7b059f97c560e3c9a90cbdde9d6f40 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Apr 2020 23:35:03 +0200 Subject: [PATCH 195/429] chore(deps): update dependency @types/sinon to v9 (#302) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.5.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/7.5.2/9.0.0) | --- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 22d7e0a264b..1546762c5d1 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -49,7 +49,7 @@ "devDependencies": { "@types/mocha": "^7.0.2", "@types/node": "^13.9.3", - "@types/sinon": "^7.5.2", + "@types/sinon": "^9.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", "gts": "2.0.0-alpha.9", From 4352879c24b91c061dd7647b15e83ab1822cb47c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 1 Apr 2020 17:40:14 -0700 Subject: [PATCH 196/429] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#301) --- packages/google-cloud-asset/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 0cafdb0d148..a05d49edfe7 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -20,6 +20,9 @@ logging.basicConfig(level=logging.DEBUG) +AUTOSYNTH_MULTIPLE_COMMITS = True + + gapic = gcp.GAPICMicrogenerator() versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1'] name = 'asset' From a8f92951a63014fc11c5a57c2521a49eca8358de Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 3 Apr 2020 14:28:12 -0700 Subject: [PATCH 197/429] feat: add org policy and access context manager protos (#304) * feat: add org policy and access context manager protos * fix: add comments in synth.py --- packages/google-cloud-asset/package.json | 2 +- .../google/cloud/asset/v1/asset_service.proto | 81 +- .../protos/google/cloud/asset/v1/assets.proto | 120 +- .../google/cloud/orgpolicy/v1/orgpolicy.proto | 315 + .../type/device_resources.proto | 85 + .../v1/access_level.proto | 187 + .../v1/access_policy.proto | 60 + .../v1/service_perimeter.proto | 152 + .../google-cloud-asset/protos/protos.d.ts | 2582 +- packages/google-cloud-asset/protos/protos.js | 24403 +++++++++------- .../google-cloud-asset/protos/protos.json | 504 +- .../src/v1/asset_service_client.ts | 19 +- .../src/v1/asset_service_client_config.json | 4 +- .../src/v1/asset_service_proto_list.json | 7 +- .../src/v1beta1/asset_service_client.ts | 1 - .../v1beta1/asset_service_client_config.json | 4 +- .../src/v1beta1/asset_service_proto_list.json | 7 +- .../src/v1p1beta1/asset_service_client.ts | 2 +- .../asset_service_client_config.json | 6 +- .../v1p1beta1/asset_service_proto_list.json | 7 +- .../src/v1p2beta1/asset_service_client.ts | 8 +- .../asset_service_client_config.json | 11 +- .../v1p2beta1/asset_service_proto_list.json | 7 +- .../src/v1p4beta1/asset_service_client.ts | 1 - .../asset_service_client_config.json | 7 +- .../v1p4beta1/asset_service_proto_list.json | 7 +- packages/google-cloud-asset/synth.metadata | 19 +- packages/google-cloud-asset/synth.py | 23 +- .../system-test/fixtures/sample/src/index.ts | 2 +- 29 files changed, 18052 insertions(+), 10581 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto create mode 100644 packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto create mode 100644 packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto create mode 100644 packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto create mode 100644 packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1546762c5d1..4d5732a379e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -35,7 +35,7 @@ "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts check", + "lint": "gts fix && eslint --fix samples/*.js", "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 6566d03995f..9c7b16d036e 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // 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"; @@ -26,6 +25,7 @@ import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; option csharp_namespace = "Google.Cloud.Asset.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset"; @@ -125,10 +125,10 @@ message ExportAssetsRequest { ]; // Timestamp to take an asset snapshot. This can only be set to a timestamp - // between 2018-10-02 UTC (inclusive) and the current time. If not specified, - // the current time will be used. Due to delays in resource data collection - // and indexing, there is a volatile window during which running the same - // query may get different results. + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. google.protobuf.Timestamp read_time = 2; // A list of asset types of which to take a snapshot for. For example: @@ -187,11 +187,11 @@ message BatchGetAssetsHistoryRequest { ContentType content_type = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The time window for the asset history. Both start_time and - // end_time are optional and if set, it must be after 2018-10-02 UTC. If - // end_time is not set, it is default to current timestamp. If start_time is - // not set, the snapshot of the assets at end_time will be returned. The - // returned results contain all temporal assets whose time window overlap with - // read_time_window. + // end_time are optional and if set, it must be after the current time minus + // 35 days. If end_time is not set, it is default to current timestamp. + // If start_time is not set, the snapshot of the assets at end_time will be + // returned. The returned results contain all temporal assets whose time + // window overlap with read_time_window. TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -321,7 +321,7 @@ message BigQueryDestination { // Required. The BigQuery dataset in format // "projects/projectId/datasets/datasetId", to which the snapshot result // should be exported. If this dataset does not exist, the export call returns - // an error. + // an INVALID_ARGUMENT error. string dataset = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The BigQuery table to which the snapshot result should be @@ -331,41 +331,23 @@ message BigQueryDestination { // If the destination table already exists and this flag is `TRUE`, the // table will be overwritten by the contents of assets snapshot. If the flag - // is not set and the destination table already exists, the export call - // returns an error. + // is `FALSE` or unset and the destination table already exists, the export + // call returns an INVALID_ARGUMEMT error. bool force = 3; } -// A Cloud Pubsub destination. +// A Pub/Sub destination. message PubsubDestination { - // The name of the Cloud Pub/Sub topic to publish to. + // The name of the Pub/Sub topic to publish to. // For example: `projects/PROJECT_ID/topics/TOPIC_ID`. string topic = 1; } -// Asset content type. -enum ContentType { - // Unspecified content type. - CONTENT_TYPE_UNSPECIFIED = 0; - - // Resource metadata. - RESOURCE = 1; - - // The actual IAM policy set on a resource. - IAM_POLICY = 2; - - // The Cloud Organization Policy set on an asset. - ORG_POLICY = 4; - - // The Cloud Access context mananger Policy set on an asset. - ACCESS_POLICY = 5; -} - // Output configuration for asset feed destination. message FeedOutputConfig { // Asset feed destination. oneof destination { - // Destination on Cloud Pubsub. + // Destination on Pub/Sub. PubsubDestination pubsub_destination = 1; } } @@ -374,7 +356,7 @@ message FeedOutputConfig { // An asset feed filter controls what updates are exported. // The asset feed must be created within a project, organization, or // folder. Supported destinations are: -// Cloud Pub/Sub topics. +// Pub/Sub topics. message Feed { option (google.api.resource) = { type: "cloudasset.googleapis.com/Feed" @@ -406,10 +388,11 @@ message Feed { // A list of types of the assets to receive updates. You must specify either // or both of asset_names and asset_types. Only asset updates matching // specified asset_names and asset_types are exported to the feed. - // For example: - // "compute.googleapis.com/Disk" See [Introduction to Cloud Asset - // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - // for all supported asset types. + // For example: `"compute.googleapis.com/Disk"` + // + // See [this + // topic](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for a list of all supported asset types. repeated string asset_types = 3; // Asset content type. If not specified, no content but the asset name and @@ -420,3 +403,21 @@ message Feed { // published to. FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; } + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The Cloud Organization Policy set on an asset. + ORG_POLICY = 4; + + // The Cloud Access context mananger Policy set on an asset. + ACCESS_POLICY = 5; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 6a5c8cb8cb2..1e8b40a11d9 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,14 +11,17 @@ // 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.asset.v1; import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -32,31 +35,34 @@ option java_outer_classname = "AssetProto"; option java_package = "com.google.cloud.asset.v1"; option php_namespace = "Google\\Cloud\\Asset\\V1"; -// Temporal asset. In addition to the asset, the temporal asset includes the -// status of the asset and valid from and to time of it. +// An asset in Google Cloud and its temporal metadata, including the time window +// when it was observed and its status during that window. message TemporalAsset { // The time window when the asset data and state was observed. TimeWindow window = 1; - // If the asset is deleted or not. + // Whether the asset has been deleted or not. bool deleted = 2; - // Asset. + // An asset in Google Cloud. Asset asset = 3; } -// A time window of (start_time, end_time]. +// A time window specified by its "start_time" and "end_time". message TimeWindow { // Start time of the time window (exclusive). google.protobuf.Timestamp start_time = 1; - // End time of the time window (inclusive). - // Current timestamp if not specified. + // End time of the time window (inclusive). If not specified, the current + // timestamp is used instead. google.protobuf.Timestamp end_time = 2; } -// Cloud asset. This includes all Google Cloud Platform resources, -// Cloud IAM policies, and other non-GCP assets. +// An asset in Google Cloud. An asset can be any resource in the Google Cloud +// [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a Cloud IAM policy. message Asset { option (google.api.resource) = { type: "cloudasset.googleapis.com/Asset" @@ -64,53 +70,86 @@ message Asset { }; // The full name of the asset. For example: - // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1" + // // See [Resource - // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. string name = 1; - // Type of the asset. Example: "compute.googleapis.com/Disk". + // The type of the asset. For example: "compute.googleapis.com/Disk" + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. string asset_type = 2; - // Representation of the resource. + // A representation of the resource. Resource resource = 3; - // Representation of the actual Cloud IAM policy set on a cloud resource. For - // each resource, there must be at most one Cloud IAM policy set on it. + // A representation of the Cloud IAM policy set on a Google Cloud resource. + // There can be a maximum of one Cloud IAM policy set on any given resource. + // In addition, Cloud IAM policies inherit their granted access scope from any + // policies set on parent resources in the resource hierarchy. Therefore, the + // effectively policy is the union of both the policy set on this resource + // and each policy set on all of the resource's ancestry resource levels in + // the hierarchy. See + // [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for + // more information. google.iam.v1.Policy iam_policy = 4; - // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, - // represented as a list of relative resource names. Ancestry path starts with - // the closest CRM ancestor and ends at root. If the asset is a CRM - // project/folder/organization, this starts from the asset itself. + // A representation of an [organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + // There can be more than one organization policy with different constraints + // set on a given resource. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // A representation of an [access + // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + oneof access_context_policy { + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + } + + // The ancestry path of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. If the asset + // is a project, folder, or organization, the ancestry path starts from the + // asset itself. // - // Example: ["projects/123456789", "folders/5432", "organizations/1234"] + // For example: `["projects/123456789", "folders/5432", "organizations/1234"]` repeated string ancestors = 10; } -// Representation of a cloud resource. +// A representation of a Google Cloud resource. message Resource { - // The API version. Example: "v1". + // The API version. For example: "v1" string version = 1; // The URL of the discovery document containing the resource's JSON schema. // For example: - // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. - // It will be left unspecified for resources without a discovery-based API, - // such as Cloud Bigtable. + // "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest" + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. string discovery_document_uri = 2; - // The JSON schema name listed in the discovery document. - // Example: "Project". It will be left unspecified for resources (such as - // Cloud Bigtable) without a discovery-based API. + // The JSON schema name listed in the discovery document. For example: + // "Project" + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. string discovery_name = 3; - // The REST URL for accessing the resource. An HTTP GET operation using this - // URL returns the resource itself. - // Example: - // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - // It will be left unspecified for resources without a REST API. + // The REST URL for accessing the resource. An HTTP `GET` request using this + // URL returns the resource itself. For example: + // "https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123" + // + // This value is unspecified for resources without a REST API. string resource_url = 4; // The full name of the immediate parent of this resource. See @@ -118,15 +157,16 @@ message Resource { // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. // - // For GCP assets, it is the parent resource defined in the [Cloud IAM policy + // For Google Cloud assets, this value is the parent resource defined in the + // [Cloud IAM policy // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). // For example: - // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + // "//cloudresourcemanager.googleapis.com/projects/my_project_123" // - // For third-party assets, it is up to the users to define. + // For third-party assets, this field may be set differently. string parent = 5; - // The content of the resource, in which some sensitive fields are scrubbed - // away and may not be present. + // The content of the resource, in which some sensitive fields are removed + // and may not be present. google.protobuf.Struct data = 6; } diff --git a/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto b/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto new file mode 100644 index 00000000000..fbd62df6f3f --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto @@ -0,0 +1,315 @@ +// Copyright 2019 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.orgpolicy.v1; + +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.OrgPolicy.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/orgpolicy/v1;orgpolicy"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +option java_package = "com.google.cloud.orgpolicy.v1"; +option php_namespace = "Google\\Cloud\\OrgPolicy\\V1"; +option ruby_package = "Google::Cloud::OrgPolicy::V1"; + +// Defines a Cloud Organization `Policy` which is used to specify `Constraints` +// for configurations of Cloud Platform resources. +message Policy { + // Used in `policy_type` to specify how `list_policy` behaves at this + // resource. + // + // `ListPolicy` can define specific values and subtrees of Cloud Resource + // Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that + // are allowed or denied by setting the `allowed_values` and `denied_values` + // fields. This is achieved by using the `under:` and optional `is:` prefixes. + // The `under:` prefix is used to denote resource subtree values. + // The `is:` prefix is used to denote specific values, and is required only + // if the value contains a ":". Values prefixed with "is:" are treated the + // same as values with no prefix. + // Ancestry subtrees must be in one of the following formats: + // - "projects/", e.g. "projects/tokyo-rain-123" + // - "folders/", e.g. "folders/1234" + // - "organizations/", e.g. "organizations/1234" + // The `supports_under` field of the associated `Constraint` defines whether + // ancestry prefixes can be used. You can set `allowed_values` and + // `denied_values` in the same `Policy` if `all_values` is + // `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all + // values. If `all_values` is set to either `ALLOW` or `DENY`, + // `allowed_values` and `denied_values` must be unset. + message ListPolicy { + // This enum can be used to set `Policies` that apply to all possible + // configuration values rather than specific values in `allowed_values` or + // `denied_values`. + // + // Settting this to `ALLOW` will mean this `Policy` allows all values. + // Similarly, setting it to `DENY` will mean no values are allowed. If + // set to either `ALLOW` or `DENY, `allowed_values` and `denied_values` + // must be unset. Setting this to `ALL_VALUES_UNSPECIFIED` allows for + // setting `allowed_values` and `denied_values`. + enum AllValues { + // Indicates that allowed_values or denied_values must be set. + ALL_VALUES_UNSPECIFIED = 0; + + // A policy with this set allows all values. + ALLOW = 1; + + // A policy with this set denies all values. + DENY = 2; + } + + // List of values allowed at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string allowed_values = 1; + + // List of values denied at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string denied_values = 2; + + // The policy all_values state. + AllValues all_values = 3; + + // Optional. The Google Cloud Console will try to default to a configuration + // that matches the value specified in this `Policy`. If `suggested_value` + // is not set, it will inherit the value specified higher in the hierarchy, + // unless `inherit_from_parent` is `false`. + string suggested_value = 4; + + // Determines the inheritance behavior for this `Policy`. + // + // By default, a `ListPolicy` set at a resource supercedes any `Policy` set + // anywhere up the resource hierarchy. However, if `inherit_from_parent` is + // set to `true`, then the values from the effective `Policy` of the parent + // resource are inherited, meaning the values set in this `Policy` are + // added to the values inherited up the hierarchy. + // + // Setting `Policy` hierarchies that inherit both allowed values and denied + // values isn't recommended in most circumstances to keep the configuration + // simple and understandable. However, it is possible to set a `Policy` with + // `allowed_values` set that inherits a `Policy` with `denied_values` set. + // In this case, the values that are allowed must be in `allowed_values` and + // not present in `denied_values`. + // + // For example, suppose you have a `Constraint` + // `constraints/serviceuser.services`, which has a `constraint_type` of + // `list_constraint`, and with `constraint_default` set to `ALLOW`. + // Suppose that at the Organization level, a `Policy` is applied that + // restricts the allowed API activations to {`E1`, `E2`}. Then, if a + // `Policy` is applied to a project below the Organization that has + // `inherit_from_parent` set to `false` and field all_values set to DENY, + // then an attempt to activate any API will be denied. + // + // The following examples demonstrate different possible layerings for + // `projects/bar` parented by `organizations/foo`: + // + // Example 1 (no inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has `inherit_from_parent` `false` and values: + // {allowed_values: "E3" allowed_values: "E4"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E3`, and `E4`. + // + // Example 2 (inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {value: "E3" value: "E4" inherit_from_parent: true} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + // + // Example 3 (inheriting both allowed and denied values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {denied_values: "E1"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The value accepted at `projects/bar` is `E2`. + // + // Example 4 (RestoreDefault): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {RestoreDefault: {}} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 5 (no policy inherits parent policy): + // `organizations/foo` has no `Policy` set. + // `projects/bar` has no `Policy` set. + // The accepted values at both levels are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 6 (ListConstraint allowing all): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: ALLOW} + // The accepted values at `organizations/foo` are `E1`, E2`. + // Any value is accepted at `projects/bar`. + // + // Example 7 (ListConstraint allowing none): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: DENY} + // The accepted values at `organizations/foo` are `E1`, E2`. + // No value is accepted at `projects/bar`. + // + // Example 10 (allowed and denied subtrees of Resource Manager hierarchy): + // Given the following resource hierarchy + // O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "under:organizations/O1"} + // `projects/bar` has a `Policy` with: + // {allowed_values: "under:projects/P3"} + // {denied_values: "under:folders/F2"} + // The accepted values at `organizations/foo` are `organizations/O1`, + // `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, + // `projects/P3`. + // The accepted values at `projects/bar` are `organizations/O1`, + // `folders/F1`, `projects/P1`. + bool inherit_from_parent = 5; + } + + // Used in `policy_type` to specify how `boolean_policy` will behave at this + // resource. + message BooleanPolicy { + // If `true`, then the `Policy` is enforced. If `false`, then any + // configuration is acceptable. + // + // Suppose you have a `Constraint` + // `constraints/compute.disableSerialPortAccess` with `constraint_default` + // set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following + // behavior: + // - If the `Policy` at this resource has enforced set to `false`, serial + // port connection attempts will be allowed. + // - If the `Policy` at this resource has enforced set to `true`, serial + // port connection attempts will be refused. + // - If the `Policy` at this resource is `RestoreDefault`, serial port + // connection attempts will be allowed. + // - If no `Policy` is set at this resource or anywhere higher in the + // resource hierarchy, serial port connection attempts will be allowed. + // - If no `Policy` is set at this resource, but one exists higher in the + // resource hierarchy, the behavior is as if the`Policy` were set at + // this resource. + // + // The following examples demonstrate the different possible layerings: + // + // Example 1 (nearest `Constraint` wins): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has no `Policy` set. + // The constraint at `projects/bar` and `organizations/foo` will not be + // enforced. + // + // Example 2 (enforcement gets replaced): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has a `Policy` with: + // {enforced: true} + // The constraint at `organizations/foo` is not enforced. + // The constraint at `projects/bar` is enforced. + // + // Example 3 (RestoreDefault): + // `organizations/foo` has a `Policy` with: + // {enforced: true} + // `projects/bar` has a `Policy` with: + // {RestoreDefault: {}} + // The constraint at `organizations/foo` is enforced. + // The constraint at `projects/bar` is not enforced, because + // `constraint_default` for the `Constraint` is `ALLOW`. + bool enforced = 1; + } + + // Ignores policies set above this resource and restores the + // `constraint_default` enforcement behavior of the specific `Constraint` at + // this resource. + // + // Suppose that `constraint_default` is set to `ALLOW` for the + // `Constraint` `constraints/serviceuser.services`. Suppose that organization + // foo.com sets a `Policy` at their Organization resource node that restricts + // the allowed service activations to deny all service activations. They + // could then set a `Policy` with the `policy_type` `restore_default` on + // several experimental projects, restoring the `constraint_default` + // enforcement of the `Constraint` for only those projects, allowing those + // projects to have all services activated. + message RestoreDefault { + + } + + // Version of the `Policy`. Default version is 0; + int32 version = 1; + + // The name of the `Constraint` the `Policy` is configuring, for example, + // `constraints/serviceuser.services`. + // + // Immutable after creation. + string constraint = 2; + + // An opaque tag indicating the current version of the `Policy`, used for + // concurrency control. + // + // When the `Policy` is returned from either a `GetPolicy` or a + // `ListOrgPolicy` request, this `etag` indicates the version of the current + // `Policy` to use when executing a read-modify-write loop. + // + // When the `Policy` is returned from a `GetEffectivePolicy` request, the + // `etag` will be unset. + // + // When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + // that was returned from a `GetOrgPolicy` request as part of a + // read-modify-write loop for concurrency control. Not setting the `etag`in a + // `SetOrgPolicy` request will result in an unconditional write of the + // `Policy`. + bytes etag = 3; + + // The time stamp the `Policy` was previously updated. This is set by the + // server, not specified by the caller, and represents the last time a call to + // `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + // be ignored. + google.protobuf.Timestamp update_time = 4; + + // The field to populate is based on the `constraint_type` value in the + // `Constraint`. + // `list_constraint` => `list_policy` + // `boolean_constraint` => `boolean_policy` + // + // A `restore_default` message may be used with any `Constraint` type. + // + // Providing a *_policy that is incompatible with the `constraint_type` will + // result in an `invalid_argument` error. + // + // Attempting to set a `Policy` with a `policy_type` not set will result in an + // `invalid_argument` error. + oneof policy_type { + // List of values either allowed or disallowed. + ListPolicy list_policy = 5; + + // For boolean `Constraints`, whether to enforce the `Constraint` or not. + BooleanPolicy boolean_policy = 6; + + // Restores the default behavior of the constraint; independent of + // `Constraint` type. + RestoreDefault restore_default = 7; + } +} diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto new file mode 100644 index 00000000000..f0579103393 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto @@ -0,0 +1,85 @@ +// 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.identity.accesscontextmanager.type; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.Type"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type;type"; +option java_package = "com.google.identity.accesscontextmanager.type"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option php_namespace = "Google\\Identity\\AccessContextManager\\Type"; +option ruby_package = "Google::Identity::AccessContextManager::Type"; + +// The encryption state of the device. +enum DeviceEncryptionStatus { + // The encryption status of the device is not specified or not known. + ENCRYPTION_UNSPECIFIED = 0; + + // The device does not support encryption. + ENCRYPTION_UNSUPPORTED = 1; + + // The device supports encryption, but is currently unencrypted. + UNENCRYPTED = 2; + + // The device is encrypted. + ENCRYPTED = 3; +} + +// The operating system type of the device. +// Next id: 7 +enum OsType { + // The operating system of the device is not specified or not known. + OS_UNSPECIFIED = 0; + + // A desktop Mac operating system. + DESKTOP_MAC = 1; + + // A desktop Windows operating system. + DESKTOP_WINDOWS = 2; + + // A desktop Linux operating system. + DESKTOP_LINUX = 3; + + // A desktop ChromeOS operating system. + DESKTOP_CHROME_OS = 6; + + // An Android operating system. + ANDROID = 4; + + // An iOS operating system. + IOS = 5; +} + +// The degree to which the device is managed by the Cloud organization. +enum DeviceManagementLevel { + // The device's management level is not specified or not known. + MANAGEMENT_UNSPECIFIED = 0; + + // The device is not managed. + NONE = 1; + + // Basic management is enabled, which is generally limited to monitoring and + // wiping the corporate account. + BASIC = 2; + + // Complete device management. This includes more thorough monitoring and the + // ability to directly manage the device (such as remote wiping). This can be + // enabled through the Android Enterprise Platform. + COMPLETE = 3; +} diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto new file mode 100644 index 00000000000..0ebd1936c94 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto @@ -0,0 +1,187 @@ +// 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.identity.accesscontextmanager.v1; + +import "google/identity/accesscontextmanager/type/device_resources.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager"; +option java_multiple_files = true; +option java_outer_classname = "AccessLevelProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; +option objc_class_prefix = "GACM"; + +// An `AccessLevel` is a label that can be applied to requests to Google Cloud +// services, along with a list of requirements necessary for the label to be +// applied. +message AccessLevel { + // Required. Resource name for the Access Level. The `short_name` component + // must begin with a letter and only include alphanumeric and '_'. Format: + // `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + // of the `short_name` component is 50 characters. + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `AccessLevel` and its use. Does not affect behavior. + string description = 3; + + // Required. Describes the necessary conditions for the level to apply. + oneof level { + // A `BasicLevel` composed of `Conditions`. + BasicLevel basic = 4; + + // A `CustomLevel` written in the Common Expression Language. + CustomLevel custom = 5; + } + + // Output only. Time the `AccessLevel` was created in UTC. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time the `AccessLevel` was updated in UTC. + google.protobuf.Timestamp update_time = 7; +} + +// `BasicLevel` is an `AccessLevel` using a set of recommended features. +message BasicLevel { + // Options for how the `conditions` list should be combined to determine if + // this `AccessLevel` is applied. Default is AND. + enum ConditionCombiningFunction { + // All `Conditions` must be true for the `BasicLevel` to be true. + AND = 0; + + // If at least one `Condition` is true, then the `BasicLevel` is true. + OR = 1; + } + + // Required. A list of requirements for the `AccessLevel` to be granted. + repeated Condition conditions = 1; + + // How the `conditions` list should be combined to determine if a request is + // granted this `AccessLevel`. If AND is used, each `Condition` in + // `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + // is used, at least one `Condition` in `conditions` must be satisfied for the + // `AccessLevel` to be applied. Default behavior is AND. + ConditionCombiningFunction combining_function = 2; +} + +// A condition necessary for an `AccessLevel` to be granted. The Condition is an +// AND over its fields. So a Condition is true if: 1) the request IP is from one +// of the listed subnetworks AND 2) the originating device complies with the +// listed device policy AND 3) all listed access levels are granted AND 4) the +// request was sent at a time allowed by the DateTimeRestriction. +message Condition { + // CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + // a CIDR IP address block, the specified IP address portion must be properly + // truncated (i.e. all the host bits must be zero) or the input is considered + // malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + // not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + // "2001:db8::1/32" is not. The originating IP of a request must be in one of + // the listed subnets in order for this Condition to be true. If empty, all IP + // addresses are allowed. + repeated string ip_subnetworks = 1; + + // Device specific restrictions, all restrictions must hold for the + // Condition to be true. If not specified, all devices are allowed. + DevicePolicy device_policy = 2; + + // A list of other access levels defined in the same `Policy`, referenced by + // resource name. Referencing an `AccessLevel` which does not exist is an + // error. All access levels listed must be granted for the Condition + // to be true. Example: + // "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + repeated string required_access_levels = 3; + + // Whether to negate the Condition. If true, the Condition becomes a NAND over + // its non-empty fields, each field must be false for the Condition overall to + // be satisfied. Defaults to false. + bool negate = 5; + + // The request must be made by one of the provided user or service + // accounts. Groups are not supported. + // Syntax: + // `user:{emailid}` + // `serviceAccount:{emailid}` + // If not specified, a request may come from any user. + repeated string members = 6; + + // The request must originate from one of the provided countries/regions. + // Must be valid ISO 3166-1 alpha-2 codes. + repeated string regions = 7; +} + +// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +// to represent the necessary conditions for the level to apply to a request. +// See CEL spec at: https://github.com/google/cel-spec +message CustomLevel { + // Required. A Cloud CEL expression evaluating to a boolean. + google.type.Expr expr = 1; +} + +// `DevicePolicy` specifies device specific restrictions necessary to acquire a +// given access level. A `DevicePolicy` specifies requirements for requests from +// devices to be granted access levels, it does not do any enforcement on the +// device. `DevicePolicy` acts as an AND over all specified fields, and each +// repeated field is an OR over its elements. Any unset fields are ignored. For +// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +// true for requests originating from encrypted Linux desktops and encrypted +// Windows desktops. +message DevicePolicy { + // Whether or not screenlock is required for the DevicePolicy to be true. + // Defaults to `false`. + bool require_screenlock = 1; + + // Allowed encryptions statuses, an empty list allows all statuses. + repeated google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + + // Allowed OS versions, an empty list allows all types and all versions. + repeated OsConstraint os_constraints = 3; + + // Allowed device management levels, an empty list allows all management + // levels. + repeated google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + + // Whether the device needs to be approved by the customer admin. + bool require_admin_approval = 7; + + // Whether the device needs to be corp owned. + bool require_corp_owned = 8; +} + +// A restriction on the OS type and version of devices making requests. +message OsConstraint { + // Required. The allowed OS type. + google.identity.accesscontextmanager.type.OsType os_type = 1; + + // The minimum allowed OS version. If not set, any version of this OS + // satisfies the constraint. Format: `"major.minor.patch"`. + // Examples: `"10.5.301"`, `"9.2.1"`. + string minimum_version = 2; + + // Only allows requests from devices with a verified Chrome OS. + // Verifications includes requirements that the device is enterprise-managed, + // conformant to domain policies, and the caller has permission to call + // the API targeted by the request. + bool require_verified_chrome_os = 3; +} diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto new file mode 100644 index 00000000000..9ec59d1c1e8 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto @@ -0,0 +1,60 @@ +// 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.identity.accesscontextmanager.v1; + +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; +option objc_class_prefix = "GACM"; + +// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +// attributes to use Google Cloud services) and `ServicePerimeters` (which +// define regions of services able to freely pass data within a perimeter). An +// access policy is globally visible within an organization, and the +// restrictions it specifies apply to all projects within an organization. +message AccessPolicy { + // Output only. Resource name of the `AccessPolicy`. Format: + // `accessPolicies/{policy_id}` + string name = 1; + + // Required. The parent of this `AccessPolicy` in the Cloud Resource + // Hierarchy. Currently immutable once created. Format: + // `organizations/{organization_id}` + string parent = 2; + + // Required. Human readable title. Does not affect behavior. + string title = 3; + + // Output only. Time the `AccessPolicy` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `AccessPolicy` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Output only. An opaque identifier for the current version of the + // `AccessPolicy`. This will always be a strongly validated etag, meaning that + // two Access Polices will be identical if and only if their etags are + // identical. Clients should not expect this to be in any specific format. + string etag = 6; +} diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto new file mode 100644 index 00000000000..89d76818dd1 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -0,0 +1,152 @@ +// 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.identity.accesscontextmanager.v1; + +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager"; +option java_multiple_files = true; +option java_outer_classname = "ServicePerimeterProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; +option objc_class_prefix = "GACM"; + +// `ServicePerimeter` describes a set of Google Cloud resources which can freely +// import and export data amongst themselves, but not export outside of the +// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +// has a target outside of the `ServicePerimeter`, the request will be blocked. +// Otherwise the request is allowed. There are two types of Service Perimeter - +// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +// Google Cloud project can only belong to a single regular Service Perimeter. +// Service Perimeter Bridges can contain only Google Cloud projects as members, +// a single Google Cloud project may belong to multiple Service Perimeter +// Bridges. +message ServicePerimeter { + // Specifies the type of the Perimeter. There are two types: regular and + // bridge. Regular Service Perimeter contains resources, access levels, and + // restricted services. Every resource can be in at most ONE + // regular Service Perimeter. + // + // In addition to being in a regular service perimeter, a resource can also + // be in zero or more perimeter bridges. A perimeter bridge only contains + // resources. Cross project operations are permitted if all effected + // resources share some perimeter (whether bridge or regular). Perimeter + // Bridge does not contain access levels or services: those are governed + // entirely by the regular perimeter that resource is in. + // + // Perimeter Bridges are typically useful when building more complex toplogies + // with many independent perimeters that need to share some data with a common + // perimeter, but should not be able to share data among themselves. + enum PerimeterType { + // Regular Perimeter. + PERIMETER_TYPE_REGULAR = 0; + + // Perimeter Bridge. + PERIMETER_TYPE_BRIDGE = 1; + } + + // Required. Resource name for the ServicePerimeter. The `short_name` + // component must begin with a letter and only include alphanumeric and '_'. + // Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `ServicePerimeter` and its use. Does not affect + // behavior. + string description = 3; + + // Output only. Time the `ServicePerimeter` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `ServicePerimeter` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Perimeter type indicator. A single project is + // allowed to be a member of single regular perimeter, but multiple service + // perimeter bridges. A project cannot be a included in a perimeter bridge + // without being included in regular perimeter. For perimeter bridges, + // the restricted service list as well as access level lists must be + // empty. + PerimeterType perimeter_type = 6; + + // Current ServicePerimeter configuration. Specifies sets of resources, + // restricted services and access levels that determine perimeter + // content and boundaries. + ServicePerimeterConfig status = 7; + + // Proposed (or dry run) ServicePerimeter configuration. This configuration + // allows to specify and test ServicePerimeter configuration without enforcing + // actual access restrictions. Only allowed to be set when the + // "use_explicit_dry_run_spec" flag is set. + ServicePerimeterConfig spec = 8; + + // Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + // exists for all Service Perimeters, and that spec is identical to the + // status for those Service Perimeters. When this flag is set, it inhibits the + // generation of the implicit spec, thereby allowing the user to explicitly + // provide a configuration ("spec") to use in a dry-run version of the Service + // Perimeter. This allows the user to test changes to the enforced config + // ("status") without actually enforcing them. This testing is done through + // analyzing the differences between currently enforced and suggested + // restrictions. use_explicit_dry_run_spec must bet set to True if any of the + // fields in the spec are set to non-default values. + bool use_explicit_dry_run_spec = 9; +} + +// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +// describe specific Service Perimeter configuration. +message ServicePerimeterConfig { + // Specifies how APIs are allowed to communicate within the Service + // Perimeter. + message VpcAccessibleServices { + // Whether to restrict API calls within the Service Perimeter to the list of + // APIs specified in 'allowed_services'. + bool enable_restriction = 1; + + // The list of APIs usable within the Service Perimeter. Must be empty + // unless 'enable_restriction' is True. + repeated string allowed_services = 2; + } + + // A list of Google Cloud resources that are inside of the service perimeter. + // Currently only projects are allowed. Format: `projects/{project_number}` + repeated string resources = 1; + + // A list of `AccessLevel` resource names that allow resources within the + // `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + // must be in the same policy as this `ServicePerimeter`. Referencing a + // nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + // For Service Perimeter Bridge, must be empty. + repeated string access_levels = 2; + + // Google Cloud services that are subject to the Service Perimeter + // restrictions. For example, if `storage.googleapis.com` is specified, access + // to the storage buckets inside the perimeter must meet the perimeter's + // access restrictions. + repeated string restricted_services = 4; + + // Configuration for APIs allowed within Perimeter. + VpcAccessibleServices vpc_accessible_services = 10; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 172eabfcca5..c2c1c071118 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1553,15 +1553,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } - /** Properties of a FeedOutputConfig. */ interface IFeedOutputConfig { @@ -1769,6 +1760,15 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + /** Properties of a TemporalAsset. */ interface ITemporalAsset { @@ -1982,6 +1982,18 @@ export namespace google { /** Asset iamPolicy */ iamPolicy?: (google.iam.v1.IPolicy|null); + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** Asset ancestors */ ancestors?: (string[]|null); } @@ -2007,9 +2019,24 @@ export namespace google { /** Asset iamPolicy. */ public iamPolicy?: (google.iam.v1.IPolicy|null); + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** Asset ancestors. */ public ancestors: string[]; + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + /** * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set @@ -7824,352 +7851,790 @@ export namespace google { } } } - } - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { + /** Namespace orgpolicy. */ + namespace orgpolicy { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** Namespace v1. */ + namespace v1 { - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } + /** Properties of a Policy. */ + interface IPolicy { - /** Represents a Http. */ - class Http implements IHttp { + /** Policy version */ + version?: (number|null); - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); + /** Policy constraint */ + constraint?: (string|null); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** Policy etag */ + etag?: (Uint8Array|string|null); - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** Policy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** - * 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; + /** Policy listPolicy */ + listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); - /** - * 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; + /** Policy booleanPolicy */ + booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); - /** - * 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; + /** Policy restoreDefault */ + restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + } - /** - * 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; + /** Represents a Policy. */ + class Policy implements IPolicy { - /** - * 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; + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.IPolicy); - /** - * 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); + /** Policy version. */ + public version: number; - /** - * 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; + /** Policy constraint. */ + public constraint: string; - /** - * 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 }; + /** Policy etag. */ + public etag: (Uint8Array|string); - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Policy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** Properties of a HttpRule. */ - interface IHttpRule { + /** Policy listPolicy. */ + public listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); - /** HttpRule selector */ - selector?: (string|null); + /** Policy booleanPolicy. */ + public booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); - /** HttpRule get */ - get?: (string|null); + /** Policy restoreDefault. */ + public restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); - /** HttpRule put */ - put?: (string|null); + /** Policy policyType. */ + public policyType?: ("listPolicy"|"booleanPolicy"|"restoreDefault"); - /** HttpRule post */ - post?: (string|null); + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.IPolicy): google.cloud.orgpolicy.v1.Policy; - /** HttpRule delete */ - "delete"?: (string|null); + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule patch */ - patch?: (string|null); + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.orgpolicy.v1.Policy; - /** HttpRule body */ - body?: (string|null); + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.orgpolicy.v1.Policy; - /** HttpRule responseBody */ - responseBody?: (string|null); + /** + * Verifies a Policy 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); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy; - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** HttpRule selector. */ - public selector: string; + namespace Policy { - /** HttpRule get. */ - public get: string; + /** Properties of a ListPolicy. */ + interface IListPolicy { - /** HttpRule put. */ - public put: string; + /** ListPolicy allowedValues */ + allowedValues?: (string[]|null); - /** HttpRule post. */ - public post: string; + /** ListPolicy deniedValues */ + deniedValues?: (string[]|null); - /** HttpRule delete. */ - public delete: string; + /** ListPolicy allValues */ + allValues?: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null); - /** HttpRule patch. */ - public patch: string; + /** ListPolicy suggestedValue */ + suggestedValue?: (string|null); - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** ListPolicy inheritFromParent */ + inheritFromParent?: (boolean|null); + } - /** HttpRule body. */ - public body: string; + /** Represents a ListPolicy. */ + class ListPolicy implements IListPolicy { - /** HttpRule responseBody. */ - public responseBody: string; + /** + * Constructs a new ListPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy); - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** ListPolicy allowedValues. */ + public allowedValues: string[]; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** ListPolicy deniedValues. */ + public deniedValues: string[]; - /** - * 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; + /** ListPolicy allValues. */ + public allValues: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues); - /** - * 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; + /** ListPolicy suggestedValue. */ + public suggestedValue: string; - /** - * 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; + /** ListPolicy inheritFromParent. */ + public inheritFromParent: boolean; - /** - * 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; + /** + * Creates a new ListPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy): google.cloud.orgpolicy.v1.Policy.ListPolicy; - /** - * 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; + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; - /** - * 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 }; + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Verifies a ListPolicy 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 ListPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @param message ListPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.ListPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListPolicy { + + /** AllValues enum. */ + enum AllValues { + ALL_VALUES_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of a BooleanPolicy. */ + interface IBooleanPolicy { + + /** BooleanPolicy enforced */ + enforced?: (boolean|null); + } + + /** Represents a BooleanPolicy. */ + class BooleanPolicy implements IBooleanPolicy { + + /** + * Constructs a new BooleanPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy); + + /** BooleanPolicy enforced. */ + public enforced: boolean; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BooleanPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Verifies a BooleanPolicy 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 BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BooleanPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @param message BooleanPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.BooleanPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BooleanPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestoreDefault. */ + interface IRestoreDefault { + } + + /** Represents a RestoreDefault. */ + class RestoreDefault implements IRestoreDefault { + + /** + * Constructs a new RestoreDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault); + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDefault instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Verifies a RestoreDefault 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 RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDefault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @param message RestoreDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.RestoreDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } } + } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Namespace api. */ + namespace api { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Properties of a Http. */ + interface IHttp { - /** CustomHttpPattern path */ - path?: (string|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a Http. */ + class Http implements IHttp { /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.api.IHttp); - /** CustomHttpPattern kind. */ - public kind: string; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** CustomHttpPattern path. */ - public path: string; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns Http instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, 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 + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * 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 CustomHttpPattern + * @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.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @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.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies a CustomHttpPattern message. + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * 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.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** FieldBehavior enum. */ - enum FieldBehavior { + /** 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, @@ -11531,17 +11996,197 @@ export namespace google { } } - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|string|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents an Any. */ + /** 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 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 }; + } + + /** 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 { /** @@ -11935,277 +12580,97 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a Timestamp. */ - interface ITimestamp { + /** Properties of a Duration. */ + interface IDuration { - /** Timestamp seconds */ + /** Duration seconds */ seconds?: (number|Long|string|null); - /** Timestamp nanos */ + /** Duration nanos */ nanos?: (number|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new Timestamp. + * Constructs a new Duration. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); + constructor(properties?: google.protobuf.IDuration); - /** Timestamp seconds. */ + /** Duration seconds. */ public seconds: (number|Long|string); - /** Timestamp nanos. */ + /** Duration nanos. */ public nanos: number; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns Duration instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * 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.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, 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 + * 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.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * 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 Timestamp + * @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.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @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.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies a Timestamp message. + * 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * 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.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp 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. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -12958,6 +13423,1189 @@ export namespace google { } } + /** Namespace identity. */ + namespace identity { + + /** Namespace accesscontextmanager. */ + namespace accesscontextmanager { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AccessLevel. */ + interface IAccessLevel { + + /** AccessLevel name */ + name?: (string|null); + + /** AccessLevel title */ + title?: (string|null); + + /** AccessLevel description */ + description?: (string|null); + + /** AccessLevel basic */ + basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom */ + custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AccessLevel. */ + class AccessLevel implements IAccessLevel { + + /** + * Constructs a new AccessLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessLevel); + + /** AccessLevel name. */ + public name: string; + + /** AccessLevel title. */ + public title: string; + + /** AccessLevel description. */ + public description: string; + + /** AccessLevel basic. */ + public basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom. */ + public custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel level. */ + public level?: ("basic"|"custom"); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessLevel): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Verifies an AccessLevel 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 AccessLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @param message AccessLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BasicLevel. */ + interface IBasicLevel { + + /** BasicLevel conditions */ + conditions?: (google.identity.accesscontextmanager.v1.ICondition[]|null); + + /** BasicLevel combiningFunction */ + combiningFunction?: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null); + } + + /** Represents a BasicLevel. */ + class BasicLevel implements IBasicLevel { + + /** + * Constructs a new BasicLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IBasicLevel); + + /** BasicLevel conditions. */ + public conditions: google.identity.accesscontextmanager.v1.ICondition[]; + + /** BasicLevel combiningFunction. */ + public combiningFunction: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction); + + /** + * Creates a new BasicLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IBasicLevel): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Verifies a BasicLevel 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 BasicLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @param message BasicLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.BasicLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BasicLevel { + + /** ConditionCombiningFunction enum. */ + enum ConditionCombiningFunction { + AND = 0, + OR = 1 + } + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition ipSubnetworks */ + ipSubnetworks?: (string[]|null); + + /** Condition devicePolicy */ + devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels */ + requiredAccessLevels?: (string[]|null); + + /** Condition negate */ + negate?: (boolean|null); + + /** Condition members */ + members?: (string[]|null); + + /** Condition regions */ + regions?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICondition); + + /** Condition ipSubnetworks. */ + public ipSubnetworks: string[]; + + /** Condition devicePolicy. */ + public devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels. */ + public requiredAccessLevels: string[]; + + /** Condition negate. */ + public negate: boolean; + + /** Condition members. */ + public members: string[]; + + /** Condition regions. */ + public regions: string[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICondition): google.identity.accesscontextmanager.v1.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomLevel. */ + interface ICustomLevel { + + /** CustomLevel expr */ + expr?: (google.type.IExpr|null); + } + + /** Represents a CustomLevel. */ + class CustomLevel implements ICustomLevel { + + /** + * Constructs a new CustomLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICustomLevel); + + /** CustomLevel expr. */ + public expr?: (google.type.IExpr|null); + + /** + * Creates a new CustomLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICustomLevel): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Verifies a CustomLevel 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 CustomLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @param message CustomLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.CustomLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DevicePolicy. */ + interface IDevicePolicy { + + /** DevicePolicy requireScreenlock */ + requireScreenlock?: (boolean|null); + + /** DevicePolicy allowedEncryptionStatuses */ + allowedEncryptionStatuses?: (google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]|null); + + /** DevicePolicy osConstraints */ + osConstraints?: (google.identity.accesscontextmanager.v1.IOsConstraint[]|null); + + /** DevicePolicy allowedDeviceManagementLevels */ + allowedDeviceManagementLevels?: (google.identity.accesscontextmanager.type.DeviceManagementLevel[]|null); + + /** DevicePolicy requireAdminApproval */ + requireAdminApproval?: (boolean|null); + + /** DevicePolicy requireCorpOwned */ + requireCorpOwned?: (boolean|null); + } + + /** Represents a DevicePolicy. */ + class DevicePolicy implements IDevicePolicy { + + /** + * Constructs a new DevicePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy); + + /** DevicePolicy requireScreenlock. */ + public requireScreenlock: boolean; + + /** DevicePolicy allowedEncryptionStatuses. */ + public allowedEncryptionStatuses: google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]; + + /** DevicePolicy osConstraints. */ + public osConstraints: google.identity.accesscontextmanager.v1.IOsConstraint[]; + + /** DevicePolicy allowedDeviceManagementLevels. */ + public allowedDeviceManagementLevels: google.identity.accesscontextmanager.type.DeviceManagementLevel[]; + + /** DevicePolicy requireAdminApproval. */ + public requireAdminApproval: boolean; + + /** DevicePolicy requireCorpOwned. */ + public requireCorpOwned: boolean; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DevicePolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Verifies a DevicePolicy 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 DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DevicePolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @param message DevicePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.DevicePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DevicePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OsConstraint. */ + interface IOsConstraint { + + /** OsConstraint osType */ + osType?: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType|null); + + /** OsConstraint minimumVersion */ + minimumVersion?: (string|null); + + /** OsConstraint requireVerifiedChromeOs */ + requireVerifiedChromeOs?: (boolean|null); + } + + /** Represents an OsConstraint. */ + class OsConstraint implements IOsConstraint { + + /** + * Constructs a new OsConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IOsConstraint); + + /** OsConstraint osType. */ + public osType: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType); + + /** OsConstraint minimumVersion. */ + public minimumVersion: string; + + /** OsConstraint requireVerifiedChromeOs. */ + public requireVerifiedChromeOs: boolean; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns OsConstraint instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IOsConstraint): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Verifies an OsConstraint 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 OsConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsConstraint + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @param message OsConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.OsConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AccessPolicy. */ + interface IAccessPolicy { + + /** AccessPolicy name */ + name?: (string|null); + + /** AccessPolicy parent */ + parent?: (string|null); + + /** AccessPolicy title */ + title?: (string|null); + + /** AccessPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag */ + etag?: (string|null); + } + + /** Represents an AccessPolicy. */ + class AccessPolicy implements IAccessPolicy { + + /** + * Constructs a new AccessPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy); + + /** AccessPolicy name. */ + public name: string; + + /** AccessPolicy parent. */ + public parent: string; + + /** AccessPolicy title. */ + public title: string; + + /** AccessPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag. */ + public etag: string; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Verifies an AccessPolicy 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 AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @param message AccessPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServicePerimeter. */ + interface IServicePerimeter { + + /** ServicePerimeter name */ + name?: (string|null); + + /** ServicePerimeter title */ + title?: (string|null); + + /** ServicePerimeter description */ + description?: (string|null); + + /** ServicePerimeter createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType */ + perimeterType?: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null); + + /** ServicePerimeter status */ + status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec */ + spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec */ + useExplicitDryRunSpec?: (boolean|null); + } + + /** Represents a ServicePerimeter. */ + class ServicePerimeter implements IServicePerimeter { + + /** + * Constructs a new ServicePerimeter. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter); + + /** ServicePerimeter name. */ + public name: string; + + /** ServicePerimeter title. */ + public title: string; + + /** ServicePerimeter description. */ + public description: string; + + /** ServicePerimeter createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType. */ + public perimeterType: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType); + + /** ServicePerimeter status. */ + public status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec. */ + public spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec. */ + public useExplicitDryRunSpec: boolean; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeter instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Verifies a ServicePerimeter 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 ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeter + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @param message ServicePerimeter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ServicePerimeter { + + /** PerimeterType enum. */ + enum PerimeterType { + PERIMETER_TYPE_REGULAR = 0, + PERIMETER_TYPE_BRIDGE = 1 + } + } + + /** Properties of a ServicePerimeterConfig. */ + interface IServicePerimeterConfig { + + /** ServicePerimeterConfig resources */ + resources?: (string[]|null); + + /** ServicePerimeterConfig accessLevels */ + accessLevels?: (string[]|null); + + /** ServicePerimeterConfig restrictedServices */ + restrictedServices?: (string[]|null); + + /** ServicePerimeterConfig vpcAccessibleServices */ + vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + } + + /** Represents a ServicePerimeterConfig. */ + class ServicePerimeterConfig implements IServicePerimeterConfig { + + /** + * Constructs a new ServicePerimeterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig); + + /** ServicePerimeterConfig resources. */ + public resources: string[]; + + /** ServicePerimeterConfig accessLevels. */ + public accessLevels: string[]; + + /** ServicePerimeterConfig restrictedServices. */ + public restrictedServices: string[]; + + /** ServicePerimeterConfig vpcAccessibleServices. */ + public vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeterConfig instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Verifies a ServicePerimeterConfig 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 ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeterConfig + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @param message ServicePerimeterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ServicePerimeterConfig { + + /** Properties of a VpcAccessibleServices. */ + interface IVpcAccessibleServices { + + /** VpcAccessibleServices enableRestriction */ + enableRestriction?: (boolean|null); + + /** VpcAccessibleServices allowedServices */ + allowedServices?: (string[]|null); + } + + /** Represents a VpcAccessibleServices. */ + class VpcAccessibleServices implements IVpcAccessibleServices { + + /** + * Constructs a new VpcAccessibleServices. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices); + + /** VpcAccessibleServices enableRestriction. */ + public enableRestriction: boolean; + + /** VpcAccessibleServices allowedServices. */ + public allowedServices: string[]; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccessibleServices instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Verifies a VpcAccessibleServices 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 VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccessibleServices + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @param message VpcAccessibleServices + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Namespace type. */ + namespace type { + + /** DeviceEncryptionStatus enum. */ + enum DeviceEncryptionStatus { + ENCRYPTION_UNSPECIFIED = 0, + ENCRYPTION_UNSUPPORTED = 1, + UNENCRYPTED = 2, + ENCRYPTED = 3 + } + + /** OsType enum. */ + enum OsType { + OS_UNSPECIFIED = 0, + DESKTOP_MAC = 1, + DESKTOP_WINDOWS = 2, + DESKTOP_LINUX = 3, + DESKTOP_CHROME_OS = 6, + ANDROID = 4, + IOS = 5 + } + + /** DeviceManagementLevel enum. */ + enum DeviceManagementLevel { + MANAGEMENT_UNSPECIFIED = 0, + NONE = 1, + BASIC = 2, + COMPLETE = 3 + } + } + } + } + /** Namespace longrunning. */ namespace longrunning { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 9de100bbaec..c83430e023c 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_asset_2_2_0_protos || ($protobuf.roots._google_cloud_asset_2_2_0_protos = {}); $root.google = (function() { @@ -3518,26 +3518,6 @@ return PubsubDestination; })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; - })(); - v1.FeedOutputConfig = (function() { /** @@ -4092,6 +4072,26 @@ return Feed; })(); + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + v1.TemporalAsset = (function() { /** @@ -4564,6 +4564,10 @@ * @property {string|null} [assetType] Asset assetType * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter * @property {Array.|null} [ancestors] Asset ancestors */ @@ -4576,6 +4580,7 @@ * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set */ function Asset(properties) { + this.orgPolicy = []; this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -4615,6 +4620,38 @@ */ Asset.prototype.iamPolicy = null; + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -4623,6 +4660,20 @@ */ Asset.prototype.ancestors = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Asset instance using the specified properties. * @function create @@ -4655,6 +4706,15 @@ $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.ancestors != null && message.ancestors.length) for (var i = 0; i < message.ancestors.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); @@ -4704,6 +4764,20 @@ case 4: message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; + case 6: + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + case 7: + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + case 8: + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + case 9: + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -4744,6 +4818,7 @@ Asset.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"; @@ -4760,6 +4835,43 @@ if (error) return "iamPolicy." + error; } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -4796,6 +4908,31 @@ throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -4819,8 +4956,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { + object.orgPolicy = []; object.ancestors = []; + } if (options.defaults) { object.name = ""; object.assetType = ""; @@ -4835,6 +4974,26 @@ object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } if (message.ancestors && message.ancestors.length) { object.ancestors = []; for (var j = 0; j < message.ancestors.length; ++j) @@ -18448,487 +18607,4836 @@ return asset; })(); - 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]]; - } + cloud.orgpolicy = (function() { /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance + * Namespace orgpolicy. + * @memberof google.cloud + * @namespace */ - Http.prototype.rules = $util.emptyArray; + var orgpolicy = {}; - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; + orgpolicy.v1 = (function() { - /** - * 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); - }; + /** + * Namespace v1. + * @memberof google.cloud.orgpolicy + * @namespace + */ + var v1 = {}; - /** - * 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; + v1.Policy = (function() { - /** - * 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(); - }; + /** + * Properties of a Policy. + * @memberof google.cloud.orgpolicy.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {string|null} [constraint] Policy constraint + * @property {Uint8Array|null} [etag] Policy etag + * @property {google.protobuf.ITimestamp|null} [updateTime] Policy updateTime + * @property {google.cloud.orgpolicy.v1.Policy.IListPolicy|null} [listPolicy] Policy listPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null} [booleanPolicy] Policy booleanPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null} [restoreDefault] Policy restoreDefault + */ - /** - * 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; + /** + * Constructs a new Policy. + * @memberof google.cloud.orgpolicy.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + */ + function Policy(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 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; - }; + /** + * Policy version. + * @member {number} version + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.version = 0; - /** - * 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; - }; + /** + * Policy constraint. + * @member {string} constraint + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.constraint = ""; - /** - * 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; - }; + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); - /** - * 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); - }; + /** + * Policy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.updateTime = null; - return Http; - })(); + /** + * Policy listPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IListPolicy|null|undefined} listPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.listPolicy = null; - api.HttpRule = (function() { + /** + * Policy booleanPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null|undefined} booleanPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.booleanPolicy = null; - /** - * 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 - */ + /** + * Policy restoreDefault. + * @member {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null|undefined} restoreDefault + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.restoreDefault = null; - /** - * 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]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; + /** + * Policy policyType. + * @member {"listPolicy"|"booleanPolicy"|"restoreDefault"|undefined} policyType + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "policyType", { + get: $util.oneOfGetter($oneOfFields = ["listPolicy", "booleanPolicy", "restoreDefault"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.constraint != null && message.hasOwnProperty("constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.encode(message.listPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.encode(message.booleanPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) + $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.encode(message.restoreDefault, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.orgpolicy.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int32(); + break; + case 2: + message.constraint = reader.string(); + break; + case 3: + message.etag = reader.bytes(); + break; + case 4: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); + break; + case 6: + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); + break; + case 7: + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = ""; + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.verify(message.listPolicy); + if (error) + return "listPolicy." + error; + } + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify(message.booleanPolicy); + if (error) + return "booleanPolicy." + error; + } + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify(message.restoreDefault); + if (error) + return "restoreDefault." + error; + } + } + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.listPolicy != null) { + if (typeof object.listPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.listPolicy: object expected"); + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.fromObject(object.listPolicy); + } + if (object.booleanPolicy != null) { + if (typeof object.booleanPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.booleanPolicy: object expected"); + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.fromObject(object.booleanPolicy); + } + if (object.restoreDefault != null) { + if (typeof object.restoreDefault !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.restoreDefault: object expected"); + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.fromObject(object.restoreDefault); + } + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = 0; + object.constraint = ""; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + object.updateTime = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + object.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.toObject(message.listPolicy, options); + if (options.oneofs) + object.policyType = "listPolicy"; + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + object.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.toObject(message.booleanPolicy, options); + if (options.oneofs) + object.policyType = "booleanPolicy"; + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + object.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.toObject(message.restoreDefault, options); + if (options.oneofs) + object.policyType = "restoreDefault"; + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Policy.ListPolicy = (function() { + + /** + * Properties of a ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IListPolicy + * @property {Array.|null} [allowedValues] ListPolicy allowedValues + * @property {Array.|null} [deniedValues] ListPolicy deniedValues + * @property {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null} [allValues] ListPolicy allValues + * @property {string|null} [suggestedValue] ListPolicy suggestedValue + * @property {boolean|null} [inheritFromParent] ListPolicy inheritFromParent + */ + + /** + * Constructs a new ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a ListPolicy. + * @implements IListPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + */ + function ListPolicy(properties) { + this.allowedValues = []; + this.deniedValues = []; + 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]]; + } + + /** + * ListPolicy allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allowedValues = $util.emptyArray; + + /** + * ListPolicy deniedValues. + * @member {Array.} deniedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.deniedValues = $util.emptyArray; + + /** + * ListPolicy allValues. + * @member {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues} allValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allValues = 0; + + /** + * ListPolicy suggestedValue. + * @member {string} suggestedValue + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.suggestedValue = ""; + + /** + * ListPolicy inheritFromParent. + * @member {boolean} inheritFromParent + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.inheritFromParent = false; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy instance + */ + ListPolicy.create = function create(properties) { + return new ListPolicy(properties); + }; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + if (message.deniedValues != null && message.deniedValues.length) + for (var i = 0; i < message.deniedValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); + if (message.allValues != null && message.hasOwnProperty("allValues")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.allValues); + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.suggestedValue); + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inheritFromParent); + return writer; + }; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.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.orgpolicy.v1.Policy.ListPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + case 2: + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + case 3: + message.allValues = reader.int32(); + break; + case 4: + message.suggestedValue = reader.string(); + break; + case 5: + message.inheritFromParent = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.deniedValues != null && message.hasOwnProperty("deniedValues")) { + if (!Array.isArray(message.deniedValues)) + return "deniedValues: array expected"; + for (var i = 0; i < message.deniedValues.length; ++i) + if (!$util.isString(message.deniedValues[i])) + return "deniedValues: string[] expected"; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + switch (message.allValues) { + default: + return "allValues: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + if (!$util.isString(message.suggestedValue)) + return "suggestedValue: string expected"; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (typeof message.inheritFromParent !== "boolean") + return "inheritFromParent: boolean expected"; + return null; + }; + + /** + * Creates a ListPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + */ + ListPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.ListPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.ListPolicy(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.deniedValues) { + if (!Array.isArray(object.deniedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.deniedValues: array expected"); + message.deniedValues = []; + for (var i = 0; i < object.deniedValues.length; ++i) + message.deniedValues[i] = String(object.deniedValues[i]); + } + switch (object.allValues) { + case "ALL_VALUES_UNSPECIFIED": + case 0: + message.allValues = 0; + break; + case "ALLOW": + case 1: + message.allValues = 1; + break; + case "DENY": + case 2: + message.allValues = 2; + break; + } + if (object.suggestedValue != null) + message.suggestedValue = String(object.suggestedValue); + if (object.inheritFromParent != null) + message.inheritFromParent = Boolean(object.inheritFromParent); + return message; + }; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.ListPolicy} message ListPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.deniedValues = []; + } + if (options.defaults) { + object.allValues = options.enums === String ? "ALL_VALUES_UNSPECIFIED" : 0; + object.suggestedValue = ""; + object.inheritFromParent = false; + } + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.deniedValues && message.deniedValues.length) { + object.deniedValues = []; + for (var j = 0; j < message.deniedValues.length; ++j) + object.deniedValues[j] = message.deniedValues[j]; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + object.suggestedValue = message.suggestedValue; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + object.inheritFromParent = message.inheritFromParent; + return object; + }; + + /** + * Converts this ListPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + * @returns {Object.} JSON object + */ + ListPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AllValues enum. + * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues + * @enum {string} + * @property {number} ALL_VALUES_UNSPECIFIED=0 ALL_VALUES_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + ListPolicy.AllValues = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALL_VALUES_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return ListPolicy; + })(); + + Policy.BooleanPolicy = (function() { + + /** + * Properties of a BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IBooleanPolicy + * @property {boolean|null} [enforced] BooleanPolicy enforced + */ + + /** + * Constructs a new BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a BooleanPolicy. + * @implements IBooleanPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + */ + function BooleanPolicy(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]]; + } + + /** + * BooleanPolicy enforced. + * @member {boolean} enforced + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + */ + BooleanPolicy.prototype.enforced = false; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy instance + */ + BooleanPolicy.create = function create(properties) { + return new BooleanPolicy(properties); + }; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforced != null && message.hasOwnProperty("enforced")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enforced); + return writer; + }; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.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.orgpolicy.v1.Policy.BooleanPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enforced = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforced != null && message.hasOwnProperty("enforced")) + if (typeof message.enforced !== "boolean") + return "enforced: boolean expected"; + return null; + }; + + /** + * Creates a BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + */ + BooleanPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy(); + if (object.enforced != null) + message.enforced = Boolean(object.enforced); + return message; + }; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} message BooleanPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enforced = false; + if (message.enforced != null && message.hasOwnProperty("enforced")) + object.enforced = message.enforced; + return object; + }; + + /** + * Converts this BooleanPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + * @returns {Object.} JSON object + */ + BooleanPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BooleanPolicy; + })(); + + Policy.RestoreDefault = (function() { + + /** + * Properties of a RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IRestoreDefault + */ + + /** + * Constructs a new RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a RestoreDefault. + * @implements IRestoreDefault + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + */ + function RestoreDefault(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 RestoreDefault instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault instance + */ + RestoreDefault.create = function create(properties) { + return new RestoreDefault(properties); + }; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.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.orgpolicy.v1.Policy.RestoreDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDefault message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + */ + RestoreDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault) + return object; + return new $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault(); + }; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.RestoreDefault} message RestoreDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDefault.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreDefault to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @instance + * @returns {Object.} JSON object + */ + RestoreDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RestoreDefault; + })(); + + return Policy; + })(); + + return v1; + })(); + + return orgpolicy; + })(); + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("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 {string} + * @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 && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("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 {string} + * @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 && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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; + }; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * 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 */ - HttpRule.prototype.custom = null; + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * 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 + */ + + /** + * 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 */ - HttpRule.prototype.body = ""; + FieldDescriptorProto.prototype.name = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - HttpRule.prototype.responseBody = ""; + FieldDescriptorProto.prototype.number = 0; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; + FieldDescriptorProto.prototype.label = 1; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + FieldDescriptorProto.prototype.typeName = ""; /** - * Creates a new HttpRule instance using the specified properties. + * 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; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.api.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.api.HttpRule(); + 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.selector = reader.string(); - break; - case 2: - message.get = reader.string(); + message.name = reader.string(); break; case 3: - message.put = reader.string(); + message.number = reader.int32(); break; case 4: - message.post = reader.string(); + message.label = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.type = reader.int32(); break; case 6: - message.patch = reader.string(); + message.typeName = reader.string(); break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + case 2: + message.extendee = reader.string(); break; case 7: - message.body = reader.string(); + message.defaultValue = reader.string(); break; - case 12: - message.responseBody = reader.string(); + case 9: + message.oneofIndex = reader.int32(); break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18939,240 +23447,359 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a FieldDescriptorProto message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + FieldDescriptorProto.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.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.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; + 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; } return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ - 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); + 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; } - 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]); - } + 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); } return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + FieldDescriptorProto.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); + 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 = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this FieldDescriptorProto to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @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 {string} + * @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; })(); - api.CustomHttpPattern = (function() { + protobuf.OneofDescriptorProto = (function() { /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * 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 CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19180,88 +23807,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - CustomHttpPattern.prototype.kind = ""; + OneofDescriptorProto.prototype.name = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - CustomHttpPattern.prototype.path = ""; + OneofDescriptorProto.prototype.options = null; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new OneofDescriptorProto instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.api.CustomHttpPattern(); + 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.kind = reader.string(); + message.name = reader.string(); break; case 2: - message.path = reader.string(); + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -19272,144 +23899,128 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies an OneofDescriptorProto message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + OneofDescriptorProto.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"; + 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 a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) 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); + 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 a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.name = ""; + object.options = null; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + 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 CustomHttpPattern to JSON. + * Converts this OneofDescriptorProto to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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; + return OneofDescriptorProto; })(); - api.ResourceDescriptor = (function() { + protobuf.EnumDescriptorProto = (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 + * 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 ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; + 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) @@ -19417,143 +24028,136 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + EnumDescriptorProto.prototype.name = ""; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ResourceDescriptor.prototype.nameField = ""; + EnumDescriptorProto.prototype.value = $util.emptyArray; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ResourceDescriptor.prototype.history = 0; + EnumDescriptorProto.prototype.options = null; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ResourceDescriptor.prototype.plural = ""; + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ResourceDescriptor.prototype.singular = ""; + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.api.ResourceDescriptor(); + 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.type = reader.string(); + message.name = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nameField = reader.string(); + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.history = reader.int32(); + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -19564,196 +24168,405 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies an EnumDescriptorProto message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + EnumDescriptorProto.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.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.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.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.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"; + } + 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) 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]); + 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.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.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]); } - 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. + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.pattern = []; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.name = ""; + object.options = null; } - 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.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]; } - 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); - }; + /** + * 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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); + }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @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 EnumReservedRange; })(); - return ResourceDescriptor; + return EnumDescriptorProto; })(); - api.ResourceReference = (function() { + protobuf.EnumValueDescriptorProto = (function() { /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * 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 ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ - function ResourceReference(properties) { + function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19761,88 +24574,101 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - ResourceReference.prototype.type = ""; + EnumValueDescriptorProto.prototype.name = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - ResourceReference.prototype.childType = ""; + EnumValueDescriptorProto.prototype.number = 0; /** - * Creates a new ResourceReference instance using the specified properties. + * 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.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.api.ResourceReference(); + 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.type = reader.string(); + message.name = reader.string(); break; case 2: - message.childType = reader.string(); + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -19853,129 +24679,132 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies an EnumValueDescriptorProto message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + EnumValueDescriptorProto.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"; + 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 a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) 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); + 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 a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.name = ""; + object.number = 0; + object.options = null; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return EnumValueDescriptorProto; })(); - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { + protobuf.ServiceDescriptorProto = (function() { /** - * Properties of a FileDescriptorSet. + * Properties of a ServiceDescriptorProto. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @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 FileDescriptorSet. + * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function ServiceDescriptorProto(properties) { + this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19983,78 +24812,104 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + ServiceDescriptorProto.prototype.name = ""; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * 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.FileDescriptorSet + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + ServiceDescriptorProto.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(); + if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @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.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decode = function decode(reader, length) { + 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.FileDescriptorSet(); + 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: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + 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); @@ -20065,330 +24920,273 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies a ServiceDescriptorProto message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @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 */ - FileDescriptorSet.verify = function verify(message) { + ServiceDescriptorProto.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 (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 "file." + 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) 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]); + 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 FileDescriptorSet message. Also converts values to other types if specified. + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options) { + ServiceDescriptorProto.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); + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; } - 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 = ""; + 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; + }; /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto * @instance + * @returns {Object.} JSON object */ - FileDescriptorProto.prototype["package"] = ""; + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; + return ServiceDescriptorProto; + })(); - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + protobuf.MethodDescriptorProto = (function() { /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance + * 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 */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + 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]]; + } /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + MethodDescriptorProto.prototype.name = ""; /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorProto.prototype.service = $util.emptyArray; + MethodDescriptorProto.prototype.inputType = ""; /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + MethodDescriptorProto.prototype.outputType = ""; /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorProto.prototype.options = null; + MethodDescriptorProto.prototype.options = null; /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + MethodDescriptorProto.prototype.clientStreaming = false; /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorProto.prototype.syntax = ""; + MethodDescriptorProto.prototype.serverStreaming = false; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new MethodDescriptorProto instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); }; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer) { + MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("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.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("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 && message.hasOwnProperty("syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorProto + * @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.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decode = function decode(reader, length) { + 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.FileDescriptorProto(); + 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) { @@ -20396,61 +25194,19 @@ message.name = reader.string(); break; case 2: - message["package"] = reader.string(); + message.inputType = 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()); + message.outputType = reader.string(); break; case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + message.options = $root.google.protobuf.MethodOptions.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())); + message.clientStreaming = reader.bool(); 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(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -20461,329 +25217,176 @@ }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorProto message. + * Verifies a MethodDescriptorProto message. * @function verify - * @memberof google.protobuf.FileDescriptorProto + * @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 */ - FileDescriptorProto.verify = function verify(message) { + 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["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.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.FileOptions.verify(message.options); + var error = $root.google.protobuf.MethodOptions.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"; + 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; - var message = new $root.google.protobuf.FileDescriptorProto(); + var message = new $root.google.protobuf.MethodDescriptorProto(); 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.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.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); + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); } - if (object.syntax != null) - message.syntax = String(object.syntax); + 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 FileDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + MethodDescriptorProto.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.inputType = ""; + object.outputType = ""; object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; + object.clientStreaming = false; + object.serverStreaming = false; } 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.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.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; + 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 FileDescriptorProto to JSON. + * Converts this MethodDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.toJSON = function toJSON() { + MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorProto; + return MethodDescriptorProto; })(); - protobuf.DescriptorProto = (function() { + protobuf.FileOptions = (function() { /** - * Properties of a DescriptorProto. + * Properties of a FileOptions. * @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 + * @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 DescriptorProto. + * Constructs a new FileOptions. * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto + * @classdesc Represents a FileOptions. + * @implements IFileOptions * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; + 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) @@ -20791,216 +25394,354 @@ } /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.name = ""; + FileOptions.prototype.javaPackage = ""; /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.field = $util.emptyArray; + FileOptions.prototype.javaOuterClassname = ""; /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.extension = $util.emptyArray; + FileOptions.prototype.javaMultipleFiles = false; /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.nestedType = $util.emptyArray; + FileOptions.prototype.javaGenerateEqualsAndHash = false; /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.enumType = $util.emptyArray; + FileOptions.prototype.javaStringCheckUtf8 = false; /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; + FileOptions.prototype.optimizeFor = 1; /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; + FileOptions.prototype.goPackage = ""; /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.options = null; + FileOptions.prototype.ccGenericServices = false; /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + FileOptions.prototype.javaGenericServices = false; /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + FileOptions.prototype.pyGenericServices = false; /** - * Creates a new DescriptorProto instance using the specified properties. + * 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 = false; + + /** + * 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.DescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer) { + FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("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]); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("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 DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes a FileOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @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.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decode = function decode(reader, length) { + 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.DescriptorProto(); + 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.name = reader.string(); + message.javaPackage = reader.string(); break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + case 8: + message.javaOuterClassname = reader.string(); break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + case 10: + message.javaMultipleFiles = reader.bool(); break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + case 27: + message.javaStringCheckUtf8 = reader.bool(); break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + case 9: + message.optimizeFor = reader.int32(); break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + case 11: + message.goPackage = reader.string(); break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + case 16: + message.ccGenericServices = reader.bool(); break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + case 17: + message.javaGenericServices = reader.bool(); break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + 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); @@ -21011,766 +25752,681 @@ }; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DescriptorProto message. + * Verifies a FileOptions message. * @function verify - * @memberof google.protobuf.DescriptorProto + * @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 */ - DescriptorProto.verify = function verify(message) { + FileOptions.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.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.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 (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 "oneofDecl." + error; + return "uninterpretedOption." + 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 (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 "reservedRange." + error; + return ".google.api.resourceDefinition." + 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. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.FileOptions} FileOptions */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) 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]]; + 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; } - - /** - * 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 && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("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); + 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]); } - 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 (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]); } - 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; - }; + } + return message; + }; - /** - * 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); - }; + /** + * 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 = false; + 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; + }; - return ExtensionRange; + /** + * 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 {string} + * @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; })(); - DescriptorProto.ReservedRange = (function() { + return FileOptions; + })(); - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ + protobuf.MessageOptions = (function() { - /** - * 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]]; - } + /** + * 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 + */ - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; + /** + * 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]]; + } - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; - /** - * 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); - }; + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; - /** - * 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 && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; - /** - * 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(); - }; + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; - /** - * 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; - }; + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * 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()); - }; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; - /** - * 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 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); + }; - /** - * 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; - }; + /** + * 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 && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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; + }; - /** - * 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; + /** + * 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.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; + } + 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; + }; - /** - * 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); - }; + /** + * 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; + }; - return ReservedRange; - })(); + /** + * 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 DescriptorProto; + return MessageOptions; })(); - protobuf.ExtensionRangeOptions = (function() { + protobuf.FieldOptions = (function() { /** - * Properties of an ExtensionRangeOptions. + * Properties of a FieldOptions. * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @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 ExtensionRangeOptions. + * Constructs a new FieldOptions. * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - function ExtensionRangeOptions(properties) { + 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) @@ -21778,79 +26434,194 @@ } /** - * ExtensionRangeOptions uninterpretedOption. + * 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.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @instance */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * 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.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, writer) { + FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * Decodes a FieldOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ExtensionRangeOptions + * @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.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decode = function decode(reader, length) { + 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.ExtensionRangeOptions(); + 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; @@ -21860,32 +26631,62 @@ }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRangeOptions message. + * Verifies a FieldOptions message. * @function verify - * @memberof google.protobuf.ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.verify = function verify(message) { + 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"; @@ -21895,98 +26696,247 @@ 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]); - } + 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 an ExtensionRangeOptions message. Also converts values to other types if specified. + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options) { + FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + 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 ExtensionRangeOptions to JSON. + * Converts this FieldOptions to JSON. * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { + FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExtensionRangeOptions; + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @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 {string} + * @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.FieldDescriptorProto = (function() { + protobuf.OneofOptions = (function() { /** - * Properties of a FieldDescriptorProto. + * Properties of an OneofOptions. * @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 + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** - * Constructs a new FieldDescriptorProto. + * Constructs a new OneofOptions. * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - function FieldDescriptorProto(properties) { + function OneofOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21994,192 +26944,78 @@ } /** - * 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 + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions * @instance */ - FieldDescriptorProto.prototype.options = null; + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer) { + OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + 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 FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * Decodes an OneofOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldDescriptorProto + * @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.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decode = function decode(reader, length) { + 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.FieldDescriptorProto(); + 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 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()); + 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); @@ -22190,359 +27026,127 @@ }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldDescriptorProto message. + * Verifies an OneofOptions message. * @function verify - * @memberof google.protobuf.FieldDescriptorProto + * @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 */ - FieldDescriptorProto.verify = function verify(message) { + OneofOptions.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; - } - 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 (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 a FieldDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + OneofOptions.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 = ""; + 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); } - 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; return object; }; /** - * Converts this FieldDescriptorProto to JSON. + * Converts this OneofOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { + OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} - * @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 {string} - * @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; + return OneofOptions; })(); - protobuf.OneofDescriptorProto = (function() { + protobuf.EnumOptions = (function() { /** - * Properties of an OneofDescriptorProto. + * Properties of an EnumOptions. * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** - * Constructs a new OneofDescriptorProto. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function OneofDescriptorProto(properties) { + function EnumOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22550,88 +27154,104 @@ } /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions * @instance */ - OneofDescriptorProto.prototype.name = ""; + EnumOptions.prototype.allowAlias = false; /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions * @instance */ - OneofDescriptorProto.prototype.options = null; + EnumOptions.prototype.deprecated = false; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * 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.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); }; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer) { + EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("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 OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * Decodes an EnumOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofDescriptorProto + * @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.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decode = function decode(reader, length) { + 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.OneofDescriptorProto(); + 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 1: - message.name = reader.string(); - break; case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + 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); @@ -22642,128 +27262,144 @@ }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofDescriptorProto message. + * Verifies an EnumOptions message. * @function verify - * @memberof google.protobuf.OneofDescriptorProto + * @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 */ - OneofDescriptorProto.verify = function verify(message) { + EnumOptions.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; + 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @returns {google.protobuf.EnumOptions} EnumOptions */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) 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); + 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 OneofDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofDescriptorProto.toObject = function toObject(message, options) { + EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.options = null; + 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); } - 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. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OneofDescriptorProto; + return EnumOptions; })(); - protobuf.EnumDescriptorProto = (function() { + protobuf.EnumValueOptions = (function() { /** - * Properties of an EnumDescriptorProto. + * Properties of an EnumValueOptions. * @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 + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** - * Constructs a new EnumDescriptorProto. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; + function EnumValueOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22771,136 +27407,91 @@ } /** - * 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 + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions * @instance */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + EnumValueOptions.prototype.deprecated = false; /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions * @instance */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); }; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, writer) { + EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("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]); + if (message.deprecated != null && message.hasOwnProperty("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 EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto + * @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.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decode = function decode(reader, length) { + 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.EnumDescriptorProto(); + 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.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())); + message.deprecated = reader.bool(); break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + 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); @@ -22911,405 +27502,137 @@ }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumDescriptorProto message. + * Verifies an EnumValueOptions message. * @function verify - * @memberof google.protobuf.EnumDescriptorProto + * @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 */ - EnumDescriptorProto.verify = function verify(message) { + EnumValueOptions.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 (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 "reservedRange." + error; + return "uninterpretedOption." + 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. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) 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]); + 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]); } } - 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. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + EnumValueOptions.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]; + 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 EnumDescriptorProto to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { + EnumValueOptions.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 && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("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; + return EnumValueOptions; })(); - protobuf.EnumValueDescriptorProto = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of an EnumValueDescriptorProto. + * Properties of a ServiceOptions. * @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 + * @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 EnumValueDescriptorProto. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function EnumValueDescriptorProto(properties) { + function ServiceOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23317,101 +27640,117 @@ } /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueDescriptorProto.prototype.name = ""; + ServiceOptions.prototype.deprecated = false; /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueDescriptorProto.prototype.number = 0; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueDescriptorProto.prototype.options = null; + ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * 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.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, writer) { + ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.deprecated != null && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto + * @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.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decode = function decode(reader, length) { + 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.EnumValueDescriptorProto(); + 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 1: - message.name = reader.string(); + case 33: + message.deprecated = reader.bool(); break; - case 2: - message.number = reader.int32(); + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); break; default: reader.skipType(tag & 7); @@ -23422,132 +27761,157 @@ }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueDescriptorProto message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.verify = function verify(message) { + ServiceOptions.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; + 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 an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) 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); + 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 an EnumValueDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; } - 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); + 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 EnumValueDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumValueDescriptorProto; + return ServiceOptions; })(); - protobuf.ServiceDescriptorProto = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a ServiceDescriptorProto. + * Properties of a MethodOptions. * @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 + * @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 ServiceDescriptorProto. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + 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) @@ -23555,104 +27919,146 @@ } /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceDescriptorProto.prototype.name = ""; + MethodOptions.prototype.deprecated = false; /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + MethodOptions.prototype.idempotencyLevel = 0; /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceDescriptorProto.prototype.options = null; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * 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.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 && message.hasOwnProperty(".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 ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceDescriptorProto + * @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.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decode = function decode(reader, length) { + 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.ServiceDescriptorProto(); + 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 1: - message.name = reader.string(); + case 33: + message.deprecated = reader.bool(); break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + case 34: + message.idempotencyLevel = reader.int32(); break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + 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); @@ -23663,152 +28069,230 @@ }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceDescriptorProto message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.protobuf.ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.verify = function verify(message) { + MethodOptions.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 (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 "method." + error; + return "uninterpretedOption." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); + 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 "options." + 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @returns {google.protobuf.MethodOptions} MethodOptions */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) 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]); + 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.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + 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 ServiceDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.method = []; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } if (options.defaults) { - object.name = ""; - object.options = null; + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = 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.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.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, 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 ServiceDescriptorProto to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ServiceDescriptorProto; + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @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.MethodDescriptorProto = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a MethodDescriptorProto. + * Properties of an UninterpretedOption. * @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 + * @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 MethodDescriptorProto. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function MethodDescriptorProto(properties) { + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23816,140 +28300,156 @@ } /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodDescriptorProto.prototype.name = ""; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodDescriptorProto.prototype.inputType = ""; + UninterpretedOption.prototype.identifierValue = ""; /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodDescriptorProto.prototype.outputType = ""; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto + * 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 */ - MethodDescriptorProto.prototype.options = null; + UninterpretedOption.prototype.doubleValue = 0; /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodDescriptorProto.prototype.clientStreaming = false; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodDescriptorProto.prototype.serverStreaming = false; + UninterpretedOption.prototype.aggregateValue = ""; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @function create - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer) { + UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + 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 && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodDescriptorProto + * @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.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decode = function decode(reader, length) { + 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.MethodDescriptorProto(); + 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 1: - message.name = reader.string(); - break; case 2: - message.inputType = reader.string(); + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; case 3: - message.outputType = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + message.positiveIntValue = reader.uint64(); break; case 5: - message.clientStreaming = reader.bool(); + message.negativeIntValue = reader.int64(); break; case 6: - message.serverStreaming = reader.bool(); + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -23960,176 +28460,422 @@ }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodDescriptorProto message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.protobuf.MethodDescriptorProto + * @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 */ - MethodDescriptorProto.verify = function verify(message) { + UninterpretedOption.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.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.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"; + 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 a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) 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); + 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.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); + 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 a MethodDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.name = []; if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; + 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 != 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; + 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 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); - }; + /** + * 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 MethodDescriptorProto; + return UninterpretedOption; })(); - protobuf.FileOptions = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of a FileOptions. + * Properties of a SourceCodeInfo. * @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 + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new FileOptions. + * Constructs a new SourceCodeInfo. * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24137,710 +28883,549 @@ } /** - * 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 = false; - - /** - * 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 + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer) { + SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("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(); + 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 FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @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.FileOptions} FileOptions + * @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 */ - FileOptions.decode = function decode(reader, length) { + 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.FileOptions(); + 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: - 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); + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); 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]); + 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 ".google.api.resourceDefinition." + error; + return "location." + error; } } return null; }; /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) 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]); + 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 FileOptions message. Also converts values to other types if specified. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + SourceCodeInfo.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 = false; - 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); + 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 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); - }; + /** + * 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 && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("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; + }; - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} - * @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; + /** + * 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 FileOptions; + return SourceCodeInfo; })(); - protobuf.MessageOptions = (function() { + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a MessageOptions. + * Properties of a GeneratedCodeInfo. * @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 + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new MessageOptions. + * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function MessageOptions(properties) { - this.uninterpretedOption = []; + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24848,328 +29433,484 @@ } /** - * 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 + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - MessageOptions.prototype[".google.api.resource"] = null; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + 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 MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MessageOptions + * @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.MessageOptions} MessageOptions + * @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 */ - MessageOptions.decode = function decode(reader, length) { + 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.MessageOptions(); + 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: - 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()); + 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 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()); - }; + } + 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 && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("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; + }; - /** - * 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; + /** + * 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 (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; - }; + 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 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]); + /** + * 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 (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; - }; + 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; + }; - /** - * 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 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); + }; - /** - * 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 Annotation; + })(); - return MessageOptions; + return GeneratedCodeInfo; })(); - protobuf.FieldOptions = (function() { + protobuf.Empty = (function() { /** - * Properties of a FieldOptions. + * Properties of an Empty. * @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 + * @interface IEmpty */ /** - * Constructs a new FieldOptions. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25177,194 +29918,63 @@ } /** - * 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. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @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.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decode = function decode(reader, length) { + 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.FieldOptions(); + 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) { - 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; @@ -25374,312 +29984,95 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.FieldOptions + * @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 */ - FieldOptions.verify = function verify(message) { + Empty.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. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.Empty} Empty */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) 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; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {google.protobuf.Empty} message Empty * @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; + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this FieldOptions to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - FieldOptions.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {string} - * @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 {string} - * @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; + return Empty; })(); - protobuf.OneofOptions = (function() { + protobuf.Timestamp = (function() { /** - * Properties of an OneofOptions. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new OneofOptions. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function OneofOptions(properties) { - this.uninterpretedOption = []; + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25687,78 +30080,88 @@ } /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new OneofOptions instance using the specified properties. + * 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.OneofOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer) { + Timestamp.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(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofOptions + * @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.OneofOptions} OneofOptions + * @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 */ - OneofOptions.decode = function decode(reader, length) { + 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.OneofOptions(); + 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 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); @@ -25769,127 +30172,131 @@ }; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions + * @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 */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofOptions message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.OneofOptions + * @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 */ - OneofOptions.verify = function verify(message) { + Timestamp.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; - } - } + 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 an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.Timestamp} Timestamp */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) 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]); - } - } + 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 an OneofOptions message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + Timestamp.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); + 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 OneofOptions to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OneofOptions; + return Timestamp; })(); - protobuf.EnumOptions = (function() { + protobuf.Any = (function() { /** - * Properties of an EnumOptions. + * Properties of an Any. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new EnumOptions. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function EnumOptions(properties) { - this.uninterpretedOption = []; + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25897,104 +30304,88 @@ } /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - EnumOptions.prototype.deprecated = false; + Any.prototype.type_url = ""; /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + Any.prototype.value = $util.newBuffer([]); /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("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(); + if (message.type_url != null && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @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.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decode = function decode(reader, length) { + 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.EnumOptions(); + 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 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); + case 1: + message.type_url = reader.string(); break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: + message.value = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -26005,144 +30396,126 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.EnumOptions + * @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 */ - EnumOptions.verify = function verify(message) { + Any.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; - } - } + 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.Any} Any */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) 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]); - } - } + 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 EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + Any.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); + 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 EnumOptions to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumOptions; + return Any; })(); - protobuf.EnumValueOptions = (function() { + protobuf.Struct = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a Struct. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IStruct + * @property {Object.|null} [fields] Struct fields */ /** - * Constructs a new EnumValueOptions. + * Constructs a new Struct. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a Struct. + * @implements IStruct * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IStruct=} [properties] Properties to set */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; + function Struct(properties) { + this.fields = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26150,91 +30523,83 @@ } /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + Struct.prototype.fields = $util.emptyObject; /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Struct instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + Struct.create = function create(properties) { + return new Struct(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + Struct.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("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(); + if (message.fields != null && message.hasOwnProperty("fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + Struct.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a Struct message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @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 + * @returns {google.protobuf.Struct} Struct * @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) { + Struct.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key; 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())); + reader.skip().pos++; + if (message.fields === $util.emptyObject) + message.fields = {}; + key = reader.string(); + reader.pos++; + message.fields[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -26245,137 +30610,131 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a Struct message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Struct} Struct * @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) { + Struct.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a Struct message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @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) { + Struct.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 (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); if (error) - return "uninterpretedOption." + error; + return "fields." + error; } } return null; }; /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Struct} Struct */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) 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]); + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); } } return message; }; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a Struct message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.Struct} message Struct * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + Struct.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); + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); } return object; }; /** - * Converts this EnumValueOptions to JSON. + * Converts this Struct to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + Struct.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumValueOptions; + return Struct; })(); - protobuf.ServiceOptions = (function() { + protobuf.Value = (function() { /** - * Properties of a ServiceOptions. + * Properties of a Value. * @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 + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue */ /** - * Constructs a new ServiceOptions. + * Constructs a new Value. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents a Value. + * @implements IValue * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IValue=} [properties] Properties to set */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; + function Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26383,117 +30742,154 @@ } /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype.deprecated = false; + Value.prototype.nullValue = 0; /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + Value.prototype.numberValue = 0; /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + Value.prototype.stringValue = ""; /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + Value.prototype.boolValue = false; /** - * Creates a new ServiceOptions instance using the specified properties. + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + Value.create = function create(properties) { + return new Value(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message.nullValue != null && message.hasOwnProperty("nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && message.hasOwnProperty("numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && message.hasOwnProperty("boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && message.hasOwnProperty("structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && message.hasOwnProperty("listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @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 + * @returns {google.protobuf.Value} Value * @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) { + Value.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); + case 1: + message.nullValue = reader.int32(); break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: + message.numberValue = reader.double(); break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); + case 3: + message.stringValue = reader.string(); break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -26504,157 +30900,214 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Value} Value * @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) { + Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies a Value message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @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) { + Value.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]); + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); if (error) - return "uninterpretedOption." + error; + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + 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. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Value} Value */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) 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]); - } + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); } - 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. + * Creates a plain object from a Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.Value} message Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + Value.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.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; } - 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.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; } - 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. + * Converts this Value to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ServiceOptions; + return Value; })(); - protobuf.MethodOptions = (function() { + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {string} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { /** - * Properties of a MethodOptions. + * Properties of a ListValue. * @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 + * @interface IListValue + * @property {Array.|null} [values] ListValue values */ /** - * Constructs a new MethodOptions. + * Constructs a new ListValue. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents a ListValue. + * @implements IListValue * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IListValue=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function ListValue(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26662,146 +31115,78 @@ } /** - * 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 + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + ListValue.prototype.values = $util.emptyArray; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new ListValue instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + ListValue.create = function create(properties) { + return new ListValue(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + ListValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 && message.hasOwnProperty(".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + ListValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @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 + * @returns {google.protobuf.ListValue} ListValue * @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) { + ListValue.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); 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()); + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -26812,387 +31197,214 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.ListValue} ListValue * @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) { + ListValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies a ListValue message. * @function verify - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @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) { + ListValue.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 (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); if (error) - return "uninterpretedOption." + error; + return "values." + 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. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.ListValue} ListValue */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) 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]); + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[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. + * Creates a plain object from a ListValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.ListValue} message ListValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + ListValue.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 (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); } - 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 {string} - * @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 + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue * @instance + * @returns {Object.} JSON object */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + protobuf.Duration = (function() { /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - UninterpretedOption.prototype.doubleValue = 0; + 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]]; + } /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; + Duration.prototype.nanos = 0; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + Duration.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 && message.hasOwnProperty("identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @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.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decode = function decode(reader, length) { + 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.UninterpretedOption(); + 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 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(); + case 1: + message.seconds = reader.int64(); break; - case 8: - message.aggregateValue = reader.string(); + case 2: + message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); @@ -27203,422 +31415,131 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @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 */ - UninterpretedOption.verify = function verify(message) { + Duration.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"; + 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 an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.Duration} Duration */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) 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) + var message = new $root.google.protobuf.Duration(); + if (object.seconds != 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; - }; + (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; + }; - /** - * 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); - }; + /** + * 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; + }; - return NamePart; - })(); + /** + * 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 UninterpretedOption; + return Duration; })(); - protobuf.SourceCodeInfo = (function() { + protobuf.FieldMask = (function() { /** - * Properties of a SourceCodeInfo. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new SourceCodeInfo. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27626,78 +31547,78 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + FieldMask.prototype.paths = $util.emptyArray; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + FieldMask.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(); + 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 SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @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.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decode = function decode(reader, length) { + 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.SourceCodeInfo(); + 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.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -27708,128 +31629,143 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @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 */ - SourceCodeInfo.verify = function verify(message) { + FieldMask.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; - } + 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.FieldMask} FieldMask */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) 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]); - } + 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 SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + FieldMask.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); + 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 SourceCodeInfo to JSON. + * Converts this FieldMask to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - SourceCodeInfo.Location = (function() { + return FieldMask; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (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 + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Uint8Array|null} [etag] Policy etag */ /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @param {google.iam.v1.IPolicy=} [properties] Properties to set */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; + function Policy(properties) { + this.bindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27837,152 +31773,104 @@ } /** - * 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 + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy * @instance */ - Location.prototype.leadingComments = ""; + Policy.prototype.version = 0; /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy * @instance */ - Location.prototype.trailingComments = ""; + Policy.prototype.bindings = $util.emptyArray; /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy * @instance */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + Policy.prototype.etag = $util.newBuffer([]); /** - * Creates a new Location instance using the specified properties. + * Creates a new Policy instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance */ - Location.create = function create(properties) { - return new Location(properties); + Policy.create = function create(properties) { + return new Policy(properties); }; /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + Policy.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 && message.hasOwnProperty("leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("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]); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encodeDelimited = function encodeDelimited(message, writer) { + Policy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes a Policy message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @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 + * @returns {google.iam.v1.Policy} Policy * @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) { + Policy.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); 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(); + message.version = reader.int32(); break; case 4: - message.trailingComments = reader.string(); + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); + case 3: + message.etag = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -27993,390 +31881,154 @@ }; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a Policy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.iam.v1.Policy} Policy * @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) { + Policy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Location message. + * Verifies a Policy message. * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @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) { + Policy.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"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; return null; }; /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates a Policy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.iam.v1.Policy} Policy */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) 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]); + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; return message; }; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. + * Creates a plain object from a Policy message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {google.iam.v1.Policy} message Policy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options) { + Policy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } + if (options.arrays || options.defaults) + object.bindings = []; 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]; + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } } - 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]; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); } return object; }; /** - * Converts this Location to JSON. + * Converts this Policy to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.iam.v1.Policy * @instance * @returns {Object.} JSON object */ - Location.prototype.toJSON = function toJSON() { + Policy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Location; + return Policy; })(); - 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() { + v1.Binding = (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 + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition */ /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @param {google.iam.v1.IBinding=} [properties] Properties to set */ - function Annotation(properties) { - this.path = []; + function Binding(properties) { + this.members = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28384,125 +32036,104 @@ } /** - * 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 + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding * @instance */ - Annotation.prototype.sourceFile = ""; + Binding.prototype.role = ""; /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding * @instance */ - Annotation.prototype.begin = 0; + Binding.prototype.members = $util.emptyArray; /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding * @instance */ - Annotation.prototype.end = 0; + Binding.prototype.condition = null; /** - * Creates a new Annotation instance using the specified properties. + * Creates a new Binding instance using the specified properties. * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance */ - Annotation.create = function create(properties) { - return new Annotation(properties); + Binding.create = function create(properties) { + return new Binding(properties); }; /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Annotation.encode = function encode(message, writer) { + Binding.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 && message.hasOwnProperty("sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { + Binding.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Annotation message from the specified reader or buffer. + * Decodes a Binding message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @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 + * @returns {google.iam.v1.Binding} Binding * @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) { + Binding.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); 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()); + message.role = reader.string(); break; case 2: - message.sourceFile = reader.string(); + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); break; case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -28513,1168 +32144,993 @@ }; /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. + * Decodes a Binding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @returns {google.iam.v1.Binding} Binding * @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) { + Binding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Annotation message. + * Verifies a Binding message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @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) { + Binding.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.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; } - 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. + * Creates a Binding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @returns {google.iam.v1.Binding} Binding */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) 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; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); } - 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. + * Creates a plain object from a Binding message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {google.iam.v1.Binding} message Binding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Annotation.toObject = function toObject(message, options) { + Binding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.path = []; + object.members = []; if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; + object.role = ""; + object.condition = null; } - 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.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[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; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; /** - * Converts this Annotation to JSON. + * Converts this Binding to JSON. * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.iam.v1.Binding * @instance * @returns {Object.} JSON object */ - Annotation.prototype.toJSON = function toJSON() { + Binding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Annotation; + return Binding; })(); - 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 && message.hasOwnProperty("type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && message.hasOwnProperty("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; - }; + v1.PolicyDelta = (function() { - /** - * 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; - }; + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ - /** - * 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); - } + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; } - 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.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - 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]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && message.hasOwnProperty("fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.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.Struct(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - reader.skip().pos++; - if (message.fields === $util.emptyObject) - message.fields = {}; - key = reader.string(); - reader.pos++; - message.fields[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; - return Struct; - })(); + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; - protobuf.Value = (function() { + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(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 PolicyDelta; + })(); - /** - * Value nullValue. - * @member {google.protobuf.NullValue} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = 0; + v1.BindingDelta = (function() { - /** - * Value numberValue. - * @member {number} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = 0; + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ - /** - * Value stringValue. - * @member {string} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = ""; + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } - /** - * Value boolValue. - * @member {boolean} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = false; + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && message.hasOwnProperty("member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && message.hasOwnProperty("nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && message.hasOwnProperty("numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && message.hasOwnProperty("boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && message.hasOwnProperty("structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && message.hasOwnProperty("listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + case 4: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.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.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nullValue = reader.int32(); - break; - case 2: - message.numberValue = reader.double(); - break; - case 3: - message.stringValue = reader.string(); - break; - case 4: - message.boolValue = reader.bool(); - break; - case 5: - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 6: - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return null; + }; - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; break; } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); } - } - return null; - }; + return message; + }; - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; + }; - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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 object; - }; - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; - return Value; - })(); + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {string} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; - protobuf.ListValue = (function() { + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - 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 AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && message.hasOwnProperty("logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.service = reader.string(); + break; + case 3: + message.exemptedMember = reader.string(); + break; + case 4: + message.logType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.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.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + message.action = 1; break; - default: - reader.skipType(tag & 7); + case "REMOVE": + case 2: + message.action = 2; break; } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; + }; - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); - return ListValue; + return AuditConfigDelta; + })(); + + return v1; })(); - protobuf.Timestamp = (function() { + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location */ /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.type.IExpr=} [properties] Properties to set */ - function Timestamp(properties) { + function Expr(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29682,312 +33138,114 @@ } /** - * 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 + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr * @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 && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("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; - }; + Expr.prototype.expression = ""; /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp + * Expr title. + * @member {string} title + * @memberof google.type.Expr * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - 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]]; - } + Expr.prototype.title = ""; /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration + * Expr description. + * @member {string} description + * @memberof google.type.Expr * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Expr.prototype.description = ""; /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration + * Expr location. + * @member {string} location + * @memberof google.type.Expr * @instance */ - Duration.prototype.nanos = 0; + Expr.prototype.location = ""; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Expr instance using the specified properties. * @function create - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance */ - Duration.create = function create(properties) { - return new Duration(properties); + Expr.create = function create(properties) { + return new Expr(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.type.IExpr} message Expr message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + Expr.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + if (message.expression != null && message.hasOwnProperty("expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); return writer; }; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.type.IExpr} message Expr message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + Expr.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes an Expr message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @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 + * @returns {google.type.Expr} Expr * @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) { + Expr.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.seconds = reader.int64(); + message.expression = reader.string(); break; case 2: - message.nanos = reader.int32(); + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); break; default: reader.skipType(tag & 7); @@ -29998,2116 +33256,3351 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes an Expr message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @returns {google.type.Expr} Expr * @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) { + Expr.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies an Expr message. * @function verify - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @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) { + Expr.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"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; return null; }; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates an Expr message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.type.Expr * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.type.Expr} Expr */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) 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; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); 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; - }; + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + return type; + })(); + + google.identity = (function() { + + /** + * Namespace identity. + * @memberof google + * @namespace + */ + var identity = {}; + + identity.accesscontextmanager = (function() { + + /** + * Namespace accesscontextmanager. + * @memberof google.identity + * @namespace + */ + var accesscontextmanager = {}; + + accesscontextmanager.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var v1 = {}; + + v1.AccessLevel = (function() { + + /** + * Properties of an AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessLevel + * @property {string|null} [name] AccessLevel name + * @property {string|null} [title] AccessLevel title + * @property {string|null} [description] AccessLevel description + * @property {google.identity.accesscontextmanager.v1.IBasicLevel|null} [basic] AccessLevel basic + * @property {google.identity.accesscontextmanager.v1.ICustomLevel|null} [custom] AccessLevel custom + * @property {google.protobuf.ITimestamp|null} [createTime] AccessLevel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessLevel updateTime + */ + + /** + * Constructs a new AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessLevel. + * @implements IAccessLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + */ + function AccessLevel(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]]; + } + + /** + * AccessLevel name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.name = ""; + + /** + * AccessLevel title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.title = ""; + + /** + * AccessLevel description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.description = ""; + + /** + * AccessLevel basic. + * @member {google.identity.accesscontextmanager.v1.IBasicLevel|null|undefined} basic + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.basic = null; + + /** + * AccessLevel custom. + * @member {google.identity.accesscontextmanager.v1.ICustomLevel|null|undefined} custom + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.custom = null; + + /** + * AccessLevel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.createTime = null; + + /** + * AccessLevel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessLevel level. + * @member {"basic"|"custom"|undefined} level + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + Object.defineProperty(AccessLevel.prototype, "level", { + get: $util.oneOfGetter($oneOfFields = ["basic", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel instance + */ + AccessLevel.create = function create(properties) { + return new AccessLevel(properties); + }; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.basic != null && message.hasOwnProperty("basic")) + $root.google.identity.accesscontextmanager.v1.BasicLevel.encode(message.basic, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.identity.accesscontextmanager.v1.CustomLevel.encode(message.custom, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.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.identity.accesscontextmanager.v1.AccessLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); + break; + case 5: + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); + break; + case 6: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessLevel.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.basic != null && message.hasOwnProperty("basic")) { + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.BasicLevel.verify(message.basic); + if (error) + return "basic." + error; + } + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.level === 1) + return "level: multiple values"; + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.CustomLevel.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an AccessLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + */ + AccessLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessLevel(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.basic != null) { + if (typeof object.basic !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.basic: object expected"); + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.fromObject(object.basic); + } + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.custom: object expected"); + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.fromObject(object.custom); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.AccessLevel} message AccessLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.basic != null && message.hasOwnProperty("basic")) { + object.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.toObject(message.basic, options); + if (options.oneofs) + object.level = "basic"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.toObject(message.custom, options); + if (options.oneofs) + object.level = "custom"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this AccessLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + * @returns {Object.} JSON object + */ + AccessLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessLevel; + })(); + + v1.BasicLevel = (function() { + + /** + * Properties of a BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IBasicLevel + * @property {Array.|null} [conditions] BasicLevel conditions + * @property {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null} [combiningFunction] BasicLevel combiningFunction + */ + + /** + * Constructs a new BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a BasicLevel. + * @implements IBasicLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + */ + function BasicLevel(properties) { + this.conditions = []; + 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]]; + } + + /** + * BasicLevel conditions. + * @member {Array.} conditions + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.conditions = $util.emptyArray; + + /** + * BasicLevel combiningFunction. + * @member {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction} combiningFunction + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.combiningFunction = 0; + + /** + * Creates a new BasicLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel instance + */ + BasicLevel.create = function create(properties) { + return new BasicLevel(properties); + }; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.identity.accesscontextmanager.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.combiningFunction); + return writer; + }; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.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.identity.accesscontextmanager.v1.BasicLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); + break; + case 2: + message.combiningFunction = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + switch (message.combiningFunction) { + default: + return "combiningFunction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BasicLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + */ + BasicLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.BasicLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.BasicLevel(); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: object expected"); + message.conditions[i] = $root.google.identity.accesscontextmanager.v1.Condition.fromObject(object.conditions[i]); + } + } + switch (object.combiningFunction) { + case "AND": + case 0: + message.combiningFunction = 0; + break; + case "OR": + case 1: + message.combiningFunction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.BasicLevel} message BasicLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.defaults) + object.combiningFunction = options.enums === String ? "AND" : 0; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.identity.accesscontextmanager.v1.Condition.toObject(message.conditions[j], options); + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; + return object; + }; + + /** + * Converts this BasicLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + * @returns {Object.} JSON object + */ + BasicLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + /** + * ConditionCombiningFunction enum. + * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + * @enum {string} + * @property {number} AND=0 AND value + * @property {number} OR=1 OR value + */ + BasicLevel.ConditionCombiningFunction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AND"] = 0; + values[valuesById[1] = "OR"] = 1; + return values; + })(); - return Duration; - })(); + return BasicLevel; + })(); - protobuf.Empty = (function() { + v1.Condition = (function() { - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ + /** + * Properties of a Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICondition + * @property {Array.|null} [ipSubnetworks] Condition ipSubnetworks + * @property {google.identity.accesscontextmanager.v1.IDevicePolicy|null} [devicePolicy] Condition devicePolicy + * @property {Array.|null} [requiredAccessLevels] Condition requiredAccessLevels + * @property {boolean|null} [negate] Condition negate + * @property {Array.|null} [members] Condition members + * @property {Array.|null} [regions] Condition regions + */ - /** - * 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]]; - } + /** + * Constructs a new Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.ipSubnetworks = []; + this.requiredAccessLevels = []; + this.members = []; + this.regions = []; + 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); - }; + /** + * Condition ipSubnetworks. + * @member {Array.} ipSubnetworks + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.ipSubnetworks = $util.emptyArray; - /** - * 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; - }; + /** + * Condition devicePolicy. + * @member {google.identity.accesscontextmanager.v1.IDevicePolicy|null|undefined} devicePolicy + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.devicePolicy = null; - /** - * 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(); - }; + /** + * Condition requiredAccessLevels. + * @member {Array.} requiredAccessLevels + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.requiredAccessLevels = $util.emptyArray; - /** - * 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; - }; + /** + * Condition negate. + * @member {boolean} negate + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.negate = false; - /** - * 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()); - }; + /** + * Condition members. + * @member {Array.} members + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.members = $util.emptyArray; - /** - * 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; - }; + /** + * Condition regions. + * @member {Array.} regions + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.regions = $util.emptyArray; - /** - * 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 new Condition instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; - /** - * 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 {}; - }; + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipSubnetworks != null && message.ipSubnetworks.length) + for (var i = 0; i < message.ipSubnetworks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipSubnetworks[i]); + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + $root.google.identity.accesscontextmanager.v1.DevicePolicy.encode(message.devicePolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requiredAccessLevels != null && message.requiredAccessLevels.length) + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requiredAccessLevels[i]); + if (message.negate != null && message.hasOwnProperty("negate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.negate); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.members[i]); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.regions[i]); + return writer; + }; - /** - * 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); - }; + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return Empty; - })(); + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.identity.accesscontextmanager.v1.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipSubnetworks && message.ipSubnetworks.length)) + message.ipSubnetworks = []; + message.ipSubnetworks.push(reader.string()); + break; + case 2: + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) + message.requiredAccessLevels = []; + message.requiredAccessLevels.push(reader.string()); + break; + case 5: + message.negate = reader.bool(); + break; + case 6: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 7: + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - protobuf.FieldMask = (function() { + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ + /** + * Verifies a Condition message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipSubnetworks != null && message.hasOwnProperty("ipSubnetworks")) { + if (!Array.isArray(message.ipSubnetworks)) + return "ipSubnetworks: array expected"; + for (var i = 0; i < message.ipSubnetworks.length; ++i) + if (!$util.isString(message.ipSubnetworks[i])) + return "ipSubnetworks: string[] expected"; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) { + var error = $root.google.identity.accesscontextmanager.v1.DevicePolicy.verify(message.devicePolicy); + if (error) + return "devicePolicy." + error; + } + if (message.requiredAccessLevels != null && message.hasOwnProperty("requiredAccessLevels")) { + if (!Array.isArray(message.requiredAccessLevels)) + return "requiredAccessLevels: array expected"; + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + if (!$util.isString(message.requiredAccessLevels[i])) + return "requiredAccessLevels: string[] expected"; + } + if (message.negate != null && message.hasOwnProperty("negate")) + if (typeof message.negate !== "boolean") + return "negate: boolean expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) + if (!$util.isString(message.regions[i])) + return "regions: string[] expected"; + } + return null; + }; - /** - * 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]]; - } + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.Condition) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.Condition(); + if (object.ipSubnetworks) { + if (!Array.isArray(object.ipSubnetworks)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.ipSubnetworks: array expected"); + message.ipSubnetworks = []; + for (var i = 0; i < object.ipSubnetworks.length; ++i) + message.ipSubnetworks[i] = String(object.ipSubnetworks[i]); + } + if (object.devicePolicy != null) { + if (typeof object.devicePolicy !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.devicePolicy: object expected"); + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.fromObject(object.devicePolicy); + } + if (object.requiredAccessLevels) { + if (!Array.isArray(object.requiredAccessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.requiredAccessLevels: array expected"); + message.requiredAccessLevels = []; + for (var i = 0; i < object.requiredAccessLevels.length; ++i) + message.requiredAccessLevels[i] = String(object.requiredAccessLevels[i]); + } + if (object.negate != null) + message.negate = Boolean(object.negate); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) + message.regions[i] = String(object.regions[i]); + } + return message; + }; - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipSubnetworks = []; + object.requiredAccessLevels = []; + object.members = []; + object.regions = []; + } + if (options.defaults) { + object.devicePolicy = null; + object.negate = false; + } + if (message.ipSubnetworks && message.ipSubnetworks.length) { + object.ipSubnetworks = []; + for (var j = 0; j < message.ipSubnetworks.length; ++j) + object.ipSubnetworks[j] = message.ipSubnetworks[j]; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + object.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.toObject(message.devicePolicy, options); + if (message.requiredAccessLevels && message.requiredAccessLevels.length) { + object.requiredAccessLevels = []; + for (var j = 0; j < message.requiredAccessLevels.length; ++j) + object.requiredAccessLevels[j] = message.requiredAccessLevels[j]; + } + if (message.negate != null && message.hasOwnProperty("negate")) + object.negate = message.negate; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = message.regions[j]; + } + return object; + }; - /** - * 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); - }; + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return Condition; + })(); - /** - * 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(); - }; + v1.CustomLevel = (function() { - /** - * 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; + /** + * Properties of a CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICustomLevel + * @property {google.type.IExpr|null} [expr] CustomLevel expr + */ + + /** + * Constructs a new CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a CustomLevel. + * @implements ICustomLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + */ + function CustomLevel(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 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()); - }; + /** + * CustomLevel expr. + * @member {google.type.IExpr|null|undefined} expr + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + */ + CustomLevel.prototype.expr = null; - /** - * 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 new CustomLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel instance + */ + CustomLevel.create = function create(properties) { + return new CustomLevel(properties); + }; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expr != null && message.hasOwnProperty("expr")) + $root.google.type.Expr.encode(message.expr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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; - }; + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.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.identity.accesscontextmanager.v1.CustomLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + 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; - }; + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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); - }; + /** + * Verifies a CustomLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.google.type.Expr.verify(message.expr); + if (error) + return "expr." + error; + } + return null; + }; - return FieldMask; - })(); + /** + * Creates a CustomLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + */ + CustomLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.CustomLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.CustomLevel(); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.CustomLevel.expr: object expected"); + message.expr = $root.google.type.Expr.fromObject(object.expr); + } + return message; + }; - return protobuf; - })(); + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.CustomLevel} message CustomLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expr = null; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.google.type.Expr.toObject(message.expr, options); + return object; + }; - google.iam = (function() { + /** + * Converts this CustomLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + * @returns {Object.} JSON object + */ + CustomLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; + return CustomLevel; + })(); - iam.v1 = (function() { + v1.DevicePolicy = (function() { - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; + /** + * Properties of a DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IDevicePolicy + * @property {boolean|null} [requireScreenlock] DevicePolicy requireScreenlock + * @property {Array.|null} [allowedEncryptionStatuses] DevicePolicy allowedEncryptionStatuses + * @property {Array.|null} [osConstraints] DevicePolicy osConstraints + * @property {Array.|null} [allowedDeviceManagementLevels] DevicePolicy allowedDeviceManagementLevels + * @property {boolean|null} [requireAdminApproval] DevicePolicy requireAdminApproval + * @property {boolean|null} [requireCorpOwned] DevicePolicy requireCorpOwned + */ - v1.Policy = (function() { + /** + * Constructs a new DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a DevicePolicy. + * @implements IDevicePolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + */ + function DevicePolicy(properties) { + this.allowedEncryptionStatuses = []; + this.osConstraints = []; + this.allowedDeviceManagementLevels = []; + 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 Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Uint8Array|null} [etag] Policy etag - */ + /** + * DevicePolicy requireScreenlock. + * @member {boolean} requireScreenlock + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireScreenlock = false; - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - 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]]; - } + /** + * DevicePolicy allowedEncryptionStatuses. + * @member {Array.} allowedEncryptionStatuses + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedEncryptionStatuses = $util.emptyArray; - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; + /** + * DevicePolicy osConstraints. + * @member {Array.} osConstraints + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.osConstraints = $util.emptyArray; - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; + /** + * DevicePolicy allowedDeviceManagementLevels. + * @member {Array.} allowedDeviceManagementLevels + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedDeviceManagementLevels = $util.emptyArray; - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); + /** + * DevicePolicy requireAdminApproval. + * @member {boolean} requireAdminApproval + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireAdminApproval = false; - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; + /** + * DevicePolicy requireCorpOwned. + * @member {boolean} requireCorpOwned + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireCorpOwned = false; - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && message.hasOwnProperty("etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Creates a new DevicePolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy instance + */ + DevicePolicy.create = function create(properties) { + return new DevicePolicy(properties); + }; - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireScreenlock); + if (message.allowedEncryptionStatuses != null && message.allowedEncryptionStatuses.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + writer.int32(message.allowedEncryptionStatuses[i]); + writer.ldelim(); + } + if (message.osConstraints != null && message.osConstraints.length) + for (var i = 0; i < message.osConstraints.length; ++i) + $root.google.identity.accesscontextmanager.v1.OsConstraint.encode(message.osConstraints[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowedDeviceManagementLevels != null && message.allowedDeviceManagementLevels.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + writer.int32(message.allowedDeviceManagementLevels[i]); + writer.ldelim(); + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requireAdminApproval); + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.requireCorpOwned); + return writer; + }; - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.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.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.int32(); - break; - case 4: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - case 3: - message.etag = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.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.identity.accesscontextmanager.v1.DevicePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requireScreenlock = reader.bool(); + break; + case 2: + if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) + message.allowedEncryptionStatuses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedEncryptionStatuses.push(reader.int32()); + } else + message.allowedEncryptionStatuses.push(reader.int32()); + break; + case 3: + if (!(message.osConstraints && message.osConstraints.length)) + message.osConstraints = []; + message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) + message.allowedDeviceManagementLevels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedDeviceManagementLevels.push(reader.int32()); + } else + message.allowedDeviceManagementLevels.push(reader.int32()); + break; + case 7: + message.requireAdminApproval = reader.bool(); + break; + case 8: + message.requireCorpOwned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; + /** + * Verifies a DevicePolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DevicePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + if (typeof message.requireScreenlock !== "boolean") + return "requireScreenlock: boolean expected"; + if (message.allowedEncryptionStatuses != null && message.hasOwnProperty("allowedEncryptionStatuses")) { + if (!Array.isArray(message.allowedEncryptionStatuses)) + return "allowedEncryptionStatuses: array expected"; + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + switch (message.allowedEncryptionStatuses[i]) { + default: + return "allowedEncryptionStatuses: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + if (message.osConstraints != null && message.hasOwnProperty("osConstraints")) { + if (!Array.isArray(message.osConstraints)) + return "osConstraints: array expected"; + for (var i = 0; i < message.osConstraints.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.OsConstraint.verify(message.osConstraints[i]); + if (error) + return "osConstraints." + error; + } } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) - message.etag = object.etag; - return message; - }; + if (message.allowedDeviceManagementLevels != null && message.hasOwnProperty("allowedDeviceManagementLevels")) { + if (!Array.isArray(message.allowedDeviceManagementLevels)) + return "allowedDeviceManagementLevels: array expected"; + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + switch (message.allowedDeviceManagementLevels[i]) { + default: + return "allowedDeviceManagementLevels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + if (typeof message.requireAdminApproval !== "boolean") + return "requireAdminApproval: boolean expected"; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + if (typeof message.requireCorpOwned !== "boolean") + return "requireCorpOwned: boolean expected"; + return null; + }; - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.bindings = []; - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); + /** + * Creates a DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + */ + DevicePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.DevicePolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.DevicePolicy(); + if (object.requireScreenlock != null) + message.requireScreenlock = Boolean(object.requireScreenlock); + if (object.allowedEncryptionStatuses) { + if (!Array.isArray(object.allowedEncryptionStatuses)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedEncryptionStatuses: array expected"); + message.allowedEncryptionStatuses = []; + for (var i = 0; i < object.allowedEncryptionStatuses.length; ++i) + switch (object.allowedEncryptionStatuses[i]) { + default: + case "ENCRYPTION_UNSPECIFIED": + case 0: + message.allowedEncryptionStatuses[i] = 0; + break; + case "ENCRYPTION_UNSUPPORTED": + case 1: + message.allowedEncryptionStatuses[i] = 1; + break; + case "UNENCRYPTED": + case 2: + message.allowedEncryptionStatuses[i] = 2; + break; + case "ENCRYPTED": + case 3: + message.allowedEncryptionStatuses[i] = 3; + break; + } + } + if (object.osConstraints) { + if (!Array.isArray(object.osConstraints)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: array expected"); + message.osConstraints = []; + for (var i = 0; i < object.osConstraints.length; ++i) { + if (typeof object.osConstraints[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: object expected"); + message.osConstraints[i] = $root.google.identity.accesscontextmanager.v1.OsConstraint.fromObject(object.osConstraints[i]); + } + } + if (object.allowedDeviceManagementLevels) { + if (!Array.isArray(object.allowedDeviceManagementLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedDeviceManagementLevels: array expected"); + message.allowedDeviceManagementLevels = []; + for (var i = 0; i < object.allowedDeviceManagementLevels.length; ++i) + switch (object.allowedDeviceManagementLevels[i]) { + default: + case "MANAGEMENT_UNSPECIFIED": + case 0: + message.allowedDeviceManagementLevels[i] = 0; + break; + case "NONE": + case 1: + message.allowedDeviceManagementLevels[i] = 1; + break; + case "BASIC": + case 2: + message.allowedDeviceManagementLevels[i] = 2; + break; + case "COMPLETE": + case 3: + message.allowedDeviceManagementLevels[i] = 3; + break; + } } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - return object; - }; + if (object.requireAdminApproval != null) + message.requireAdminApproval = Boolean(object.requireAdminApproval); + if (object.requireCorpOwned != null) + message.requireCorpOwned = Boolean(object.requireCorpOwned); + return message; + }; - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.DevicePolicy} message DevicePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DevicePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedEncryptionStatuses = []; + object.osConstraints = []; + object.allowedDeviceManagementLevels = []; + } + if (options.defaults) { + object.requireScreenlock = false; + object.requireAdminApproval = false; + object.requireCorpOwned = false; + } + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + object.requireScreenlock = message.requireScreenlock; + if (message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length) { + object.allowedEncryptionStatuses = []; + for (var j = 0; j < message.allowedEncryptionStatuses.length; ++j) + object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; + } + if (message.osConstraints && message.osConstraints.length) { + object.osConstraints = []; + for (var j = 0; j < message.osConstraints.length; ++j) + object.osConstraints[j] = $root.google.identity.accesscontextmanager.v1.OsConstraint.toObject(message.osConstraints[j], options); + } + if (message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length) { + object.allowedDeviceManagementLevels = []; + for (var j = 0; j < message.allowedDeviceManagementLevels.length; ++j) + object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + object.requireAdminApproval = message.requireAdminApproval; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + object.requireCorpOwned = message.requireCorpOwned; + return object; + }; - return Policy; - })(); + /** + * Converts this DevicePolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + * @returns {Object.} JSON object + */ + DevicePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.Binding = (function() { + return DevicePolicy; + })(); - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ + v1.OsConstraint = (function() { - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - 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 OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IOsConstraint + * @property {google.identity.accesscontextmanager.type.OsType|null} [osType] OsConstraint osType + * @property {string|null} [minimumVersion] OsConstraint minimumVersion + * @property {boolean|null} [requireVerifiedChromeOs] OsConstraint requireVerifiedChromeOs + */ - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; + /** + * Constructs a new OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an OsConstraint. + * @implements IOsConstraint + * @constructor + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + */ + function OsConstraint(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]]; + } - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; + /** + * OsConstraint osType. + * @member {google.identity.accesscontextmanager.type.OsType} osType + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.osType = 0; - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; + /** + * OsConstraint minimumVersion. + * @member {string} minimumVersion + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.minimumVersion = ""; - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; + /** + * OsConstraint requireVerifiedChromeOs. + * @member {boolean} requireVerifiedChromeOs + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.requireVerifiedChromeOs = false; - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && message.hasOwnProperty("role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && message.hasOwnProperty("condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates a new OsConstraint instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint instance + */ + OsConstraint.create = function create(properties) { + return new OsConstraint(properties); + }; - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osType != null && message.hasOwnProperty("osType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.osType); + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.minimumVersion); + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireVerifiedChromeOs); + return writer; + }; - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.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.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.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.identity.accesscontextmanager.v1.OsConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osType = reader.int32(); + break; + case 2: + message.minimumVersion = reader.string(); + break; + case 3: + message.requireVerifiedChromeOs = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsConstraint message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osType != null && message.hasOwnProperty("osType")) + switch (message.osType) { + default: + return "osType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 4: + case 5: + break; + } + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + if (!$util.isString(message.minimumVersion)) + return "minimumVersion: string expected"; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + if (typeof message.requireVerifiedChromeOs !== "boolean") + return "requireVerifiedChromeOs: boolean expected"; + return null; + }; + + /** + * Creates an OsConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + */ + OsConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.OsConstraint) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.OsConstraint(); + switch (object.osType) { + case "OS_UNSPECIFIED": + case 0: + message.osType = 0; + break; + case "DESKTOP_MAC": case 1: - message.role = reader.string(); + message.osType = 1; break; + case "DESKTOP_WINDOWS": case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); + message.osType = 2; break; + case "DESKTOP_LINUX": case 3: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + message.osType = 3; break; - default: - reader.skipType(tag & 7); + case "DESKTOP_CHROME_OS": + case 6: + message.osType = 6; + break; + case "ANDROID": + case 4: + message.osType = 4; + break; + case "IOS": + case 5: + message.osType = 5; break; } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; + if (object.minimumVersion != null) + message.minimumVersion = String(object.minimumVersion); + if (object.requireVerifiedChromeOs != null) + message.requireVerifiedChromeOs = Boolean(object.requireVerifiedChromeOs); + return message; + }; - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.OsConstraint} message OsConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osType = options.enums === String ? "OS_UNSPECIFIED" : 0; + object.minimumVersion = ""; + object.requireVerifiedChromeOs = false; + } + if (message.osType != null && message.hasOwnProperty("osType")) + object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + object.minimumVersion = message.minimumVersion; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + object.requireVerifiedChromeOs = message.requireVerifiedChromeOs; return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; + }; - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; + /** + * Converts this OsConstraint to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + * @returns {Object.} JSON object + */ + OsConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return OsConstraint; + })(); - return Binding; - })(); + v1.AccessPolicy = (function() { - v1.PolicyDelta = (function() { + /** + * Properties of an AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessPolicy + * @property {string|null} [name] AccessPolicy name + * @property {string|null} [parent] AccessPolicy parent + * @property {string|null} [title] AccessPolicy title + * @property {google.protobuf.ITimestamp|null} [createTime] AccessPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessPolicy updateTime + * @property {string|null} [etag] AccessPolicy etag + */ - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ + /** + * Constructs a new AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessPolicy. + * @implements IAccessPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + */ + function AccessPolicy(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]]; + } - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - 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]]; - } + /** + * AccessPolicy name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.name = ""; - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + /** + * AccessPolicy parent. + * @member {string} parent + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.parent = ""; - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + /** + * AccessPolicy title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.title = ""; - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; + /** + * AccessPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.createTime = null; - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * AccessPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.updateTime = null; - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * AccessPolicy etag. + * @member {string} etag + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.etag = ""; - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.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.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a new AccessPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy instance + */ + AccessPolicy.create = function create(properties) { + return new AccessPolicy(properties); + }; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + return writer; + }; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.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.identity.accesscontextmanager.v1.AccessPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parent = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.etag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + /** + * Verifies an AccessPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessPolicy.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "bindingDeltas." + error; + return "createTime." + error; } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) - return "auditConfigDeltas." + error; + return "updateTime." + error; } - } - return null; - }; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + /** + * Creates an AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + */ + AccessPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.title != null) + message.title = String(object.title); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.AccessPolicy} message AccessPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.title = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; } - } - return message; - }; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + /** + * Converts this AccessPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + * @returns {Object.} JSON object + */ + AccessPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessPolicy; + })(); + + v1.ServicePerimeter = (function() { + + /** + * Properties of a ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeter + * @property {string|null} [name] ServicePerimeter name + * @property {string|null} [title] ServicePerimeter title + * @property {string|null} [description] ServicePerimeter description + * @property {google.protobuf.ITimestamp|null} [createTime] ServicePerimeter createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServicePerimeter updateTime + * @property {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null} [perimeterType] ServicePerimeter perimeterType + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [status] ServicePerimeter status + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [spec] ServicePerimeter spec + * @property {boolean|null} [useExplicitDryRunSpec] ServicePerimeter useExplicitDryRunSpec + */ + + /** + * Constructs a new ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeter. + * @implements IServicePerimeter + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + */ + function ServicePerimeter(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 object; - }; - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ServicePerimeter name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.name = ""; - return PolicyDelta; - })(); + /** + * ServicePerimeter title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.title = ""; - v1.BindingDelta = (function() { + /** + * ServicePerimeter description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.description = ""; - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ + /** + * ServicePerimeter createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.createTime = null; - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(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]]; - } + /** + * ServicePerimeter updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.updateTime = null; - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; + /** + * ServicePerimeter perimeterType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType} perimeterType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.perimeterType = 0; - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; + /** + * ServicePerimeter status. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} status + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.status = null; - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; + /** + * ServicePerimeter spec. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} spec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.spec = null; - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; + /** + * ServicePerimeter useExplicitDryRunSpec. + * @member {boolean} useExplicitDryRunSpec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.useExplicitDryRunSpec = false; - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter instance + */ + ServicePerimeter.create = function create(properties) { + return new ServicePerimeter(properties); + }; - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && message.hasOwnProperty("role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && message.hasOwnProperty("member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && message.hasOwnProperty("condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.perimeterType); + if (message.status != null && message.hasOwnProperty("status")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.spec != null && message.hasOwnProperty("spec")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.spec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useExplicitDryRunSpec); + return writer; + }; - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.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.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - case 4: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.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.identity.accesscontextmanager.v1.ServicePerimeter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.perimeterType = reader.int32(); + break; + case 7: + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + case 8: + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + case 9: + message.useExplicitDryRunSpec = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; + /** + * Verifies a ServicePerimeter message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeter.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + switch (message.perimeterType) { + default: + return "perimeterType: enum value expected"; + case 0: + case 1: + break; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.status); + if (error) + return "status." + error; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + if (typeof message.useExplicitDryRunSpec !== "boolean") + return "useExplicitDryRunSpec: boolean expected"; + return null; + }; + + /** + * Creates a ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + */ + ServicePerimeter.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeter) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeter(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.perimeterType) { + case "PERIMETER_TYPE_REGULAR": case 0: + message.perimeterType = 0; + break; + case "PERIMETER_TYPE_BRIDGE": case 1: - case 2: + message.perimeterType = 1; break; } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.status: object expected"); + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.status); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.spec: object expected"); + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.spec); + } + if (object.useExplicitDryRunSpec != null) + message.useExplicitDryRunSpec = Boolean(object.useExplicitDryRunSpec); + return message; + }; - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeter} message ServicePerimeter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.perimeterType = options.enums === String ? "PERIMETER_TYPE_REGULAR" : 0; + object.status = null; + object.spec = null; + object.useExplicitDryRunSpec = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.status, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.spec, options); + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + object.useExplicitDryRunSpec = message.useExplicitDryRunSpec; return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; + }; - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; + /** + * Converts this ServicePerimeter to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * PerimeterType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + * @enum {string} + * @property {number} PERIMETER_TYPE_REGULAR=0 PERIMETER_TYPE_REGULAR value + * @property {number} PERIMETER_TYPE_BRIDGE=1 PERIMETER_TYPE_BRIDGE value + */ + ServicePerimeter.PerimeterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIMETER_TYPE_REGULAR"] = 0; + values[valuesById[1] = "PERIMETER_TYPE_BRIDGE"] = 1; + return values; + })(); - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {string} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; + return ServicePerimeter; })(); - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { + v1.ServicePerimeterConfig = (function() { - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ + /** + * Properties of a ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeterConfig + * @property {Array.|null} [resources] ServicePerimeterConfig resources + * @property {Array.|null} [accessLevels] ServicePerimeterConfig accessLevels + * @property {Array.|null} [restrictedServices] ServicePerimeterConfig restrictedServices + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null} [vpcAccessibleServices] ServicePerimeterConfig vpcAccessibleServices + */ - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(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]]; - } + /** + * Constructs a new ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeterConfig. + * @implements IServicePerimeterConfig + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + */ + function ServicePerimeterConfig(properties) { + this.resources = []; + this.accessLevels = []; + this.restrictedServices = []; + 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]]; + } - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; + /** + * ServicePerimeterConfig resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.resources = $util.emptyArray; - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; + /** + * ServicePerimeterConfig accessLevels. + * @member {Array.} accessLevels + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.accessLevels = $util.emptyArray; - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; + /** + * ServicePerimeterConfig restrictedServices. + * @member {Array.} restrictedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.restrictedServices = $util.emptyArray; - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; + /** + * ServicePerimeterConfig vpcAccessibleServices. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null|undefined} vpcAccessibleServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.vpcAccessibleServices = null; - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig instance + */ + ServicePerimeterConfig.create = function create(properties) { + return new ServicePerimeterConfig(properties); + }; - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && message.hasOwnProperty("service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && message.hasOwnProperty("logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.accessLevels != null && message.accessLevels.length) + for (var i = 0; i < message.accessLevels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessLevels[i]); + if (message.restrictedServices != null && message.restrictedServices.length) + for (var i = 0; i < message.restrictedServices.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.restrictedServices[i]); + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.encode(message.vpcAccessibleServices, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.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.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.service = reader.string(); - break; - case 3: - message.exemptedMember = reader.string(); - break; - case 4: - message.logType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.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.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + case 2: + if (!(message.accessLevels && message.accessLevels.length)) + message.accessLevels = []; + message.accessLevels.push(reader.string()); + break; + case 4: + if (!(message.restrictedServices && message.restrictedServices.length)) + message.restrictedServices = []; + message.restrictedServices.push(reader.string()); + break; + case 10: + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; + /** + * Verifies a ServicePerimeterConfig message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.accessLevels != null && message.hasOwnProperty("accessLevels")) { + if (!Array.isArray(message.accessLevels)) + return "accessLevels: array expected"; + for (var i = 0; i < message.accessLevels.length; ++i) + if (!$util.isString(message.accessLevels[i])) + return "accessLevels: string[] expected"; + } + if (message.restrictedServices != null && message.hasOwnProperty("restrictedServices")) { + if (!Array.isArray(message.restrictedServices)) + return "restrictedServices: array expected"; + for (var i = 0; i < message.restrictedServices.length; ++i) + if (!$util.isString(message.restrictedServices[i])) + return "restrictedServices: string[] expected"; + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify(message.vpcAccessibleServices); + if (error) + return "vpcAccessibleServices." + error; + } + return null; + }; + + /** + * Creates a ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + */ + ServicePerimeterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.accessLevels) { + if (!Array.isArray(object.accessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.accessLevels: array expected"); + message.accessLevels = []; + for (var i = 0; i < object.accessLevels.length; ++i) + message.accessLevels[i] = String(object.accessLevels[i]); + } + if (object.restrictedServices) { + if (!Array.isArray(object.restrictedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.restrictedServices: array expected"); + message.restrictedServices = []; + for (var i = 0; i < object.restrictedServices.length; ++i) + message.restrictedServices[i] = String(object.restrictedServices[i]); + } + if (object.vpcAccessibleServices != null) { + if (typeof object.vpcAccessibleServices !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.vpcAccessibleServices: object expected"); + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.fromObject(object.vpcAccessibleServices); } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; + return message; + }; - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} message ServicePerimeterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accessLevels = []; + object.restrictedServices = []; + } + if (options.defaults) + object.vpcAccessibleServices = null; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.accessLevels && message.accessLevels.length) { + object.accessLevels = []; + for (var j = 0; j < message.accessLevels.length; ++j) + object.accessLevels[j] = message.accessLevels[j]; + } + if (message.restrictedServices && message.restrictedServices.length) { + object.restrictedServices = []; + for (var j = 0; j < message.restrictedServices.length; ++j) + object.restrictedServices[j] = message.restrictedServices[j]; + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + object.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.toObject(message.vpcAccessibleServices, options); return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; + }; - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; + /** + * Converts this ServicePerimeterConfig to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + ServicePerimeterConfig.VpcAccessibleServices = (function() { - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {string} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); + /** + * Properties of a VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IVpcAccessibleServices + * @property {boolean|null} [enableRestriction] VpcAccessibleServices enableRestriction + * @property {Array.|null} [allowedServices] VpcAccessibleServices allowedServices + */ - return AuditConfigDelta; - })(); + /** + * Constructs a new VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a VpcAccessibleServices. + * @implements IVpcAccessibleServices + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + */ + function VpcAccessibleServices(properties) { + this.allowedServices = []; + 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 v1; - })(); + /** + * VpcAccessibleServices enableRestriction. + * @member {boolean} enableRestriction + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.enableRestriction = false; - return iam; - })(); + /** + * VpcAccessibleServices allowedServices. + * @member {Array.} allowedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.allowedServices = $util.emptyArray; - google.type = (function() { + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices instance + */ + VpcAccessibleServices.create = function create(properties) { + return new VpcAccessibleServices(properties); + }; - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRestriction); + if (message.allowedServices != null && message.allowedServices.length) + for (var i = 0; i < message.allowedServices.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedServices[i]); + return writer; + }; - type.Expr = (function() { + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableRestriction = reader.bool(); + break; + case 2: + if (!(message.allowedServices && message.allowedServices.length)) + message.allowedServices = []; + message.allowedServices.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(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 VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; + /** + * Verifies a VpcAccessibleServices message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccessibleServices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + if (typeof message.enableRestriction !== "boolean") + return "enableRestriction: boolean expected"; + if (message.allowedServices != null && message.hasOwnProperty("allowedServices")) { + if (!Array.isArray(message.allowedServices)) + return "allowedServices: array expected"; + for (var i = 0; i < message.allowedServices.length; ++i) + if (!$util.isString(message.allowedServices[i])) + return "allowedServices: string[] expected"; + } + return null; + }; - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; + /** + * Creates a VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + */ + VpcAccessibleServices.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + if (object.enableRestriction != null) + message.enableRestriction = Boolean(object.enableRestriction); + if (object.allowedServices) { + if (!Array.isArray(object.allowedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.allowedServices: array expected"); + message.allowedServices = []; + for (var i = 0; i < object.allowedServices.length; ++i) + message.allowedServices[i] = String(object.allowedServices[i]); + } + return message; + }; - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} message VpcAccessibleServices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccessibleServices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedServices = []; + if (options.defaults) + object.enableRestriction = false; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + object.enableRestriction = message.enableRestriction; + if (message.allowedServices && message.allowedServices.length) { + object.allowedServices = []; + for (var j = 0; j < message.allowedServices.length; ++j) + object.allowedServices[j] = message.allowedServices[j]; + } + return object; + }; - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; + /** + * Converts this VpcAccessibleServices to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + * @returns {Object.} JSON object + */ + VpcAccessibleServices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; + return VpcAccessibleServices; + })(); - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && message.hasOwnProperty("expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && message.hasOwnProperty("title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && message.hasOwnProperty("location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; + return ServicePerimeterConfig; + })(); - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return v1; + })(); - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.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.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + accesscontextmanager.type = (function() { - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Namespace type. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var type = {}; - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; + /** + * DeviceEncryptionStatus enum. + * @name google.identity.accesscontextmanager.type.DeviceEncryptionStatus + * @enum {string} + * @property {number} ENCRYPTION_UNSPECIFIED=0 ENCRYPTION_UNSPECIFIED value + * @property {number} ENCRYPTION_UNSUPPORTED=1 ENCRYPTION_UNSUPPORTED value + * @property {number} UNENCRYPTED=2 UNENCRYPTED value + * @property {number} ENCRYPTED=3 ENCRYPTED value + */ + type.DeviceEncryptionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCRYPTION_UNSUPPORTED"] = 1; + values[valuesById[2] = "UNENCRYPTED"] = 2; + values[valuesById[3] = "ENCRYPTED"] = 3; + return values; + })(); - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; + /** + * OsType enum. + * @name google.identity.accesscontextmanager.type.OsType + * @enum {string} + * @property {number} OS_UNSPECIFIED=0 OS_UNSPECIFIED value + * @property {number} DESKTOP_MAC=1 DESKTOP_MAC value + * @property {number} DESKTOP_WINDOWS=2 DESKTOP_WINDOWS value + * @property {number} DESKTOP_LINUX=3 DESKTOP_LINUX value + * @property {number} DESKTOP_CHROME_OS=6 DESKTOP_CHROME_OS value + * @property {number} ANDROID=4 ANDROID value + * @property {number} IOS=5 IOS value + */ + type.OsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OS_UNSPECIFIED"] = 0; + values[valuesById[1] = "DESKTOP_MAC"] = 1; + values[valuesById[2] = "DESKTOP_WINDOWS"] = 2; + values[valuesById[3] = "DESKTOP_LINUX"] = 3; + values[valuesById[6] = "DESKTOP_CHROME_OS"] = 6; + values[valuesById[4] = "ANDROID"] = 4; + values[valuesById[5] = "IOS"] = 5; + return values; + })(); - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; + /** + * DeviceManagementLevel enum. + * @name google.identity.accesscontextmanager.type.DeviceManagementLevel + * @enum {string} + * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} BASIC=2 BASIC value + * @property {number} COMPLETE=3 COMPLETE value + */ + type.DeviceManagementLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return type; + })(); - return Expr; + return accesscontextmanager; })(); - return type; + return identity; })(); google.longrunning = (function() { diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 2728c4efb84..cd286ca591f 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -325,15 +325,6 @@ } } }, - "ContentType": { - "values": { - "CONTENT_TYPE_UNSPECIFIED": 0, - "RESOURCE": 1, - "IAM_POLICY": 2, - "ORG_POLICY": 4, - "ACCESS_POLICY": 5 - } - }, "FeedOutputConfig": { "oneofs": { "destination": { @@ -386,6 +377,15 @@ } } }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5 + } + }, "TemporalAsset": { "fields": { "window": { @@ -419,6 +419,15 @@ "(google.api.resource).type": "cloudasset.googleapis.com/Asset", "(google.api.resource).pattern": "*" }, + "oneofs": { + "accessContextPolicy": { + "oneof": [ + "accessPolicy", + "accessLevel", + "servicePerimeter" + ] + } + }, "fields": { "name": { "type": "string", @@ -436,6 +445,23 @@ "type": "google.iam.v1.Policy", "id": 4 }, + "orgPolicy": { + "rule": "repeated", + "type": "google.cloud.orgpolicy.v1.Policy", + "id": 6 + }, + "accessPolicy": { + "type": "google.identity.accesscontextmanager.v1.AccessPolicy", + "id": 7 + }, + "accessLevel": { + "type": "google.identity.accesscontextmanager.v1.AccessLevel", + "id": 8 + }, + "servicePerimeter": { + "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", + "id": 9 + }, "ancestors": { "rule": "repeated", "type": "string", @@ -1698,6 +1724,112 @@ } } } + }, + "orgpolicy": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OrgPolicy.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/orgpolicy/v1;orgpolicy", + "java_multiple_files": true, + "java_outer_classname": "OrgPolicyProto", + "java_package": "com.google.cloud.orgpolicy.v1", + "php_namespace": "Google\\Cloud\\OrgPolicy\\V1", + "ruby_package": "Google::Cloud::OrgPolicy::V1" + }, + "nested": { + "Policy": { + "oneofs": { + "policyType": { + "oneof": [ + "listPolicy", + "booleanPolicy", + "restoreDefault" + ] + } + }, + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "constraint": { + "type": "string", + "id": 2 + }, + "etag": { + "type": "bytes", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "listPolicy": { + "type": "ListPolicy", + "id": 5 + }, + "booleanPolicy": { + "type": "BooleanPolicy", + "id": 6 + }, + "restoreDefault": { + "type": "RestoreDefault", + "id": 7 + } + }, + "nested": { + "ListPolicy": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedValues": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "allValues": { + "type": "AllValues", + "id": 3 + }, + "suggestedValue": { + "type": "string", + "id": 4 + }, + "inheritFromParent": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AllValues": { + "values": { + "ALL_VALUES_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "BooleanPolicy": { + "fields": { + "enforced": { + "type": "bool", + "id": 1 + } + } + }, + "RestoreDefault": { + "fields": {} + } + } + } + } + } + } } } }, @@ -2789,6 +2921,21 @@ } } }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, "Any": { "fields": { "type_url": { @@ -2864,18 +3011,6 @@ } } }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, "Duration": { "fields": { "seconds": { @@ -2888,9 +3023,6 @@ } } }, - "Empty": { - "fields": {} - }, "FieldMask": { "fields": { "paths": { @@ -3056,6 +3188,330 @@ } } }, + "identity": { + "nested": { + "accesscontextmanager": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.V1", + "go_package": "google.golang.org/genproto/googleapis/identity/accesscontextmanager/v1;accesscontextmanager", + "java_multiple_files": true, + "java_outer_classname": "ServicePerimeterProto", + "java_package": "com.google.identity.accesscontextmanager.v1", + "php_namespace": "Google\\Identity\\AccessContextManager\\V1", + "ruby_package": "Google::Identity::AccessContextManager::V1", + "objc_class_prefix": "GACM" + }, + "nested": { + "AccessLevel": { + "oneofs": { + "level": { + "oneof": [ + "basic", + "custom" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "basic": { + "type": "BasicLevel", + "id": 4 + }, + "custom": { + "type": "CustomLevel", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "BasicLevel": { + "fields": { + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 1 + }, + "combiningFunction": { + "type": "ConditionCombiningFunction", + "id": 2 + } + }, + "nested": { + "ConditionCombiningFunction": { + "values": { + "AND": 0, + "OR": 1 + } + } + } + }, + "Condition": { + "fields": { + "ipSubnetworks": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "devicePolicy": { + "type": "DevicePolicy", + "id": 2 + }, + "requiredAccessLevels": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "negate": { + "type": "bool", + "id": 5 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "regions": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "CustomLevel": { + "fields": { + "expr": { + "type": "google.type.Expr", + "id": 1 + } + } + }, + "DevicePolicy": { + "fields": { + "requireScreenlock": { + "type": "bool", + "id": 1 + }, + "allowedEncryptionStatuses": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceEncryptionStatus", + "id": 2 + }, + "osConstraints": { + "rule": "repeated", + "type": "OsConstraint", + "id": 3 + }, + "allowedDeviceManagementLevels": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceManagementLevel", + "id": 6 + }, + "requireAdminApproval": { + "type": "bool", + "id": 7 + }, + "requireCorpOwned": { + "type": "bool", + "id": 8 + } + } + }, + "OsConstraint": { + "fields": { + "osType": { + "type": "google.identity.accesscontextmanager.type.OsType", + "id": 1 + }, + "minimumVersion": { + "type": "string", + "id": 2 + }, + "requireVerifiedChromeOs": { + "type": "bool", + "id": 3 + } + } + }, + "AccessPolicy": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "title": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "ServicePerimeter": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "perimeterType": { + "type": "PerimeterType", + "id": 6 + }, + "status": { + "type": "ServicePerimeterConfig", + "id": 7 + }, + "spec": { + "type": "ServicePerimeterConfig", + "id": 8 + }, + "useExplicitDryRunSpec": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "PerimeterType": { + "values": { + "PERIMETER_TYPE_REGULAR": 0, + "PERIMETER_TYPE_BRIDGE": 1 + } + } + } + }, + "ServicePerimeterConfig": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessLevels": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "restrictedServices": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "vpcAccessibleServices": { + "type": "VpcAccessibleServices", + "id": 10 + } + }, + "nested": { + "VpcAccessibleServices": { + "fields": { + "enableRestriction": { + "type": "bool", + "id": 1 + }, + "allowedServices": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.Type", + "go_package": "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type;type", + "java_package": "com.google.identity.accesscontextmanager.type", + "java_multiple_files": true, + "java_outer_classname": "TypeProto", + "php_namespace": "Google\\Identity\\AccessContextManager\\Type", + "ruby_package": "Google::Identity::AccessContextManager::Type" + }, + "nested": { + "DeviceEncryptionStatus": { + "values": { + "ENCRYPTION_UNSPECIFIED": 0, + "ENCRYPTION_UNSUPPORTED": 1, + "UNENCRYPTED": 2, + "ENCRYPTED": 3 + } + }, + "OsType": { + "values": { + "OS_UNSPECIFIED": 0, + "DESKTOP_MAC": 1, + "DESKTOP_WINDOWS": 2, + "DESKTOP_LINUX": 3, + "DESKTOP_CHROME_OS": 6, + "ANDROID": 4, + "IOS": 5 + } + }, + "DeviceManagementLevel": { + "values": { + "MANAGEMENT_UNSPECIFIED": 0, + "NONE": 1, + "BASIC": 2, + "COMPLETE": 3 + } + } + } + } + } + } + } + }, "longrunning": { "options": { "cc_enable_arenas": true, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index d448909d2d7..564a083b979 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - GaxCall, Callback, CallOptions, Descriptors, @@ -390,11 +389,11 @@ export class AssetServiceClient { * Optional. The content type. * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. * @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. @@ -927,10 +926,10 @@ export class AssetServiceClient { * or a folder number (such as "folders/123"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. * @param {string[]} request.assetTypes * A list of asset types of which to take a snapshot for. For example: * "compute.googleapis.com/Disk". If specified, only matching assets will be diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index a58073cc047..f114f91b5cc 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -21,13 +21,11 @@ }, "methods": { "ExportAssets": { - "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateFeed": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 37185e2cc13..44d0dc0156d 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1/asset_service.proto", - "../../protos/google/cloud/asset/v1/assets.proto" + "../../protos/google/cloud/asset/v1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index e4ffaf4a5d4..8d3ddf744e2 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - GaxCall, Callback, CallOptions, Descriptors, diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json index dc9c90c255f..db596172fbe 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json @@ -21,13 +21,11 @@ }, "methods": { "ExportAssets": { - "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json index 6c8ef83a9be..dc31fc2f4dc 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1beta1/assets.proto" + "../../protos/google/cloud/asset/v1beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 937679f38fa..19f607c3c0e 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -18,12 +18,12 @@ import * as gax from 'google-gax'; import { - GaxCall, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, + GaxCall, } from 'google-gax'; import * as path from 'path'; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json index fe7cd34beeb..6379b9d29cc 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json @@ -21,13 +21,11 @@ }, "methods": { "SearchAllResources": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SearchAllIamPolicies": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json index 4eba2431088..fc21c31880e 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p1beta1/assets.proto" + "../../protos/google/cloud/asset/v1p1beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 0a5683d7769..be77b1a8fb6 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -17,13 +17,7 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - GaxCall, - Callback, - CallOptions, - Descriptors, - ClientOptions, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json index aa7547b8a79..dc9dd42627e 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json @@ -21,28 +21,23 @@ }, "methods": { "CreateFeed": { - "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListFeeds": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateFeed": { - "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json index 060b459873e..d83da645e39 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p2beta1/assets.proto" + "../../protos/google/cloud/asset/v1p2beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index c42076f8f5d..ca54273ad86 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - GaxCall, Callback, CallOptions, Descriptors, diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json index 9f0c6639043..f43a62e3581 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json @@ -6,9 +6,6 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" ] }, "retry_params": { @@ -24,12 +21,10 @@ }, "methods": { "AnalyzeIamPolicy": { - "timeout_millis": 300000, - "retry_codes_name": "unavailable", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ExportIamPolicyAnalysis": { - "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json index 081fb125b33..10492e653da 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1p4beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p4beta1/assets.proto" + "../../protos/google/cloud/asset/v1p4beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a173bac08e3..e95884d2f4d 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-03-31T10:43:55.667140Z", + "updateTime": "2020-04-03T20:09:36.093848Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "0f7b1509a9a452808c3d07fe90fedfcea763d7d5", + "internalRef": "304672648" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + } + } + ], "destinations": [ { "client": { diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index a05d49edfe7..72e86fc09ba 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -13,6 +13,7 @@ # limitations under the License. """This script is used to synthesize generated parts of this library.""" +import json import synthtool as s import synthtool.gcp as gcp import subprocess @@ -34,8 +35,10 @@ 'grpc-service-config': f'google/cloud/{name}/{version}/cloud{name}_grpc_service_config.json', 'package-name': f'@google-cloud/{name}' }, - extra_proto_files=['google/cloud/common_resources.proto'], - version=version) + # This API has dependencies outside of its own folder so we list them here. + # Switching to bazel build should help get rid of this. + extra_proto_files=['google/cloud/common_resources.proto', 'google/cloud/orgpolicy/v1', 'google/identity/accesscontextmanager'], + version=version), # skip index, protos, package.json, and README.md s.copy( library, @@ -47,7 +50,21 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates) +# Extra proto dependencies make the *_proto_list.json have some common files +# that conflict with the same common files imported from gax. This is likely +# a generator problem that needs to be fixed when we start handling synth.py +# custom fixes. +proto_lists=[f'src/{version}/asset_service_proto_list.json' for version in versions] +remove_proto_keywords=['/google/api', '/google/protobuf', '/google/rpc', '/google/type'] +for file in proto_lists: + with open(file, 'r') as f: + items=json.load(f) + content =[item for item in items if all([(x not in item) for x in remove_proto_keywords])] + new_file=json.dumps(content, indent=2) + '\n' + with open(file, 'w') as f: + f.write(new_file) + # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npm', 'run', 'lint']) subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index 3282c4bfd27..f1056a37fb9 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {AssetServiceClient} from '@google-cloud/asset'; function main() { - const assetServiceClient = new AssetServiceClient(); + new AssetServiceClient(); } main(); From cb34d9b823c31d6f36becc7e945dca0bc1f58ea9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:47:34 -0700 Subject: [PATCH 198/429] chore: remove duplicate mocha config (#306) --- packages/google-cloud-asset/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-asset/.mocharc.json diff --git a/packages/google-cloud-asset/.mocharc.json b/packages/google-cloud-asset/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-asset/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From 24e93a79a18ac24664dba95767acc6cafebd9fd5 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 6 Apr 2020 13:05:32 -0700 Subject: [PATCH 199/429] fix: in rare cases test can take longer than 180,000 timeout (#307) --- .../samples/test/sample.test.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 5f2cd1ccc4e..425068261bc 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -26,6 +26,20 @@ const storage = new Storage(); const bucketName = `asset-nodejs-${uuid.v4()}`; const bucket = storage.bucket(bucketName); +// Some of these tests can take an extremely long time, and occasionally +// timeout, see: +// "Timeout of 180000ms exceeded. For async tests and hooks". +const delay = async test => { + const retries = test.currentRetry(); + if (retries === 0) return; // no retry on the first failure. + // see: https://cloud.google.com/storage/docs/exponential-backoff: + const ms = Math.pow(2, retries) * 1000 + Math.random() * 2000; + return new Promise(done => { + console.info(`retrying "${test.title}" in ${ms}ms`); + setTimeout(done, ms); + }); +}; + describe('quickstart sample tests', () => { before(async () => { await bucket.create(); @@ -35,7 +49,9 @@ describe('quickstart sample tests', () => { await bucket.delete(); }); - it('should export assets to specified path', async () => { + it('should export assets to specified path', async function() { + this.retries(2); + await delay(this.test); const dumpFilePath = `gs://${bucketName}/my-assets.txt`; execSync(`node exportAssets ${dumpFilePath}`); const file = await bucket.file('my-assets.txt'); From 190d94ef1dcd16a8cb9228009e3865d40d19c260 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Apr 2020 19:09:35 -0700 Subject: [PATCH 200/429] test: await assert.rejects --- packages/google-cloud-asset/.jsdoc.js | 2 +- packages/google-cloud-asset/synth.metadata | 2 +- .../test/gapic_asset_service_v1.ts | 16 ++++++++-------- .../test/gapic_asset_service_v1beta1.ts | 6 +++--- .../test/gapic_asset_service_v1p1beta1.ts | 12 ++++++------ .../test/gapic_asset_service_v1p2beta1.ts | 10 +++++----- .../test/gapic_asset_service_v1p4beta1.ts | 6 +++--- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index ee0bcb61a13..03f79f28b1d 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/asset', diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e95884d2f4d..aa78167ee0c 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-04-03T20:09:36.093848Z", + "updateTime": "2020-04-04T11:12:42.743409Z", "sources": [ { "git": { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 770390fa80a..20591b0e74f 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -268,7 +268,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.batchGetAssetsHistory(request); }, expectedError); assert( @@ -382,7 +382,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFeed(request); }, expectedError); assert( @@ -493,7 +493,7 @@ describe('v1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getFeed(request); }, expectedError); assert( @@ -604,7 +604,7 @@ describe('v1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFeeds(request); }, expectedError); assert( @@ -721,7 +721,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFeed(request); }, expectedError); assert( @@ -835,7 +835,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteFeed(request); }, expectedError); assert( @@ -957,7 +957,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.exportAssets(request); }, expectedError); assert( @@ -992,7 +992,7 @@ describe('v1.AssetServiceClient', () => { expectedError ); const [operation] = await client.exportAssets(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts index c9d73b9ca26..ed4f37c7d9f 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts @@ -270,7 +270,7 @@ describe('v1beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.batchGetAssetsHistory(request); }, expectedError); assert( @@ -392,7 +392,7 @@ describe('v1beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.exportAssets(request); }, expectedError); assert( @@ -427,7 +427,7 @@ describe('v1beta1.AssetServiceClient', () => { expectedError ); const [operation] = await client.exportAssets(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index 5baae883e2d..b887e4b39e6 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -319,7 +319,7 @@ describe('v1p1beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.searchAllResources(request); }, expectedError); assert( @@ -422,7 +422,7 @@ describe('v1p1beta1.AssetServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -501,7 +501,7 @@ describe('v1p1beta1.AssetServiceClient', () => { expectedError ); const iterable = client.searchAllResourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -645,7 +645,7 @@ describe('v1p1beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.searchAllIamPolicies(request); }, expectedError); assert( @@ -748,7 +748,7 @@ describe('v1p1beta1.AssetServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -827,7 +827,7 @@ describe('v1p1beta1.AssetServiceClient', () => { expectedError ); const iterable = client.searchAllIamPoliciesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index e17900d4efb..2c2fa43ca81 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -236,7 +236,7 @@ describe('v1p2beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFeed(request); }, expectedError); assert( @@ -347,7 +347,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getFeed(request); }, expectedError); assert( @@ -458,7 +458,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFeeds(request); }, expectedError); assert( @@ -575,7 +575,7 @@ describe('v1p2beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFeed(request); }, expectedError); assert( @@ -689,7 +689,7 @@ describe('v1p2beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteFeed(request); }, expectedError); assert( diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index c34b29853b2..7a8049de2ff 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts @@ -271,7 +271,7 @@ describe('v1p4beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.analyzeIamPolicy(request); }, expectedError); assert( @@ -398,7 +398,7 @@ describe('v1p4beta1.AssetServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.exportIamPolicyAnalysis(request); }, expectedError); assert( @@ -434,7 +434,7 @@ describe('v1p4beta1.AssetServiceClient', () => { expectedError ); const [operation] = await client.exportIamPolicyAnalysis(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( From abd40cdb206408b27fd570135437754f0b1c1adc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 19:39:51 +0200 Subject: [PATCH 201/429] chore(deps): update dependency gts to v2.0.0 (#308) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 4d5732a379e..ca28b7cbbb5 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -52,7 +52,7 @@ "@types/sinon": "^9.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From cce4ca7ab560f1c8f969c522398e48c1dd87a363 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 10 Apr 2020 10:52:02 -0700 Subject: [PATCH 202/429] chore: linting (#309) --- packages/google-cloud-asset/.prettierrc.js | 2 +- .../samples/test/sample.test.js | 2 +- packages/google-cloud-asset/synth.metadata | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/.prettierrc.js b/packages/google-cloud-asset/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-asset/.prettierrc.js +++ b/packages/google-cloud-asset/.prettierrc.js @@ -4,7 +4,7 @@ // 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, diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 425068261bc..f2b12b3a43e 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -49,7 +49,7 @@ describe('quickstart sample tests', () => { await bucket.delete(); }); - it('should export assets to specified path', async function() { + it('should export assets to specified path', async function () { this.retries(2); await delay(this.test); const dumpFilePath = `gs://${bucketName}/my-assets.txt`; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index aa78167ee0c..fc8b6bbe214 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,19 +1,27 @@ { - "updateTime": "2020-04-04T11:12:42.743409Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "d4235e7adca2b15aa2c60d1575774f3e6f555229" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0f7b1509a9a452808c3d07fe90fedfcea763d7d5", - "internalRef": "304672648" + "sha": "801c3fb47b1a533989a1fe5af4aedf02af5f2eae", + "internalRef": "305814814", + "log": "801c3fb47b1a533989a1fe5af4aedf02af5f2eae\ndocs: Update documentation to clarify naming.\n\nPiperOrigin-RevId: 305814814\n\n41d5dee23527df3fc9127838a027df393d79ff3c\nDialogflow weekly v2/v2beta1 library update:\n- Update documentation on various resources.\n- Add LRO info to CreateDocument method.\n\nPiperOrigin-RevId: 305810283\n\nb21bc9b46e3263cd4ebe50f60c61589e3fe797f2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305797556\n\nb8c7c4e8da56547fc32bee9b563d306fadabdb6f\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305789382\n\n96c0db42dbcb3bb0116cfa55c054dd139ffb3912\nchore: enable gapicv2 for videointelligence/v1p2beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305779873\n\nfd35dc6865fa9f47f283d5a6c37c4901162007cf\nmigrate Asset v1 API to gapic v2.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305774392\n\nfe8b17aff5b419ffb418a77228fa049190488233\nbuild(google/maps): update python postprocessing\n\n- modify python versions. see https://github.com/googleapis/gapic-generator/pull/3128\n- use markdown readme instead of rst\n- remove enum34\n- fix namespace google.cloud -> google.maps. see https://github.com/googleapis/gapic-generator/issues/3166\n\nPiperOrigin-RevId: 305773355\n\nac1f904979899bc598fb0567cf7a367f08b40b43\nfix (breaking change): reorder Company and Job resources in talent API to be consistent with old gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305760190\n\n9af7212bc2cba8a7184f032e1ab6662ccf604b3a\ndocs: display resource name patterns in code font.\n\nPiperOrigin-RevId: 305751417\n\nc451a4457f38e5582e9794a0094c773355a9eaad\nBigQuery Connection API v1.\nBreaking changes:\n Removed UpdateConnectionCredential method.\n Removed ListConnectionsRequest.max_results, added ListConnectionsRequest.page_size.\n\nPiperOrigin-RevId: 305738384\n\naf71ea52236b05ce73253f6bc935fcf35c866664\nchore: enable gapicv2 for vision/v1p2beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305730427\n\n6114e2d30c0792522720d1c2cf8f5e111be7545b\nchore: enable gapicv2 for vision/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305729994\n\nee4ea76504aa60c2bff9b7c11269c155d8c21e0d\ngapic-generator:\n- feat: Support extra plugin_args for php bazel rules rules (#3165)\n- feat: support '*' in resource definition (#3163)\n- fix: add null check and better error message when referenced resource is not found (#3169)\n\nresource name plugin:\n- support * annotation in resource def (#84)\n\nPiperOrigin-RevId: 305619145\n\ne4f4b23e07315492b533746e6a9255a1e6b3e748\nosconfig v1beta: fix the incorrect pattern for GuestPolicy resource and remove the obsolete history field.\n\nPiperOrigin-RevId: 305617619\n\nd741cd976975c745d0199987aff0e908b8352992\nchore: enable gapicv2 for firestore/v1 API\n\nNote that this contains breaking Java changes:\n com.google.cloud.firestore.v1.FirestoreClient: Method 'public void deleteDocument(com.google.firestore.v1.AnyPathName)' has been removed\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305561906\n\n0d69cddaa23b556e7299f84ad55a02ec1cad55a9\nchore: enable gapicv2 for firestore/admin/v1 API\n\nCommitter: @miraleung\n\nThere are the following breaking changes due to the collection_id discrepancy between [1] and [2]\n\n1. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/firestore_gapic.yaml#L24-L29\n2. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/field.proto#L39\n```\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setFieldId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setIndexId(java.lang.String)' has been removed\n```\n\nPiperOrigin-RevId: 305561114\n\n6f8350c0df231d7e742fa10dbf929f33047715c9\nchore: enable gapicv2 for firestore/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305537104\n\nd398d687aad9eab4c6ceee9cd5e012fa61f7e28c\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305496764\n\n5520cb891a72ab0b0cbe3facaca7b012785f5b49\nchore: update gapic-generator to cd3c9ee7\n\nChanges include:\n* update generated nox file\n* fix generated license text alignment\n\nPiperOrigin-RevId: 305484038\n\nb20965f260d70e57b7dcd312cd356d6a81f31f8e\nUpdating retry configuration settings.\n\nPiperOrigin-RevId: 305431885\n\n83d7f20c06182cb6ada9a3b47daf17b2fd22b020\nMigrate dialogflow from gapic v1 to gapic v2.\nIncluding breaking changes (resource pattern change) introduced in cl/304043500.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305358314\n\nf8a97692250a6c781d87528995a5c72d41ca7762\nchore: enable gapic v2 and proto annotation for Grafeas API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305354660\n\nb1a5ca68468eb1587168972c9d15928e98ba92b0\nEnable gapicv2 for v1/osconfig\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305351235\n\nc803327f9b1dd2583b070645b5b86e5e7ead3161\nEnable gapicv2 for osconfig/agentendpoint/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305350472\n\n99dddf1de598f95a71d3536f5c170d84f0c0ef87\nchore: enable gapicv2 for build/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349884\n\nbf85ee3ed64951c14b19ef8577689f43ee6f0f41\nchore: enable gapicv2 for cloudbuild/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349873\n\nf497c7aa912df121e11772767e667fdbc10a63d9\nchore: enable gapic v2 and proto annotation for Web Security Scanner v1alpha API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305349342\n\n0669a37c66d76bd413343da69420bb75c49062e7\nchore: rename unused GAPIC v1 configs for IAM to legacy\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305340308\n\naf7da29c24814a1c873c22f477e9dd8dd5a17b0b\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305330079\n\n3f767aa32b4b3313027d05b503aaba63e0c432a3\ndocs: Update an out-of-date external link.\n\nPiperOrigin-RevId: 305329485\n\n9ede34d093b9d786a974448fc7a3a17948c203e2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327985\n\n27daba50281357b676e1ba882422ebeab4ce4f92\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327500\n\n82de0f6f04649651958b96fbc5b0b39dd4dbbd01\nFix: Add missing resource name definition (from the Compute API).\n\nPiperOrigin-RevId: 305324763\n\n744591190e828440f72745aef217f883afd1fd71\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305323909\n\n1247c135ceaedfe04261d27a64aaecf78ffbae74\nchore: enable gapicv2 for videointelligence/v1beta2 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305321976\n\n633c8b13227b9e3810749964d580e5be504db488\nchore: enable gapicv2 for videointelligence/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305320877\n\n29aac60f121dc43382b37ff92f2dbb692d94143a\ndocs: fix broken link to policy reference documentation.\n\nPiperOrigin-RevId: 305319540\n\n54ddbbf14c489b8a2f0731aa39408c016f5a8387\nbazel: update gapic-generator-go to v0.13.0\n\nChanges include:\n* add clientHook feature\n\nPiperOrigin-RevId: 305289945\n\n823facb4ca6a4b36b817ce955a790dcb40cf808f\nchore: enable gapicv2 for videointelligence/v1p3beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305155214\n\n6b9c969d42bcb0f8206675bd868ed7d1ddcdaef9\nAdd API for bigqueryreservation v1.\n\nPiperOrigin-RevId: 305151484\n\n514f7d27811832a9f58b83d6f6305d894b097cf6\nchore: enable gapicv2 for phishingprotection/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305126983\n\nff74d47d47280e6bbcbad1a7c82b1e0959c472ec\nfix: PHP-related fixes in BUILD.bazel and service.yamls\n\nThis PR also adds the rules for all 7 langauges in OsLogin and Kms BUILD.bazel files. Those build files were missing rules for 5 langagues, including PHP.\n\nThis PR is the prerequisite for migrating PHP synth.py scripts from artman to bazel.\n\nThe fixes in service.yaml fix regression made during proto annotation migration. This became visible only during PHP generation, because only PHP depends on the affected sections of the service.yaml config.\n\nPiperOrigin-RevId: 305108224\n\nfdbc7b1f63969307c71143a0c24fdfd02e739df6\nEnable gapicv2 for osconfig/agentendpoint/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305086443\n\n1490d30e1ae339570dd7826ba625a603ede91a08\nEnable gapicv2 for osconfig/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305069755\n\n7bf824e82e5c3549642b150dc4a9579602000f34\nEnable gapicv2 for iam/credentials/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305065283\n\n9ff6fd3b22f99167827e89aae7778408b5e82425\nUpdates Dataproc v1 API:\n- Adds Dataproc Jobs.SubmitJobAsOperation RPC\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053617\n\ncad0f5137a70d0d14a8d9acbfcee98e4cd3e9662\nUpdates to Dataproc v1beta2 API:\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053062\n\na005f045a301535eeb4c4b3fa7bb94eec9d22a8b\nAdd support for Cloud EKM to the Cloud KMS service and resource protos.\n\nPiperOrigin-RevId: 305026790\n\n5077b1e4674afdbbf11dac3f5f43d36285ba53ff\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304836531\n\nd6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", + "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" } } ], From f4ffc9efe4c79741e6fc385c81224ad5cbd48619 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2020 11:42:09 -0700 Subject: [PATCH 203/429] chore: release 3.0.0 (#280) --- packages/google-cloud-asset/CHANGELOG.md | 21 +++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index b9d1dfc1637..cec8f738277 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,27 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.0.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.2.0...v3.0.0) (2020-04-10) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. +* removed SearchResources and SearchIamPolicies from v1p1beta1 client + +### Features + +* add org policy and access context manager protos ([#304](https://www.github.com/googleapis/nodejs-asset/issues/304)) ([4d18cc7](https://www.github.com/googleapis/nodejs-asset/commit/4d18cc7ac2fc4d4bae9999291575e8c3a020947f)) +* adds v1p4beta1 API surface ([#285](https://www.github.com/googleapis/nodejs-asset/issues/285)) ([9dee03a](https://www.github.com/googleapis/nodejs-asset/commit/9dee03a546df19ae1fc92f25f07f994e010f4ac4)) +* deferred client initialization ([#281](https://www.github.com/googleapis/nodejs-asset/issues/281)) ([8148ab0](https://www.github.com/googleapis/nodejs-asset/commit/8148ab0e075c36e2c49d2af96791f83398529b87)) +* drop node8 support, support for async iterators ([#299](https://www.github.com/googleapis/nodejs-asset/issues/299)) ([ae14ae8](https://www.github.com/googleapis/nodejs-asset/commit/ae14ae8fc84defbd65b06fdaaef94e07a1294e1b)) +* removed SearchResources and SearchIamPolicies from v1p1beta1 client ([184fd2f](https://www.github.com/googleapis/nodejs-asset/commit/184fd2fd3ee9cc32312f671398992f3b453fb78d)) + + +### Bug Fixes + +* in rare cases test can take longer than 180,000 timeout ([#307](https://www.github.com/googleapis/nodejs-asset/issues/307)) ([8a528fa](https://www.github.com/googleapis/nodejs-asset/commit/8a528fac934ce8dd1378c06a89b52c5d76286a9b)) + ## [2.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.1.0...v2.2.0) (2020-02-27) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ca28b7cbbb5..71c595ab1b9 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "2.2.0", + "version": "3.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index b0dd96d8803..7ebd14d2fb5 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^2.2.0", + "@google-cloud/asset": "^3.0.0", "@google-cloud/storage": "^4.0.0", "uuid": "^7.0.0", "yargs": "^15.0.0" From ca7918493e4b5905d1b204e36492137d99eab2be Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:50:29 -0700 Subject: [PATCH 204/429] fix: remove eslint, update gax, fix generated protos, run the generator (#311) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- packages/google-cloud-asset/package.json | 9 ++++---- packages/google-cloud-asset/protos/protos.js | 2 +- .../google-cloud-asset/protos/protos.json | 16 ++++++++++---- packages/google-cloud-asset/synth.metadata | 21 +++---------------- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 71c595ab1b9..61eaf348e35 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -35,16 +35,15 @@ "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts fix && eslint --fix samples/*.js", + "lint": "gts fix", "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", - "prelint": "cd samples; npm link ../; npm i" + "prelint": "cd samples; npm link ../; npm install" }, "dependencies": { - "google-gax": "^2.0.1", - "protobufjs": "^6.8.9" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.2", @@ -52,7 +51,7 @@ "@types/sinon": "^9.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index c83430e023c..404066c0989 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_asset_2_2_0_protos || ($protobuf.roots._google_cloud_asset_2_2_0_protos = {}); + var $root = $protobuf.roots._google_cloud_asset_3_0_0_protos || ($protobuf.roots._google_cloud_asset_3_0_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index cd286ca591f..6a6fcdc3c29 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3529,26 +3529,32 @@ "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.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.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.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "CancelOperation": { @@ -3556,7 +3562,8 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" } }, "WaitOperation": { @@ -3682,6 +3689,7 @@ }, "rpc": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/rpc/code;code", "java_multiple_files": true, "java_outer_classname": "CodeProto", diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index fc8b6bbe214..1fe5189f793 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,27 +1,12 @@ { + "updateTime": "2020-04-10T23:50:34.838254Z", "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "d4235e7adca2b15aa2c60d1575774f3e6f555229" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "801c3fb47b1a533989a1fe5af4aedf02af5f2eae", - "internalRef": "305814814", - "log": "801c3fb47b1a533989a1fe5af4aedf02af5f2eae\ndocs: Update documentation to clarify naming.\n\nPiperOrigin-RevId: 305814814\n\n41d5dee23527df3fc9127838a027df393d79ff3c\nDialogflow weekly v2/v2beta1 library update:\n- Update documentation on various resources.\n- Add LRO info to CreateDocument method.\n\nPiperOrigin-RevId: 305810283\n\nb21bc9b46e3263cd4ebe50f60c61589e3fe797f2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305797556\n\nb8c7c4e8da56547fc32bee9b563d306fadabdb6f\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305789382\n\n96c0db42dbcb3bb0116cfa55c054dd139ffb3912\nchore: enable gapicv2 for videointelligence/v1p2beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305779873\n\nfd35dc6865fa9f47f283d5a6c37c4901162007cf\nmigrate Asset v1 API to gapic v2.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305774392\n\nfe8b17aff5b419ffb418a77228fa049190488233\nbuild(google/maps): update python postprocessing\n\n- modify python versions. see https://github.com/googleapis/gapic-generator/pull/3128\n- use markdown readme instead of rst\n- remove enum34\n- fix namespace google.cloud -> google.maps. see https://github.com/googleapis/gapic-generator/issues/3166\n\nPiperOrigin-RevId: 305773355\n\nac1f904979899bc598fb0567cf7a367f08b40b43\nfix (breaking change): reorder Company and Job resources in talent API to be consistent with old gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305760190\n\n9af7212bc2cba8a7184f032e1ab6662ccf604b3a\ndocs: display resource name patterns in code font.\n\nPiperOrigin-RevId: 305751417\n\nc451a4457f38e5582e9794a0094c773355a9eaad\nBigQuery Connection API v1.\nBreaking changes:\n Removed UpdateConnectionCredential method.\n Removed ListConnectionsRequest.max_results, added ListConnectionsRequest.page_size.\n\nPiperOrigin-RevId: 305738384\n\naf71ea52236b05ce73253f6bc935fcf35c866664\nchore: enable gapicv2 for vision/v1p2beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305730427\n\n6114e2d30c0792522720d1c2cf8f5e111be7545b\nchore: enable gapicv2 for vision/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305729994\n\nee4ea76504aa60c2bff9b7c11269c155d8c21e0d\ngapic-generator:\n- feat: Support extra plugin_args for php bazel rules rules (#3165)\n- feat: support '*' in resource definition (#3163)\n- fix: add null check and better error message when referenced resource is not found (#3169)\n\nresource name plugin:\n- support * annotation in resource def (#84)\n\nPiperOrigin-RevId: 305619145\n\ne4f4b23e07315492b533746e6a9255a1e6b3e748\nosconfig v1beta: fix the incorrect pattern for GuestPolicy resource and remove the obsolete history field.\n\nPiperOrigin-RevId: 305617619\n\nd741cd976975c745d0199987aff0e908b8352992\nchore: enable gapicv2 for firestore/v1 API\n\nNote that this contains breaking Java changes:\n com.google.cloud.firestore.v1.FirestoreClient: Method 'public void deleteDocument(com.google.firestore.v1.AnyPathName)' has been removed\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305561906\n\n0d69cddaa23b556e7299f84ad55a02ec1cad55a9\nchore: enable gapicv2 for firestore/admin/v1 API\n\nCommitter: @miraleung\n\nThere are the following breaking changes due to the collection_id discrepancy between [1] and [2]\n\n1. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/firestore_gapic.yaml#L24-L29\n2. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/field.proto#L39\n```\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setFieldId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setIndexId(java.lang.String)' has been removed\n```\n\nPiperOrigin-RevId: 305561114\n\n6f8350c0df231d7e742fa10dbf929f33047715c9\nchore: enable gapicv2 for firestore/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305537104\n\nd398d687aad9eab4c6ceee9cd5e012fa61f7e28c\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305496764\n\n5520cb891a72ab0b0cbe3facaca7b012785f5b49\nchore: update gapic-generator to cd3c9ee7\n\nChanges include:\n* update generated nox file\n* fix generated license text alignment\n\nPiperOrigin-RevId: 305484038\n\nb20965f260d70e57b7dcd312cd356d6a81f31f8e\nUpdating retry configuration settings.\n\nPiperOrigin-RevId: 305431885\n\n83d7f20c06182cb6ada9a3b47daf17b2fd22b020\nMigrate dialogflow from gapic v1 to gapic v2.\nIncluding breaking changes (resource pattern change) introduced in cl/304043500.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305358314\n\nf8a97692250a6c781d87528995a5c72d41ca7762\nchore: enable gapic v2 and proto annotation for Grafeas API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305354660\n\nb1a5ca68468eb1587168972c9d15928e98ba92b0\nEnable gapicv2 for v1/osconfig\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305351235\n\nc803327f9b1dd2583b070645b5b86e5e7ead3161\nEnable gapicv2 for osconfig/agentendpoint/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305350472\n\n99dddf1de598f95a71d3536f5c170d84f0c0ef87\nchore: enable gapicv2 for build/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349884\n\nbf85ee3ed64951c14b19ef8577689f43ee6f0f41\nchore: enable gapicv2 for cloudbuild/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349873\n\nf497c7aa912df121e11772767e667fdbc10a63d9\nchore: enable gapic v2 and proto annotation for Web Security Scanner v1alpha API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305349342\n\n0669a37c66d76bd413343da69420bb75c49062e7\nchore: rename unused GAPIC v1 configs for IAM to legacy\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305340308\n\naf7da29c24814a1c873c22f477e9dd8dd5a17b0b\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305330079\n\n3f767aa32b4b3313027d05b503aaba63e0c432a3\ndocs: Update an out-of-date external link.\n\nPiperOrigin-RevId: 305329485\n\n9ede34d093b9d786a974448fc7a3a17948c203e2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327985\n\n27daba50281357b676e1ba882422ebeab4ce4f92\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327500\n\n82de0f6f04649651958b96fbc5b0b39dd4dbbd01\nFix: Add missing resource name definition (from the Compute API).\n\nPiperOrigin-RevId: 305324763\n\n744591190e828440f72745aef217f883afd1fd71\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305323909\n\n1247c135ceaedfe04261d27a64aaecf78ffbae74\nchore: enable gapicv2 for videointelligence/v1beta2 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305321976\n\n633c8b13227b9e3810749964d580e5be504db488\nchore: enable gapicv2 for videointelligence/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305320877\n\n29aac60f121dc43382b37ff92f2dbb692d94143a\ndocs: fix broken link to policy reference documentation.\n\nPiperOrigin-RevId: 305319540\n\n54ddbbf14c489b8a2f0731aa39408c016f5a8387\nbazel: update gapic-generator-go to v0.13.0\n\nChanges include:\n* add clientHook feature\n\nPiperOrigin-RevId: 305289945\n\n823facb4ca6a4b36b817ce955a790dcb40cf808f\nchore: enable gapicv2 for videointelligence/v1p3beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305155214\n\n6b9c969d42bcb0f8206675bd868ed7d1ddcdaef9\nAdd API for bigqueryreservation v1.\n\nPiperOrigin-RevId: 305151484\n\n514f7d27811832a9f58b83d6f6305d894b097cf6\nchore: enable gapicv2 for phishingprotection/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305126983\n\nff74d47d47280e6bbcbad1a7c82b1e0959c472ec\nfix: PHP-related fixes in BUILD.bazel and service.yamls\n\nThis PR also adds the rules for all 7 langauges in OsLogin and Kms BUILD.bazel files. Those build files were missing rules for 5 langagues, including PHP.\n\nThis PR is the prerequisite for migrating PHP synth.py scripts from artman to bazel.\n\nThe fixes in service.yaml fix regression made during proto annotation migration. This became visible only during PHP generation, because only PHP depends on the affected sections of the service.yaml config.\n\nPiperOrigin-RevId: 305108224\n\nfdbc7b1f63969307c71143a0c24fdfd02e739df6\nEnable gapicv2 for osconfig/agentendpoint/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305086443\n\n1490d30e1ae339570dd7826ba625a603ede91a08\nEnable gapicv2 for osconfig/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305069755\n\n7bf824e82e5c3549642b150dc4a9579602000f34\nEnable gapicv2 for iam/credentials/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305065283\n\n9ff6fd3b22f99167827e89aae7778408b5e82425\nUpdates Dataproc v1 API:\n- Adds Dataproc Jobs.SubmitJobAsOperation RPC\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053617\n\ncad0f5137a70d0d14a8d9acbfcee98e4cd3e9662\nUpdates to Dataproc v1beta2 API:\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053062\n\na005f045a301535eeb4c4b3fa7bb94eec9d22a8b\nAdd support for Cloud EKM to the Cloud KMS service and resource protos.\n\nPiperOrigin-RevId: 305026790\n\n5077b1e4674afdbbf11dac3f5f43d36285ba53ff\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304836531\n\nd6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n" - } - }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", - "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", + "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n" } } ], From 30ed2991c91157e0c325fca5d6ee0c7222b13054 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 19:17:36 -0700 Subject: [PATCH 205/429] build: remove unused codecov config (#313) --- packages/google-cloud-asset/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-asset/codecov.yaml diff --git a/packages/google-cloud-asset/codecov.yaml b/packages/google-cloud-asset/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-asset/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 6681f05c6994a5ef74eafb980553e1c869026c3b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:53:27 -0700 Subject: [PATCH 206/429] chore: update lint ignore files (#314) --- packages/google-cloud-asset/.eslintignore | 3 ++- packages/google-cloud-asset/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-asset/.eslintignore +++ b/packages/google-cloud-asset/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-asset/.prettierignore b/packages/google-cloud-asset/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-asset/.prettierignore +++ b/packages/google-cloud-asset/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From e46e0682b9e568a535049cbcd7ecb0eb97e27aee Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:29:15 -0700 Subject: [PATCH 207/429] chore: remove tslint.json (#315) --- packages/google-cloud-asset/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-asset/tslint.json diff --git a/packages/google-cloud-asset/tslint.json b/packages/google-cloud-asset/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-asset/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From feb52e45eb2701f7a4f641d79f97f3c75c597a61 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:31:05 +0200 Subject: [PATCH 208/429] chore(deps): update dependency ts-loader to v7 (#316) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.2` -> `^7.0.0`](https://renovatebot.com/diffs/npm/ts-loader/6.2.2/7.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v7.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v700) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0) - [Project reference support enhancements](https://togithub.com/TypeStrong/ts-loader/pull/1076) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - Following the end of life of Node 8, `ts-loader` no longer supports Node 8 **BREAKING CHANGE**
--- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 61eaf348e35..95ababc7e27 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -60,7 +60,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.2", + "ts-loader": "^7.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" From 8070df7a4609c9746c58b899b4001c23bff76189 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:30:41 +0200 Subject: [PATCH 209/429] chore(deps): update dependency null-loader to v4 (#317) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes
webpack-contrib/null-loader ### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13`
--- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 95ababc7e27..e1caa8e8ead 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -57,7 +57,7 @@ "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", "mocha": "^7.1.1", - "null-loader": "^3.0.0", + "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", "ts-loader": "^7.0.0", From 3b34193514c25dc5fb0634c9aabff324a5f6d29d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 15 Apr 2020 10:31:44 -0700 Subject: [PATCH 210/429] chore: run fix instead of lint in synthfile (#318) --- packages/google-cloud-asset/synth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 72e86fc09ba..21340c08b39 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -61,10 +61,10 @@ items=json.load(f) content =[item for item in items if all([(x not in item) for x in remove_proto_keywords])] new_file=json.dumps(content, indent=2) + '\n' - with open(file, 'w') as f: + with open(file, 'w') as f: f.write(new_file) # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) subprocess.run(['npx', 'compileProtos', 'src']) From 28f4a75066620446c85fd976fa011173012f791e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Apr 2020 15:42:03 -0700 Subject: [PATCH 211/429] build: use codecov's action, now that it's authless (#320) --- packages/google-cloud-asset/synth.metadata | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 1fe5189f793..333595a3c6d 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,12 +1,25 @@ { - "updateTime": "2020-04-10T23:50:34.838254Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "03a1788722ba9496cbbec327dbc3bd8a2c39495e" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", + "internalRef": "307114445" + } + }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", - "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], From efcf1ffe52c3c2c41ebf48f3a781bfc6aada6aaf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Apr 2020 20:01:30 -0700 Subject: [PATCH 212/429] build: apply generator formatting changes (#321) --- packages/google-cloud-asset/protos/protos.js | 786 +++++++++---------- packages/google-cloud-asset/synth.metadata | 2 +- 2 files changed, 394 insertions(+), 394 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 404066c0989..57ca9203e2f 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -425,16 +425,16 @@ ExportAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -728,9 +728,9 @@ ExportAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -967,14 +967,14 @@ BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.assetNames != null && message.assetNames.length) for (var i = 0; i < message.assetNames.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -1469,11 +1469,11 @@ CreateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.feedId != null && message.hasOwnProperty("feedId")) + if (message.feedId != null && Object.hasOwnProperty.call(message, "feedId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); - if (message.feed != null && message.hasOwnProperty("feed")) + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -1688,7 +1688,7 @@ GetFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -1875,7 +1875,7 @@ ListFeedsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; @@ -2279,9 +2279,9 @@ UpdateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feed != null && message.hasOwnProperty("feed")) + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + 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; }; @@ -2490,7 +2490,7 @@ DeleteFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -2700,9 +2700,9 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -2945,9 +2945,9 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + if (message.uriPrefix != null && Object.hasOwnProperty.call(message, "uriPrefix")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; @@ -3173,11 +3173,11 @@ BigQueryDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && message.hasOwnProperty("dataset")) + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); - if (message.force != null && message.hasOwnProperty("force")) + if (message.force != null && Object.hasOwnProperty.call(message, "force")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; @@ -3387,7 +3387,7 @@ PubsubDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); return writer; }; @@ -3588,7 +3588,7 @@ FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + if (message.pubsubDestination != null && Object.hasOwnProperty.call(message, "pubsubDestination")) $root.google.cloud.asset.v1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -3823,7 +3823,7 @@ Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.assetNames != null && message.assetNames.length) for (var i = 0; i < message.assetNames.length; ++i) @@ -3831,9 +3831,9 @@ if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + if (message.feedOutputConfig != null && Object.hasOwnProperty.call(message, "feedOutputConfig")) $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -4075,7 +4075,7 @@ /** * ContentType enum. * @name google.cloud.asset.v1.ContentType - * @enum {string} + * @enum {number} * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value * @property {number} RESOURCE=1 RESOURCE value * @property {number} IAM_POLICY=2 IAM_POLICY value @@ -4166,11 +4166,11 @@ TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) + if (message.window != null && Object.hasOwnProperty.call(message, "window")) $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -4399,9 +4399,9 @@ TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + 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 && message.hasOwnProperty("endTime")) + 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; }; @@ -4698,22 +4698,22 @@ Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.orgPolicy != null && message.orgPolicy.length) for (var i = 0; i < message.orgPolicy.length; ++i) $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.ancestors != null && message.ancestors.length) for (var i = 0; i < message.ancestors.length; ++i) @@ -5117,17 +5117,17 @@ Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) + if (message.data != null && Object.hasOwnProperty.call(message, "data")) $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -5525,16 +5525,16 @@ ExportAssetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -5818,9 +5818,9 @@ ExportAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readTime != null && message.hasOwnProperty("readTime")) + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6057,14 +6057,14 @@ BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.assetNames != null && message.assetNames.length) for (var i = 0; i < message.assetNames.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -6545,7 +6545,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.asset.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -6765,9 +6765,9 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + if (message.uriPrefix != null && Object.hasOwnProperty.call(message, "uriPrefix")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; @@ -6922,7 +6922,7 @@ /** * ContentType enum. * @name google.cloud.asset.v1beta1.ContentType - * @enum {string} + * @enum {number} * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value * @property {number} RESOURCE=1 RESOURCE value * @property {number} IAM_POLICY=2 IAM_POLICY value @@ -7009,11 +7009,11 @@ TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) + if (message.window != null && Object.hasOwnProperty.call(message, "window")) $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7242,9 +7242,9 @@ TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + 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 && message.hasOwnProperty("endTime")) + 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; }; @@ -7480,13 +7480,13 @@ Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -7762,17 +7762,17 @@ Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) + if (message.data != null && Object.hasOwnProperty.call(message, "data")) $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -8170,16 +8170,16 @@ SearchAllResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scope != null && message.hasOwnProperty("scope")) + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.query != null && message.hasOwnProperty("query")) + if (message.query != null && Object.hasOwnProperty.call(message, "query")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; @@ -8439,7 +8439,7 @@ if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -8684,13 +8684,13 @@ SearchAllIamPoliciesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scope != null && message.hasOwnProperty("scope")) + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.query != null && message.hasOwnProperty("query")) + if (message.query != null && Object.hasOwnProperty.call(message, "query")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; @@ -8924,7 +8924,7 @@ if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -9188,15 +9188,15 @@ StandardResourceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); if (message.additionalAttributes != null && message.additionalAttributes.length) for (var i = 0; i < message.additionalAttributes.length; ++i) @@ -9475,11 +9475,11 @@ IamPolicySearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.policy != null && message.hasOwnProperty("policy")) + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -9924,11 +9924,11 @@ CreateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.feedId != null && message.hasOwnProperty("feedId")) + if (message.feedId != null && Object.hasOwnProperty.call(message, "feedId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); - if (message.feed != null && message.hasOwnProperty("feed")) + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -10143,7 +10143,7 @@ GetFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -10330,7 +10330,7 @@ ListFeedsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; @@ -10734,9 +10734,9 @@ UpdateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feed != null && message.hasOwnProperty("feed")) + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + 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; }; @@ -10945,7 +10945,7 @@ DeleteFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -11146,7 +11146,7 @@ OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -11357,7 +11357,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); return writer; }; @@ -11548,7 +11548,7 @@ PubsubDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); return writer; }; @@ -11749,7 +11749,7 @@ FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + if (message.pubsubDestination != null && Object.hasOwnProperty.call(message, "pubsubDestination")) $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -11984,7 +11984,7 @@ Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.assetNames != null && message.assetNames.length) for (var i = 0; i < message.assetNames.length; ++i) @@ -11992,9 +11992,9 @@ if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + if (message.feedOutputConfig != null && Object.hasOwnProperty.call(message, "feedOutputConfig")) $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -12226,7 +12226,7 @@ /** * ContentType enum. * @name google.cloud.asset.v1p2beta1.ContentType - * @enum {string} + * @enum {number} * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value * @property {number} RESOURCE=1 RESOURCE value * @property {number} IAM_POLICY=2 IAM_POLICY value @@ -12313,11 +12313,11 @@ TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) + if (message.window != null && Object.hasOwnProperty.call(message, "window")) $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -12546,9 +12546,9 @@ TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + 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 && message.hasOwnProperty("endTime")) + 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; }; @@ -12794,13 +12794,13 @@ Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.ancestors != null && message.ancestors.length) for (var i = 0; i < message.ancestors.length; ++i) @@ -13105,17 +13105,17 @@ Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) + if (message.data != null && Object.hasOwnProperty.call(message, "data")) $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -13503,13 +13503,13 @@ IamPolicyAnalysisQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + if (message.identitySelector != null && Object.hasOwnProperty.call(message, "identitySelector")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + if (message.accessSelector != null && Object.hasOwnProperty.call(message, "accessSelector")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -13742,7 +13742,7 @@ ResourceSelector.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); return writer; }; @@ -13929,7 +13929,7 @@ IdentitySelector.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.identity != null && message.hasOwnProperty("identity")) + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity); return writer; }; @@ -14370,9 +14370,9 @@ AnalyzeIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -14632,19 +14632,19 @@ Options.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (message.expandGroups != null && Object.hasOwnProperty.call(message, "expandGroups")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); - if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (message.expandRoles != null && Object.hasOwnProperty.call(message, "expandRoles")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); - if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (message.expandResources != null && Object.hasOwnProperty.call(message, "expandResources")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); - if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (message.outputResourceEdges != null && Object.hasOwnProperty.call(message, "outputResourceEdges")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); - if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (message.outputGroupEdges != null && Object.hasOwnProperty.call(message, "outputGroupEdges")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); - if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (message.analyzeServiceAccountImpersonation != null && Object.hasOwnProperty.call(message, "analyzeServiceAccountImpersonation")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); - if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -14935,12 +14935,12 @@ AnalyzeIamPolicyResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + if (message.mainAnalysis != null && Object.hasOwnProperty.call(message, "mainAnalysis")) $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.mainAnalysis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.serviceAccountImpersonationAnalysis != null && message.serviceAccountImpersonationAnalysis.length) for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); if (message.nonCriticalErrors != null && message.nonCriticalErrors.length) for (var i = 0; i < message.nonCriticalErrors.length; ++i) @@ -15225,12 +15225,12 @@ IamPolicyAnalysis.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.analysisResults != null && message.analysisResults.length) for (var i = 0; i < message.analysisResults.length; ++i) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); return writer; }; @@ -15482,7 +15482,7 @@ IamPolicyAnalysisOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -15676,7 +15676,7 @@ GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); return writer; }; @@ -15884,11 +15884,11 @@ ExportIamPolicyAnalysisRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -16155,17 +16155,17 @@ Options.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (message.expandGroups != null && Object.hasOwnProperty.call(message, "expandGroups")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); - if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (message.expandRoles != null && Object.hasOwnProperty.call(message, "expandRoles")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); - if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (message.expandResources != null && Object.hasOwnProperty.call(message, "expandResources")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); - if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (message.outputResourceEdges != null && Object.hasOwnProperty.call(message, "outputResourceEdges")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); - if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (message.outputGroupEdges != null && Object.hasOwnProperty.call(message, "outputGroupEdges")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); - if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (message.analyzeServiceAccountImpersonation != null && Object.hasOwnProperty.call(message, "analyzeServiceAccountImpersonation")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); return writer; }; @@ -16411,7 +16411,7 @@ ExportIamPolicyAnalysisResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -16640,16 +16640,16 @@ IamPolicyAnalysisResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + if (message.attachedResourceFullName != null && Object.hasOwnProperty.call(message, "attachedResourceFullName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); - if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + if (message.iamBinding != null && Object.hasOwnProperty.call(message, "iamBinding")) $root.google.iam.v1.Binding.encode(message.iamBinding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.accessControlLists != null && message.accessControlLists.length) for (var i = 0; i < message.accessControlLists.length; ++i) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.identityList != null && message.hasOwnProperty("identityList")) + if (message.identityList != null && Object.hasOwnProperty.call(message, "identityList")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fullyExplored); return writer; }; @@ -16917,9 +16917,9 @@ AnalysisState.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.cause != null && message.hasOwnProperty("cause")) + if (message.cause != null && Object.hasOwnProperty.call(message, "cause")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); return writer; }; @@ -17215,9 +17215,9 @@ Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); - if (message.analysisState != null && message.hasOwnProperty("analysisState")) + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -17453,11 +17453,11 @@ Access.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.permission != null && message.hasOwnProperty("permission")) + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); - if (message.analysisState != null && message.hasOwnProperty("analysisState")) + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -17691,9 +17691,9 @@ Edge.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + if (message.sourceNode != null && Object.hasOwnProperty.call(message, "sourceNode")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); - if (message.targetNode != null && message.hasOwnProperty("targetNode")) + if (message.targetNode != null && Object.hasOwnProperty.call(message, "targetNode")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetNode); return writer; }; @@ -17901,9 +17901,9 @@ Identity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.analysisState != null && message.hasOwnProperty("analysisState")) + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -18749,19 +18749,19 @@ Policy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.constraint != null && message.hasOwnProperty("constraint")) + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + 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.listPolicy != null && message.hasOwnProperty("listPolicy")) + if (message.listPolicy != null && Object.hasOwnProperty.call(message, "listPolicy")) $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.encode(message.listPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) + if (message.booleanPolicy != null && Object.hasOwnProperty.call(message, "booleanPolicy")) $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.encode(message.booleanPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) + if (message.restoreDefault != null && Object.hasOwnProperty.call(message, "restoreDefault")) $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.encode(message.restoreDefault, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -19105,11 +19105,11 @@ if (message.deniedValues != null && message.deniedValues.length) for (var i = 0; i < message.deniedValues.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); - if (message.allValues != null && message.hasOwnProperty("allValues")) + if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.allValues); - if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + if (message.suggestedValue != null && Object.hasOwnProperty.call(message, "suggestedValue")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.suggestedValue); - if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (message.inheritFromParent != null && Object.hasOwnProperty.call(message, "inheritFromParent")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inheritFromParent); return writer; }; @@ -19333,7 +19333,7 @@ /** * AllValues enum. * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues - * @enum {string} + * @enum {number} * @property {number} ALL_VALUES_UNSPECIFIED=0 ALL_VALUES_UNSPECIFIED value * @property {number} ALLOW=1 ALLOW value * @property {number} DENY=2 DENY value @@ -19405,7 +19405,7 @@ BooleanPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enforced != null && message.hasOwnProperty("enforced")) + if (message.enforced != null && Object.hasOwnProperty.call(message, "enforced")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enforced); return writer; }; @@ -19786,7 +19786,7 @@ 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -20100,26 +20100,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + 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 && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -20476,9 +20476,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -20624,7 +20624,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -20745,18 +20745,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + 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 && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -20976,7 +20976,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @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 @@ -21057,9 +21057,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -21584,9 +21584,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + 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) @@ -21603,9 +21603,9 @@ 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 && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("sourceCodeInfo")) + 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) @@ -21613,7 +21613,7 @@ 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 && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -22151,7 +22151,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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) @@ -22168,7 +22168,7 @@ 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 && message.hasOwnProperty("options")) + 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) @@ -22633,11 +22633,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -22861,9 +22861,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -23354,25 +23354,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -23719,7 +23719,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @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 @@ -23765,7 +23765,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @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 @@ -23846,9 +23846,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -24091,12 +24091,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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) @@ -24399,9 +24399,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -24621,11 +24621,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -24859,12 +24859,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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; }; @@ -25144,17 +25144,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -25593,45 +25593,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + 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) @@ -26058,7 +26058,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -26176,18 +26176,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + 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 && message.hasOwnProperty(".google.api.resource")) + 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; }; @@ -26529,17 +26529,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + 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) @@ -26550,7 +26550,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + 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; }; @@ -26886,7 +26886,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -26902,7 +26902,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @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 @@ -27201,9 +27201,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -27446,7 +27446,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -27695,14 +27695,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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 && message.hasOwnProperty(".google.api.defaultHost")) + 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 && message.hasOwnProperty(".google.api.oauthScopes")) + 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; }; @@ -27990,19 +27990,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + 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 && message.hasOwnProperty(".google.longrunning.operationInfo")) + 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 && message.hasOwnProperty(".google.api.http")) + 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; }; @@ -28252,7 +28252,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @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 @@ -28382,17 +28382,17 @@ 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 && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -29169,9 +29169,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + 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) @@ -29702,11 +29702,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -30119,9 +30119,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -30343,9 +30343,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + 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 && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -30554,7 +30554,7 @@ Struct.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fields != null && message.hasOwnProperty("fields")) + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); @@ -30827,17 +30827,17 @@ Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nullValue != null && message.hasOwnProperty("nullValue")) + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && message.hasOwnProperty("numberValue")) + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && message.hasOwnProperty("boolValue")) + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && message.hasOwnProperty("structValue")) + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && message.hasOwnProperty("listValue")) + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -31080,7 +31080,7 @@ /** * NullValue enum. * @name google.protobuf.NullValue - * @enum {string} + * @enum {number} * @property {number} NULL_VALUE=0 NULL_VALUE value */ protobuf.NullValue = (function() { @@ -31362,9 +31362,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -31820,9 +31820,9 @@ Policy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) @@ -32083,12 +32083,12 @@ Binding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); if (message.members != null && message.members.length) for (var i = 0; i < message.members.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && message.hasOwnProperty("condition")) + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -32597,13 +32597,13 @@ BindingDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && message.hasOwnProperty("member")) + if (message.member != null && Object.hasOwnProperty.call(message, "member")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && message.hasOwnProperty("condition")) + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -32791,7 +32791,7 @@ /** * Action enum. * @name google.iam.v1.BindingDelta.Action - * @enum {string} + * @enum {number} * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value * @property {number} ADD=1 ADD value * @property {number} REMOVE=2 REMOVE value @@ -32890,13 +32890,13 @@ AuditConfigDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && message.hasOwnProperty("service")) + if (message.service != null && Object.hasOwnProperty.call(message, "service")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); return writer; }; @@ -33079,7 +33079,7 @@ /** * Action enum. * @name google.iam.v1.AuditConfigDelta.Action - * @enum {string} + * @enum {number} * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value * @property {number} ADD=1 ADD value * @property {number} REMOVE=2 REMOVE value @@ -33193,13 +33193,13 @@ Expr.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expression != null && message.hasOwnProperty("expression")) + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); return writer; }; @@ -33518,19 +33518,19 @@ AccessLevel.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.basic != null && message.hasOwnProperty("basic")) + if (message.basic != null && Object.hasOwnProperty.call(message, "basic")) $root.google.identity.accesscontextmanager.v1.BasicLevel.encode(message.basic, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.custom != null && message.hasOwnProperty("custom")) + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.identity.accesscontextmanager.v1.CustomLevel.encode(message.custom, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -33830,7 +33830,7 @@ if (message.conditions != null && message.conditions.length) for (var i = 0; i < message.conditions.length; ++i) $root.google.identity.accesscontextmanager.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + if (message.combiningFunction != null && Object.hasOwnProperty.call(message, "combiningFunction")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.combiningFunction); return writer; }; @@ -34005,7 +34005,7 @@ /** * ConditionCombiningFunction enum. * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction - * @enum {string} + * @enum {number} * @property {number} AND=0 AND value * @property {number} OR=1 OR value */ @@ -34127,12 +34127,12 @@ if (message.ipSubnetworks != null && message.ipSubnetworks.length) for (var i = 0; i < message.ipSubnetworks.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipSubnetworks[i]); - if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + if (message.devicePolicy != null && Object.hasOwnProperty.call(message, "devicePolicy")) $root.google.identity.accesscontextmanager.v1.DevicePolicy.encode(message.devicePolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requiredAccessLevels != null && message.requiredAccessLevels.length) for (var i = 0; i < message.requiredAccessLevels.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.requiredAccessLevels[i]); - if (message.negate != null && message.hasOwnProperty("negate")) + if (message.negate != null && Object.hasOwnProperty.call(message, "negate")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.negate); if (message.members != null && message.members.length) for (var i = 0; i < message.members.length; ++i) @@ -34444,7 +34444,7 @@ CustomLevel.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expr != null && message.hasOwnProperty("expr")) + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) $root.google.type.Expr.encode(message.expr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -34684,7 +34684,7 @@ DevicePolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + if (message.requireScreenlock != null && Object.hasOwnProperty.call(message, "requireScreenlock")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireScreenlock); if (message.allowedEncryptionStatuses != null && message.allowedEncryptionStatuses.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); @@ -34701,9 +34701,9 @@ writer.int32(message.allowedDeviceManagementLevels[i]); writer.ldelim(); } - if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + if (message.requireAdminApproval != null && Object.hasOwnProperty.call(message, "requireAdminApproval")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requireAdminApproval); - if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + if (message.requireCorpOwned != null && Object.hasOwnProperty.call(message, "requireCorpOwned")) writer.uint32(/* id 8, wireType 0 =*/64).bool(message.requireCorpOwned); return writer; }; @@ -35073,11 +35073,11 @@ OsConstraint.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.osType != null && message.hasOwnProperty("osType")) + if (message.osType != null && Object.hasOwnProperty.call(message, "osType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.osType); - if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + if (message.minimumVersion != null && Object.hasOwnProperty.call(message, "minimumVersion")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.minimumVersion); - if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + if (message.requireVerifiedChromeOs != null && Object.hasOwnProperty.call(message, "requireVerifiedChromeOs")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireVerifiedChromeOs); return writer; }; @@ -35370,17 +35370,17 @@ AccessPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); return writer; }; @@ -35705,23 +35705,23 @@ ServicePerimeter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + if (message.perimeterType != null && Object.hasOwnProperty.call(message, "perimeterType")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.perimeterType); - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.spec != null && message.hasOwnProperty("spec")) + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.spec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + if (message.useExplicitDryRunSpec != null && Object.hasOwnProperty.call(message, "useExplicitDryRunSpec")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useExplicitDryRunSpec); return writer; }; @@ -35974,7 +35974,7 @@ /** * PerimeterType enum. * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType - * @enum {string} + * @enum {number} * @property {number} PERIMETER_TYPE_REGULAR=0 PERIMETER_TYPE_REGULAR value * @property {number} PERIMETER_TYPE_BRIDGE=1 PERIMETER_TYPE_BRIDGE value */ @@ -36083,7 +36083,7 @@ if (message.restrictedServices != null && message.restrictedServices.length) for (var i = 0; i < message.restrictedServices.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.restrictedServices[i]); - if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + if (message.vpcAccessibleServices != null && Object.hasOwnProperty.call(message, "vpcAccessibleServices")) $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.encode(message.vpcAccessibleServices, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -36359,7 +36359,7 @@ VpcAccessibleServices.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + if (message.enableRestriction != null && Object.hasOwnProperty.call(message, "enableRestriction")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRestriction); if (message.allowedServices != null && message.allowedServices.length) for (var i = 0; i < message.allowedServices.length; ++i) @@ -36537,7 +36537,7 @@ /** * DeviceEncryptionStatus enum. * @name google.identity.accesscontextmanager.type.DeviceEncryptionStatus - * @enum {string} + * @enum {number} * @property {number} ENCRYPTION_UNSPECIFIED=0 ENCRYPTION_UNSPECIFIED value * @property {number} ENCRYPTION_UNSUPPORTED=1 ENCRYPTION_UNSUPPORTED value * @property {number} UNENCRYPTED=2 UNENCRYPTED value @@ -36555,7 +36555,7 @@ /** * OsType enum. * @name google.identity.accesscontextmanager.type.OsType - * @enum {string} + * @enum {number} * @property {number} OS_UNSPECIFIED=0 OS_UNSPECIFIED value * @property {number} DESKTOP_MAC=1 DESKTOP_MAC value * @property {number} DESKTOP_WINDOWS=2 DESKTOP_WINDOWS value @@ -36579,7 +36579,7 @@ /** * DeviceManagementLevel enum. * @name google.identity.accesscontextmanager.type.DeviceManagementLevel - * @enum {string} + * @enum {number} * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value * @property {number} NONE=1 NONE value * @property {number} BASIC=2 BASIC value @@ -36918,15 +36918,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + 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 && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + 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 && message.hasOwnProperty("response")) + 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; }; @@ -37186,7 +37186,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -37400,13 +37400,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -37640,7 +37640,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -37858,7 +37858,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -38045,7 +38045,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -38241,9 +38241,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + 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; }; @@ -38456,9 +38456,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -38688,9 +38688,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + 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) @@ -38870,7 +38870,7 @@ /** * Code enum. * @name google.rpc.Code - * @enum {string} + * @enum {number} * @property {number} OK=0 OK value * @property {number} CANCELLED=1 CANCELLED value * @property {number} UNKNOWN=2 UNKNOWN value diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 333595a3c6d..f8bc338d5d0 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "03a1788722ba9496cbbec327dbc3bd8a2c39495e" + "sha": "9f9363a59a608bcd43b218b71685d54c07ecb67b" } }, { From adfc706b397ee7c8a1e7aaecba3a715cdd903cad Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:29:03 -0700 Subject: [PATCH 213/429] chore: update npm scripts and synth.py (#322) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-cloud-asset/package.json | 5 +++-- packages/google-cloud-asset/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index e1caa8e8ead..c3d5a742a1c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -35,12 +35,13 @@ "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts fix", + "lint": "gts check", "predocs-test": "npm run docs", "prepare": "npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 21340c08b39..2aafb831925 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -16,7 +16,7 @@ import json import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -64,7 +64,4 @@ with open(file, 'w') as f: f.write(new_file) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library() From b8b9c3d4183076939ca2c9a63b3d47ec85e36c18 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Apr 2020 14:12:36 -0700 Subject: [PATCH 214/429] feat: added support for project id, order_by in SearchAllResources, search on location, labels and networkTags field --- .../cloud/asset/v1p1beta1/asset_service.proto | 11 +- .../google/cloud/asset/v1p1beta1/assets.proto | 44 +- .../google-cloud-asset/protos/protos.d.ts | 213 +++++++ packages/google-cloud-asset/protos/protos.js | 576 +++++++++++++++++- .../google-cloud-asset/protos/protos.json | 45 ++ .../src/v1p1beta1/asset_service_client.ts | 21 + packages/google-cloud-asset/synth.metadata | 6 +- 7 files changed, 905 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto index c75ce7adf0e..d5a0d8c41b7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // 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"; @@ -68,6 +67,7 @@ message SearchAllResourcesRequest { // * Organization number (such as "organizations/123") // * Folder number(such as "folders/1234") // * Project number (such as "projects/12345") + // * Project id (such as "projects/abc") string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The query statement. @@ -88,6 +88,12 @@ message SearchAllResourcesRequest { // the previous response. The values of all other method parameters, must be // identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " desc" after the field name + // to indicate descending order. Redundant space characters are ignored. For + // example, " foo , bar desc ". + string order_by = 10 [(google.api.field_behavior) = OPTIONAL]; } // Search all resources response. @@ -108,6 +114,7 @@ message SearchAllIamPoliciesRequest { // * Organization number (such as "organizations/123") // * Folder number(such as "folders/1234") // * Project number (such as "projects/12345") + // * Project id (such as "projects/abc") string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The query statement. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto index ff0b927b13a..549ea688ba9 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // 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"; @@ -56,10 +55,35 @@ message StandardResourceMetadata { // Informational only. The exact set of attributes is subject to change. // For example: project id, DNS name etc. repeated string additional_attributes = 10; + + // Location can be "global", regional like "us-east1", or zonal like + // "us-west1-b". + string location = 11; + + // Labels associated with this resource. See [Labelling and grouping GCP + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + map labels = 12; + + // Network tags associated with this resource. Like labels, network tags are a + // type of annotations used to group GCP resources. See [Labelling GCP + // resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + repeated string network_tags = 13; } // The result for a IAM Policy search. message IamPolicySearchResult { + // Explanation about the IAM policy search result. + message Explanation { + // The map from roles to their included permission matching the permission + // query (e.g. containing `policy.role.permissions:`). A sample role string: + // "roles/compute.instanceAdmin". The roles can also be found in the + // returned `policy` bindings. Note that the map is populated only if + // requesting with a permission query. + map matched_permissions = 1; + } + // The [full resource // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) // of the resource associated with this IAM policy. @@ -72,7 +96,19 @@ message IamPolicySearchResult { // orgnization, the project field will be empty. string project = 3; - // Representation of the actual Cloud IAM policy set on a cloud resource. For - // each resource, there must be at most one Cloud IAM policy set on it. + // The IAM policy directly set on the given resource. Note that the original + // IAM policy can contain multiple bindings. This only contains the bindings + // that match the given query. For queries that don't contain a constrain on + // policies (e.g. an empty query), this contains all the bindings. google.iam.v1.Policy policy = 4; + + // Explanation about the IAM policy search result. It contains additional + // information to explain why the search result matches the query. + Explanation explanation = 5; +} + +// IAM permissions +message Permissions { + // A list of permissions. A sample permission string: "compute.disk.get". + repeated string permissions = 1; } diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index c2c1c071118..5ab4595fec4 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -3418,6 +3418,9 @@ export namespace google { /** SearchAllResourcesRequest pageToken */ pageToken?: (string|null); + + /** SearchAllResourcesRequest orderBy */ + orderBy?: (string|null); } /** Represents a SearchAllResourcesRequest. */ @@ -3444,6 +3447,9 @@ export namespace google { /** SearchAllResourcesRequest pageToken. */ public pageToken: string; + /** SearchAllResourcesRequest orderBy. */ + public orderBy: string; + /** * Creates a new SearchAllResourcesRequest instance using the specified properties. * @param [properties] Properties to set @@ -3835,6 +3841,15 @@ export namespace google { /** StandardResourceMetadata additionalAttributes */ additionalAttributes?: (string[]|null); + + /** StandardResourceMetadata location */ + location?: (string|null); + + /** StandardResourceMetadata labels */ + labels?: ({ [k: string]: string }|null); + + /** StandardResourceMetadata networkTags */ + networkTags?: (string[]|null); } /** Represents a StandardResourceMetadata. */ @@ -3864,6 +3879,15 @@ export namespace google { /** StandardResourceMetadata additionalAttributes. */ public additionalAttributes: string[]; + /** StandardResourceMetadata location. */ + public location: string; + + /** StandardResourceMetadata labels. */ + public labels: { [k: string]: string }; + + /** StandardResourceMetadata networkTags. */ + public networkTags: string[]; + /** * Creates a new StandardResourceMetadata instance using the specified properties. * @param [properties] Properties to set @@ -3946,6 +3970,9 @@ export namespace google { /** IamPolicySearchResult policy */ policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null); } /** Represents an IamPolicySearchResult. */ @@ -3966,6 +3993,9 @@ export namespace google { /** IamPolicySearchResult policy. */ public policy?: (google.iam.v1.IPolicy|null); + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null); + /** * Creates a new IamPolicySearchResult instance using the specified properties. * @param [properties] Properties to set @@ -4036,6 +4066,189 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1p1beta1.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1p1beta1.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @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.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @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.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IPermissions): google.cloud.asset.v1p1beta1.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.asset.v1p1beta1.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.asset.v1p1beta1.Permissions; + + /** + * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace v1p2beta1. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 57ca9203e2f..c3fada77a62 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -8088,6 +8088,7 @@ * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken + * @property {string|null} [orderBy] SearchAllResourcesRequest orderBy */ /** @@ -8146,6 +8147,14 @@ */ SearchAllResourcesRequest.prototype.pageToken = ""; + /** + * SearchAllResourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.orderBy = ""; + /** * Creates a new SearchAllResourcesRequest instance using the specified properties. * @function create @@ -8181,6 +8190,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.orderBy); return writer; }; @@ -8232,6 +8243,9 @@ case 5: message.pageToken = reader.string(); break; + case 10: + message.orderBy = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -8286,6 +8300,9 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; @@ -8316,6 +8333,8 @@ message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; @@ -8339,6 +8358,7 @@ object.query = ""; object.pageSize = 0; object.pageToken = ""; + object.orderBy = ""; } if (message.scope != null && message.hasOwnProperty("scope")) object.scope = message.scope; @@ -8353,6 +8373,8 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; @@ -9098,6 +9120,9 @@ * @property {string|null} [displayName] StandardResourceMetadata displayName * @property {string|null} [description] StandardResourceMetadata description * @property {Array.|null} [additionalAttributes] StandardResourceMetadata additionalAttributes + * @property {string|null} [location] StandardResourceMetadata location + * @property {Object.|null} [labels] StandardResourceMetadata labels + * @property {Array.|null} [networkTags] StandardResourceMetadata networkTags */ /** @@ -9110,6 +9135,8 @@ */ function StandardResourceMetadata(properties) { this.additionalAttributes = []; + this.labels = {}; + this.networkTags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9164,6 +9191,30 @@ */ StandardResourceMetadata.prototype.additionalAttributes = $util.emptyArray; + /** + * StandardResourceMetadata location. + * @member {string} location + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.location = ""; + + /** + * StandardResourceMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.labels = $util.emptyObject; + + /** + * StandardResourceMetadata networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.networkTags = $util.emptyArray; + /** * Creates a new StandardResourceMetadata instance using the specified properties. * @function create @@ -9201,6 +9252,14 @@ if (message.additionalAttributes != null && message.additionalAttributes.length) for (var i = 0; i < message.additionalAttributes.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.additionalAttributes[i]); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.location); + 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 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.networkTags[i]); return writer; }; @@ -9231,7 +9290,7 @@ StandardResourceMetadata.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.asset.v1p1beta1.StandardResourceMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9255,6 +9314,22 @@ message.additionalAttributes = []; message.additionalAttributes.push(reader.string()); break; + case 11: + message.location = reader.string(); + break; + case 12: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 13: + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -9312,6 +9387,24 @@ if (!$util.isString(message.additionalAttributes[i])) return "additionalAttributes: string[] expected"; } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } return null; }; @@ -9344,6 +9437,22 @@ for (var i = 0; i < object.additionalAttributes.length; ++i) message.additionalAttributes[i] = String(object.additionalAttributes[i]); } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.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.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } return message; }; @@ -9360,14 +9469,19 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.additionalAttributes = []; + object.networkTags = []; + } + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { object.name = ""; object.assetType = ""; object.project = ""; object.displayName = ""; object.description = ""; + object.location = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -9384,6 +9498,19 @@ for (var j = 0; j < message.additionalAttributes.length; ++j) object.additionalAttributes[j] = message.additionalAttributes[j]; } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } return object; }; @@ -9410,6 +9537,7 @@ * @property {string|null} [resource] IamPolicySearchResult resource * @property {string|null} [project] IamPolicySearchResult project * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation */ /** @@ -9451,6 +9579,14 @@ */ IamPolicySearchResult.prototype.policy = null; + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; + /** * Creates a new IamPolicySearchResult instance using the specified properties. * @function create @@ -9481,6 +9617,8 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -9524,6 +9662,9 @@ case 4: message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; + case 5: + message.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -9570,6 +9711,11 @@ if (error) return "policy." + error; } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } return null; }; @@ -9594,6 +9740,11 @@ throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.policy: object expected"); message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } return message; }; @@ -9614,6 +9765,7 @@ object.resource = ""; object.project = ""; object.policy = null; + object.explanation = null; } if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; @@ -9621,6 +9773,8 @@ object.project = message.project; if (message.policy != null && message.hasOwnProperty("policy")) object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); return object; }; @@ -9635,9 +9789,427 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + IamPolicySearchResult.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + this.matchedPermissions = {}; + 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]]; + } + + /** + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @instance + */ + Explanation.prototype.matchedPermissions = $util.emptyObject; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1p1beta1.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.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.asset.v1p1beta1.IamPolicySearchResult.Explanation(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + key = reader.string(); + reader.pos++; + message.matchedPermissions[key] = $root.google.cloud.asset.v1p1beta1.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.Permissions.verify(message.matchedPermissions[key[i]]); + if (error) + return "matchedPermissions." + error; + } + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1p1beta1.Permissions.fromObject(object.matchedPermissions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1p1beta1.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Explanation; + })(); + return IamPolicySearchResult; })(); + v1p1beta1.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1p1beta1.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + this.permissions = []; + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.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.asset.v1p1beta1.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.Permissions) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1p1beta1.Permissions.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Permissions; + })(); + return v1p1beta1; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 6a6fcdc3c29..6950b05a552 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -818,6 +818,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "orderBy": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -905,6 +912,20 @@ "rule": "repeated", "type": "string", "id": 10 + }, + "location": { + "type": "string", + "id": 11 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 12 + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 13 } } }, @@ -921,6 +942,30 @@ "policy": { "type": "google.iam.v1.Policy", "id": 4 + }, + "explanation": { + "type": "Explanation", + "id": 5 + } + }, + "nested": { + "Explanation": { + "fields": { + "matchedPermissions": { + "keyType": "string", + "type": "Permissions", + "id": 1 + } + } + } + } + }, + "Permissions": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 } } } diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 19f607c3c0e..e4d5eb5ddd1 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -342,6 +342,7 @@ export class AssetServiceClient { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * @param {string} [request.query] * Optional. The query statement. * @param {string[]} [request.assetTypes] @@ -357,6 +358,11 @@ export class AssetServiceClient { * to this method. `page_token` must be the value of `next_page_token` from * the previous response. The values of all other method parameters, must be * identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " desc" after the field name + * to indicate descending order. Redundant space characters are ignored. For + * example, " foo , bar desc ". * @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. @@ -441,6 +447,7 @@ export class AssetServiceClient { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * @param {string} [request.query] * Optional. The query statement. * @param {string[]} [request.assetTypes] @@ -456,6 +463,11 @@ export class AssetServiceClient { * to this method. `page_token` must be the value of `next_page_token` from * the previous response. The values of all other method parameters, must be * identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " desc" after the field name + * to indicate descending order. Redundant space characters are ignored. For + * example, " foo , bar desc ". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -496,6 +508,7 @@ export class AssetServiceClient { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * @param {string} [request.query] * Optional. The query statement. * @param {string[]} [request.assetTypes] @@ -511,6 +524,11 @@ export class AssetServiceClient { * to this method. `page_token` must be the value of `next_page_token` from * the previous response. The values of all other method parameters, must be * identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " desc" after the field name + * to indicate descending order. Redundant space characters are ignored. For + * example, " foo , bar desc ". * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -589,6 +607,7 @@ export class AssetServiceClient { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * @param {string} [request.query] * Optional. The query statement. * Examples: @@ -688,6 +707,7 @@ export class AssetServiceClient { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * @param {string} [request.query] * Optional. The query statement. * Examples: @@ -743,6 +763,7 @@ export class AssetServiceClient { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * @param {string} [request.query] * Optional. The query statement. * Examples: diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f8bc338d5d0..e301403ed67 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "9f9363a59a608bcd43b218b71685d54c07ecb67b" + "sha": "972750658188f9761fdc296157b689e7b96915e4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "sha": "3f5f8a2258c6a41f9fbf7b80acbca631dda0a952", + "internalRef": "308922843" } }, { From 1d0806548d59020e5dd4c3df8ec978ab7d062cdf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 May 2020 06:52:44 +0200 Subject: [PATCH 215/429] fix(deps): update dependency uuid to v8 (#325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | dependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/uuid/7.0.3/8.0.0) | --- ### Release Notes
uuidjs/uuid ### [`v8.0.0`](https://togithub.com/uuidjs/uuid/blob/master/CHANGELOG.md#​800-httpsgithubcomuuidjsuuidcomparev703v800-2020-04-29) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) ##### ⚠ BREAKING CHANGES - For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. ```diff -import uuid from 'uuid'; -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` - Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. Instead use the named exports that this module exports. For ECMAScript Modules (ESM): ```diff -import uuidv4 from 'uuid/v4'; +import { v4 as uuidv4 } from 'uuid'; uuidv4(); ``` For CommonJS: ```diff -const uuidv4 = require('uuid/v4'); +const { v4: uuidv4 } = require('uuid'); uuidv4(); ``` ##### Features - native Node.js ES Modules (wrapper approach) ([#​423](https://togithub.com/uuidjs/uuid/issues/423)) ([2d9f590](https://togithub.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#​245](https://togithub.com/uuidjs/uuid/issues/245) [#​419](https://togithub.com/uuidjs/uuid/issues/419) [#​342](https://togithub.com/uuidjs/uuid/issues/342) - remove deep requires ([#​426](https://togithub.com/uuidjs/uuid/issues/426)) ([daf72b8](https://togithub.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ##### Bug Fixes - add CommonJS syntax example to README quickstart section ([#​417](https://togithub.com/uuidjs/uuid/issues/417)) ([e0ec840](https://togithub.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) ##### [7.0.3](https://togithub.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) ##### Bug Fixes - make deep require deprecation warning work in browsers ([#​409](https://togithub.com/uuidjs/uuid/issues/409)) ([4b71107](https://togithub.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#​408](https://togithub.com/uuidjs/uuid/issues/408) ##### [7.0.2](https://togithub.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ##### Bug Fixes - make access to msCrypto consistent ([#​393](https://togithub.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://togithub.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) - simplify link in deprecation warning ([#​391](https://togithub.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://togithub.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) - update links to match content in readme ([#​386](https://togithub.com/uuidjs/uuid/issues/386)) ([44f2f86](https://togithub.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) ##### [7.0.1](https://togithub.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) ##### Bug Fixes - clean up esm builds for node and browser ([#​383](https://togithub.com/uuidjs/uuid/issues/383)) ([59e6a49](https://togithub.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) - provide browser versions independent from module system ([#​380](https://togithub.com/uuidjs/uuid/issues/380)) ([4344a22](https://togithub.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#​378](https://togithub.com/uuidjs/uuid/issues/378)
--- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 7ebd14d2fb5..a1e245fbee6 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -17,7 +17,7 @@ "dependencies": { "@google-cloud/asset": "^3.0.0", "@google-cloud/storage": "^4.0.0", - "uuid": "^7.0.0", + "uuid": "^8.0.0", "yargs": "^15.0.0" }, "devDependencies": { From ed7c52f40cb9d3b9379f9257136f209feec8da28 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Mon, 4 May 2020 17:03:06 -0700 Subject: [PATCH 216/429] fix: synth.py clean up for multiple version (#326) --- packages/google-cloud-asset/src/index.ts | 16 ++++++------- packages/google-cloud-asset/synth.metadata | 10 ++++---- packages/google-cloud-asset/synth.py | 27 +++++++++++++--------- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index d10510bfa80..41d52a5b663 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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,22 +12,22 @@ // 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 v1 from './v1'; import * as v1beta1 from './v1beta1'; +import * as v1 from './v1'; import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; import * as v1p4beta1 from './v1p4beta1'; + const AssetServiceClient = v1.AssetServiceClient; -export {v1, v1beta1, v1p1beta1, v1p4beta1, v1p2beta1, AssetServiceClient}; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export + +export {v1beta1, v1, v1p1beta1, v1p2beta1, v1p4beta1, AssetServiceClient}; export default { - v1, v1beta1, + v1, v1p1beta1, v1p2beta1, v1p4beta1, diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e301403ed67..3a052a12d25 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "972750658188f9761fdc296157b689e7b96915e4" + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "8d72abc44abe6fb805190cf49bcb2f692d77c407" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3f5f8a2258c6a41f9fbf7b80acbca631dda0a952", - "internalRef": "308922843" + "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", + "internalRef": "309824146" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "a2c1c4f89a5e220e7b39420ebea33623c7c72804" } } ], diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 2aafb831925..c0564882971 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -37,31 +37,36 @@ }, # This API has dependencies outside of its own folder so we list them here. # Switching to bazel build should help get rid of this. - extra_proto_files=['google/cloud/common_resources.proto', 'google/cloud/orgpolicy/v1', 'google/identity/accesscontextmanager'], + extra_proto_files=['google/cloud/common_resources.proto', + 'google/cloud/orgpolicy/v1', 'google/identity/accesscontextmanager'], version=version), # skip index, protos, package.json, and README.md s.copy( library, - excludes=['package.json', 'src/index.ts'] + excludes=['package.json'] ) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') +templates = common_templates.node_library( + source_location='build/src', versions=versions, default_version='v1') s.copy(templates) # Extra proto dependencies make the *_proto_list.json have some common files # that conflict with the same common files imported from gax. This is likely # a generator problem that needs to be fixed when we start handling synth.py # custom fixes. -proto_lists=[f'src/{version}/asset_service_proto_list.json' for version in versions] -remove_proto_keywords=['/google/api', '/google/protobuf', '/google/rpc', '/google/type'] +proto_lists = [ + f'src/{version}/asset_service_proto_list.json' for version in versions] +remove_proto_keywords = ['/google/api', + '/google/protobuf', '/google/rpc', '/google/type'] for file in proto_lists: - with open(file, 'r') as f: - items=json.load(f) - content =[item for item in items if all([(x not in item) for x in remove_proto_keywords])] - new_file=json.dumps(content, indent=2) + '\n' - with open(file, 'w') as f: - f.write(new_file) + with open(file, 'r') as f: + items = json.load(f) + content = [item for item in items if all( + [(x not in item) for x in remove_proto_keywords])] + new_file = json.dumps(content, indent=2) + '\n' + with open(file, 'w') as f: + f.write(new_file) node.postprocess_gapic_library() From 4991a0faabdaf98375488821b272ecd443cff4bc Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Tue, 5 May 2020 11:22:58 -0700 Subject: [PATCH 217/429] feat: clean proto list, add decoded function for longrunning method (#327) --- .../src/v1/asset_service_client.ts | 38 +++++++++- .../src/v1beta1/asset_service_client.ts | 38 +++++++++- .../src/v1p4beta1/asset_service_client.ts | 38 +++++++++- packages/google-cloud-asset/synth.metadata | 8 +- packages/google-cloud-asset/synth.py | 17 ----- .../test/gapic_asset_service_v1.ts | 75 ++++++++++++------- .../test/gapic_asset_service_v1beta1.ts | 55 +++++++++++--- .../test/gapic_asset_service_v1p1beta1.ts | 16 +--- .../test/gapic_asset_service_v1p2beta1.ts | 20 ++--- .../test/gapic_asset_service_v1p4beta1.ts | 58 +++++++++++--- 10 files changed, 267 insertions(+), 96 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 564a083b979..25c2f8893e1 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -28,7 +28,7 @@ import * as path from 'path'; import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -997,6 +997,42 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.exportAssets(request, options, callback); } + /** + * Check the status of the long running operation returned by the exportAssets() 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 checkExportAssetsProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkExportAssetsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.asset.v1.ExportAssetsResponse, + protos.google.cloud.asset.v1.ExportAssetsRequest + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.exportAssets, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.asset.v1.ExportAssetsResponse, + protos.google.cloud.asset.v1.ExportAssetsRequest + >; + } // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 8d3ddf744e2..672ea2cdf3c 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -28,7 +28,7 @@ import * as path from 'path'; import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -548,6 +548,42 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.exportAssets(request, options, callback); } + /** + * Check the status of the long running operation returned by the exportAssets() 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 checkExportAssetsProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkExportAssetsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.asset.v1beta1.ExportAssetsResponse, + protos.google.cloud.asset.v1beta1.ExportAssetsRequest + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.exportAssets, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.asset.v1beta1.ExportAssetsResponse, + protos.google.cloud.asset.v1beta1.ExportAssetsRequest + >; + } /** * Terminate the GRPC channel and close the client. diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index ca54273ad86..8b495973712 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -28,7 +28,7 @@ import * as path from 'path'; import * as protos from '../../protos/protos'; import * as gapicConfig from './asset_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -512,6 +512,42 @@ export class AssetServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the exportIamPolicyAnalysis() 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 checkExportIamPolicyAnalysisProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkExportIamPolicyAnalysisProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.exportIamPolicyAnalysis, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + >; + } /** * Terminate the GRPC channel and close the client. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 3a052a12d25..c0d32f18ba5 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "8d72abc44abe6fb805190cf49bcb2f692d77c407" + "sha": "321bc3ae0c187f29231037705a52ca4b805659ba" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", - "internalRef": "309824146" + "sha": "1b5a8d2bbb69c5a04db26bd546d2888e609c6bab", + "internalRef": "309845930" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a2c1c4f89a5e220e7b39420ebea33623c7c72804" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index c0564882971..36a8694f6fd 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -52,21 +52,4 @@ source_location='build/src', versions=versions, default_version='v1') s.copy(templates) -# Extra proto dependencies make the *_proto_list.json have some common files -# that conflict with the same common files imported from gax. This is likely -# a generator problem that needs to be fixed when we start handling synth.py -# custom fixes. -proto_lists = [ - f'src/{version}/asset_service_proto_list.json' for version in versions] -remove_proto_keywords = ['/google/api', - '/google/protobuf', '/google/rpc', '/google/type'] -for file in proto_lists: - with open(file, 'r') as f: - items = json.load(f) - content = [item for item in items if all( - [(x not in item) for x in remove_proto_keywords])] - new_file = json.dumps(content, indent=2) + '\n' - with open(file, 'w') as f: - f.write(new_file) - node.postprocess_gapic_library() diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 20591b0e74f..708f2acf973 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -23,7 +23,7 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as assetserviceModule from '../src'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -268,9 +268,10 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.batchGetAssetsHistory(request); - }, expectedError); + await assert.rejects( + client.batchGetAssetsHistory(request), + expectedError + ); assert( (client.innerApiCalls.batchGetAssetsHistory as SinonStub) .getCall(0) @@ -382,9 +383,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createFeed(request); - }, expectedError); + await assert.rejects(client.createFeed(request), expectedError); assert( (client.innerApiCalls.createFeed as SinonStub) .getCall(0) @@ -493,9 +492,7 @@ describe('v1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getFeed(request); - }, expectedError); + await assert.rejects(client.getFeed(request), expectedError); assert( (client.innerApiCalls.getFeed as SinonStub) .getCall(0) @@ -604,9 +601,7 @@ describe('v1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.listFeeds(request); - }, expectedError); + await assert.rejects(client.listFeeds(request), expectedError); assert( (client.innerApiCalls.listFeeds as SinonStub) .getCall(0) @@ -721,9 +716,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateFeed(request); - }, expectedError); + await assert.rejects(client.updateFeed(request), expectedError); assert( (client.innerApiCalls.updateFeed as SinonStub) .getCall(0) @@ -835,9 +828,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteFeed(request); - }, expectedError); + await assert.rejects(client.deleteFeed(request), expectedError); assert( (client.innerApiCalls.deleteFeed as SinonStub) .getCall(0) @@ -957,9 +948,7 @@ describe('v1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.exportAssets(request); - }, expectedError); + await assert.rejects(client.exportAssets(request), expectedError); assert( (client.innerApiCalls.exportAssets as SinonStub) .getCall(0) @@ -992,15 +981,51 @@ describe('v1.AssetServiceClient', () => { expectedError ); const [operation] = await client.exportAssets(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.exportAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkExportAssetsProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkExportAssetsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAssetsProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkExportAssetsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('Path templates', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts index ed4f37c7d9f..caf32c6fccb 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts @@ -23,7 +23,7 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as assetserviceModule from '../src'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -270,9 +270,10 @@ describe('v1beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.batchGetAssetsHistory(request); - }, expectedError); + await assert.rejects( + client.batchGetAssetsHistory(request), + expectedError + ); assert( (client.innerApiCalls.batchGetAssetsHistory as SinonStub) .getCall(0) @@ -392,9 +393,7 @@ describe('v1beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.exportAssets(request); - }, expectedError); + await assert.rejects(client.exportAssets(request), expectedError); assert( (client.innerApiCalls.exportAssets as SinonStub) .getCall(0) @@ -427,14 +426,50 @@ describe('v1beta1.AssetServiceClient', () => { expectedError ); const [operation] = await client.exportAssets(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.exportAssets as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkExportAssetsProgress without error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + 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.checkExportAssetsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAssetsProgress with error', async () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + 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.checkExportAssetsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); }); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index b887e4b39e6..0036e151588 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -319,9 +319,7 @@ describe('v1p1beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.searchAllResources(request); - }, expectedError); + await assert.rejects(client.searchAllResources(request), expectedError); assert( (client.innerApiCalls.searchAllResources as SinonStub) .getCall(0) @@ -422,9 +420,7 @@ describe('v1p1beta1.AssetServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.searchAllResources.createStream as SinonStub) .getCall(0) @@ -645,9 +641,7 @@ describe('v1p1beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.searchAllIamPolicies(request); - }, expectedError); + await assert.rejects(client.searchAllIamPolicies(request), expectedError); assert( (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) @@ -748,9 +742,7 @@ describe('v1p1beta1.AssetServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) .getCall(0) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index 2c2fa43ca81..8e340e8bc71 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -236,9 +236,7 @@ describe('v1p2beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createFeed(request); - }, expectedError); + await assert.rejects(client.createFeed(request), expectedError); assert( (client.innerApiCalls.createFeed as SinonStub) .getCall(0) @@ -347,9 +345,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getFeed(request); - }, expectedError); + await assert.rejects(client.getFeed(request), expectedError); assert( (client.innerApiCalls.getFeed as SinonStub) .getCall(0) @@ -458,9 +454,7 @@ describe('v1p2beta1.AssetServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.listFeeds(request); - }, expectedError); + await assert.rejects(client.listFeeds(request), expectedError); assert( (client.innerApiCalls.listFeeds as SinonStub) .getCall(0) @@ -575,9 +569,7 @@ describe('v1p2beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateFeed(request); - }, expectedError); + await assert.rejects(client.updateFeed(request), expectedError); assert( (client.innerApiCalls.updateFeed as SinonStub) .getCall(0) @@ -689,9 +681,7 @@ describe('v1p2beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteFeed(request); - }, expectedError); + await assert.rejects(client.deleteFeed(request), expectedError); assert( (client.innerApiCalls.deleteFeed as SinonStub) .getCall(0) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index 7a8049de2ff..f74979b1200 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts @@ -23,7 +23,7 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as assetserviceModule from '../src'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -271,9 +271,7 @@ describe('v1p4beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.analyzeIamPolicy(request); - }, expectedError); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); assert( (client.innerApiCalls.analyzeIamPolicy as SinonStub) .getCall(0) @@ -398,9 +396,10 @@ describe('v1p4beta1.AssetServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.exportIamPolicyAnalysis(request); - }, expectedError); + await assert.rejects( + client.exportIamPolicyAnalysis(request), + expectedError + ); assert( (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) .getCall(0) @@ -434,14 +433,53 @@ describe('v1p4beta1.AssetServiceClient', () => { expectedError ); const [operation] = await client.exportIamPolicyAnalysis(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkExportIamPolicyAnalysisProgress without error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + 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.checkExportIamPolicyAnalysisProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportIamPolicyAnalysisProgress with error', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + 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.checkExportIamPolicyAnalysisProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); }); From f6958b9b907c864b03cad1245e818d002d6a6802 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 18:34:27 -0700 Subject: [PATCH 218/429] feat: check status of long running operation by its name (#328) For each client method returning a long running operation, a separate method to check its status is added. Added methods: `checkExportAssetsProgress`, `checkExportIamPolicyAnalysisProgress`. --- packages/google-cloud-asset/synth.metadata | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index c0d32f18ba5..4736f3adc7d 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,7 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "321bc3ae0c187f29231037705a52ca4b805659ba" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1b5a8d2bbb69c5a04db26bd546d2888e609c6bab", - "internalRef": "309845930" + "sha": "9e710b7a58132d2004ea8de0d1afdf2497ff702a" } }, { From 2ac6a90b0fe184c32c6f4d4e39154a5b4fee7b72 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 May 2020 11:31:41 -0700 Subject: [PATCH 219/429] build: do not fail builds on codecov errors (#528) (#329) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/13e8b547-7af0-436b-b85e-2c1942f8f36a/targets Source-Link: https://github.com/googleapis/synthtool/commit/be74d3e532faa47eb59f1a0eaebde0860d1d8ab4 --- packages/google-cloud-asset/synth.metadata | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 4736f3adc7d..098be3548e1 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "9e710b7a58132d2004ea8de0d1afdf2497ff702a" + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "488a18ba934dbd3902595a5d4ea783033486b040" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2fc2caaacb15949c7f80426bfc7dafdd41dbc333", + "internalRef": "310239576" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From b042391046a9a5ee6fcc7ae1e641ece8002b0444 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 May 2020 20:04:24 +0200 Subject: [PATCH 220/429] fix(deps): update dependency @google-cloud/storage to v5 (#330) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@google-cloud/storage](https://togithub.com/googleapis/nodejs-storage) | dependencies | major | [`^4.0.0` -> `^5.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fstorage/4.7.0/5.0.0) | --- ### Release Notes
googleapis/nodejs-storage ### [`v5.0.0`](https://togithub.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md#​500-httpswwwgithubcomgoogleapisnodejs-storagecomparev470v500-2020-05-13) [Compare Source](https://togithub.com/googleapis/nodejs-storage/compare/v4.7.0...v5.0.0) ##### ⚠ BREAKING CHANGES - automatically detect contentType if not provided ([#​1190](https://togithub.com/googleapis/nodejs-storage/issues/1190)) - drop keepAcl parameter in file copy ([#​1166](https://togithub.com/googleapis/nodejs-storage/issues/1166)) - drop support for node.js 8.x ##### Features - automatically detect contentType if not provided ([#​1190](https://www.github.com/googleapis/nodejs-storage/issues/1190)) ([b31ba4a](https://www.github.com/googleapis/nodejs-storage/commit/b31ba4a11399b57538ddf0d6ca2e10b2aa3fbc3a)) - enable bytes read tracking ([#​1074](https://www.github.com/googleapis/nodejs-storage/issues/1074)) ([0776a04](https://www.github.com/googleapis/nodejs-storage/commit/0776a044f3b2149b485e114369e952688df75645)) ##### Bug Fixes - **bucket:** Only disable resumable uploads for bucket.upload (fixes [#​1133](https://www.github.com/googleapis/nodejs-storage/issues/1133)) ([#​1135](https://www.github.com/googleapis/nodejs-storage/issues/1135)) ([2c20148](https://www.github.com/googleapis/nodejs-storage/commit/2c201486b7b2d3146846ac96c877a904c4a674b0)), closes [/github.com/googleapis/nodejs-storage/pull/1135#issuecomment-620070038](https://www.github.com/googleapis//github.com/googleapis/nodejs-storage/pull/1135/issues/issuecomment-620070038) - add whitespace to generateV4SignedPolicy ([#​1136](https://www.github.com/googleapis/nodejs-storage/issues/1136)) ([dcee78b](https://www.github.com/googleapis/nodejs-storage/commit/dcee78b98da23b02fe7d2f13a9270546bc07bba8)) - apache license URL ([#​468](https://www.github.com/googleapis/nodejs-storage/issues/468)) ([#​1151](https://www.github.com/googleapis/nodejs-storage/issues/1151)) ([e8116d3](https://www.github.com/googleapis/nodejs-storage/commit/e8116d3c6fa7412858692e67745b514eef78850e)) - Point to team in correct org ([#​1185](https://www.github.com/googleapis/nodejs-storage/issues/1185)) ([0bb1909](https://www.github.com/googleapis/nodejs-storage/commit/0bb19098013acf71cc3842f78ff333a8e356331a)) - **deps:** update dependency [@​google-cloud/common](https://togithub.com/google-cloud/common) to v3 ([#​1134](https://www.github.com/googleapis/nodejs-storage/issues/1134)) ([774ac5c](https://www.github.com/googleapis/nodejs-storage/commit/774ac5c75f02238418cc8ed7242297ea573ca9cb)) - **deps:** update dependency [@​google-cloud/paginator](https://togithub.com/google-cloud/paginator) to v3 ([#​1131](https://www.github.com/googleapis/nodejs-storage/issues/1131)) ([c1614d9](https://www.github.com/googleapis/nodejs-storage/commit/c1614d98e3047db379e09299b1014e80d73ed52f)) - **deps:** update dependency [@​google-cloud/promisify](https://togithub.com/google-cloud/promisify) to v2 ([#​1127](https://www.github.com/googleapis/nodejs-storage/issues/1127)) ([06624a5](https://www.github.com/googleapis/nodejs-storage/commit/06624a534cd1fdbc38455eee8d89f9f60ba75758)) - **deps:** update dependency uuid to v8 ([#​1170](https://www.github.com/googleapis/nodejs-storage/issues/1170)) ([6a98d64](https://www.github.com/googleapis/nodejs-storage/commit/6a98d64831baf1ca1ec2f03ecc4914745cba1c86)) - **deps:** update gcs-resumable-upload, remove gitnpm usage ([#​1186](https://www.github.com/googleapis/nodejs-storage/issues/1186)) ([c78c9cd](https://www.github.com/googleapis/nodejs-storage/commit/c78c9cde49dccb2fcd4ce10e4e9f8299d65f6838)) - **v4-policy:** encode special characters ([#​1169](https://www.github.com/googleapis/nodejs-storage/issues/1169)) ([6e48539](https://www.github.com/googleapis/nodejs-storage/commit/6e48539d76ca27e6f4c6cf2ac0872970f7391fed)) - sync to [googleapis/conformance-tests@`fa559a1`](https://togithub.com/googleapis/conformance-tests/commit/fa559a1) ([#​1167](https://www.github.com/googleapis/nodejs-storage/issues/1167)) ([5500446](https://www.github.com/googleapis/nodejs-storage/commit/550044619d2f17a1977c83bce5df915c6dc9578c)), closes [#​1168](https://www.github.com/googleapis/nodejs-storage/issues/1168) ##### Miscellaneous Chores - drop keepAcl parameter in file copy ([#​1166](https://www.github.com/googleapis/nodejs-storage/issues/1166)) ([5a4044a](https://www.github.com/googleapis/nodejs-storage/commit/5a4044a8ba13f248fc4f791248f797eb0f1f3c16)) ##### Build System - drop support for node.js 8.x ([b80c025](https://www.github.com/googleapis/nodejs-storage/commit/b80c025f106052fd25554c64314b3b3520e829b5))
--- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index a1e245fbee6..9d7f9a0a53c 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/asset": "^3.0.0", - "@google-cloud/storage": "^4.0.0", + "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", "yargs": "^15.0.0" }, From 81366f5d3286c62e81cdf9f2235eae0e4f6a8064 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 20 May 2020 14:46:29 -0700 Subject: [PATCH 221/429] feat: add `SearchAllResources` and `SearchAllIamPolicies` rpcs in asset service proto (#332) * run compile protos * fix from package.json --- packages/google-cloud-asset/package.json | 2 +- .../google/cloud/asset/v1/asset_service.proto | 212 +- .../protos/google/cloud/asset/v1/assets.proto | 164 +- .../google-cloud-asset/protos/protos.d.ts | 1322 +++++- packages/google-cloud-asset/protos/protos.js | 3619 +++++++++++++---- .../google-cloud-asset/protos/protos.json | 209 + .../src/v1/asset_service_client.ts | 716 +++- .../src/v1/asset_service_client_config.json | 8 + packages/google-cloud-asset/synth.metadata | 10 +- .../test/gapic_asset_service_v1.ts | 697 ++++ 10 files changed, 6009 insertions(+), 950 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c3d5a742a1c..1f78da5f283 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -37,7 +37,7 @@ "fix": "gts fix", "lint": "gts check", "predocs-test": "npm run docs", - "prepare": "npm run compile", + "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "prelint": "cd samples; npm link ../; npm install", diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 9c7b16d036e..0eab6efdd13 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -37,12 +37,14 @@ option php_namespace = "Google\\Cloud\\Asset\\V1"; // Asset service definition. service AssetService { option (google.api.default_host) = "cloudasset.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"; // Exports assets with time and resource types to a given Cloud Storage // location. The output format is newline-delimited JSON. - // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you - // to keep track of the export. + // This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API allowing + // you to keep track of the export. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}:exportAssets" @@ -61,7 +63,8 @@ service AssetService { // attached IAM POLICY both exist. This can create gaps in the output history. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT // error. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) + returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}:batchGetAssetsHistory" }; @@ -109,6 +112,30 @@ service AssetService { }; option (google.api.method_signature) = "name"; } + + // Searches all the resources within the given accessible scope (e.g., a + // project, a folder or an organization). Callers should have + // cloud.assets.SearchAllResources permission upon the requested scope, + // otherwise the request will be rejected. + rpc SearchAllResources(SearchAllResourcesRequest) + returns (SearchAllResourcesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:searchAllResources" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches all the IAM policies within the given accessible scope (e.g., a + // project, a folder or an organization). Callers should have + // cloud.assets.SearchAllIamPolicies permission upon the requested scope, + // otherwise the request will be rejected. + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) + returns (SearchAllIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:searchAllIamPolicies" + }; + option (google.api.method_signature) = "scope,query"; + } } // Export asset request. @@ -148,8 +175,10 @@ message ExportAssetsRequest { } // The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. message ExportAssetsResponse { // Time the snapshot was taken. google.protobuf.Timestamp read_time = 1; @@ -214,9 +243,8 @@ message CreateFeedRequest { // be unique under a specific parent project/folder/organization. string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The feed details. The field `name` must be empty and it will be generated - // in the format of: - // projects/project_number/feeds/feed_id + // Required. The feed details. The field `name` must be empty and it will be + // generated in the format of: projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; @@ -230,9 +258,7 @@ message GetFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Feed" - } + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } ]; } @@ -251,8 +277,8 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // Required. The new values of feed details. It must match an existing feed and the - // field `name` must be in the format of: + // Required. The new values of feed details. It must match an existing feed + // and the field `name` must be in the format of: // projects/project_number/feeds/feed_id or // folders/folder_number/feeds/feed_id or // organizations/organization_number/feeds/feed_id. @@ -261,7 +287,8 @@ message UpdateFeedRequest { // Required. Only updates the `feed` fields indicated by this mask. // The field mask must not be empty, and it must not contain fields that // are immutable or only set by the server. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } message DeleteFeedRequest { @@ -271,9 +298,7 @@ message DeleteFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Feed" - } + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } ]; } @@ -401,7 +426,156 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; + FeedOutputConfig feed_output_config = 5 + [(google.api.field_behavior) = REQUIRED]; +} + +// Search all resources request. +message SearchAllResourcesRequest { + // Required. A scope can be a project, a folder or an organization. The search + // is limited to the resources within the `scope`. + // + // The allowed values are: + // + // * projects/{PROJECT_ID} + // * projects/{PROJECT_NUMBER} + // * folders/{FOLDER_NUMBER} + // * organizations/{ORGANIZATION_NUMBER} + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. An empty query can be specified to search + // all the resources of certain `asset_types` within the given `scope`. + // + // Examples: + // + // * `name : "Important"` to find Cloud resources whose name contains + // "Important" as a word. + // * `displayName : "Impor*"` to find Cloud resources whose display name + // contains "Impor" as a word prefix. + // * `description : "*por*"` to find Cloud resources whose description + // contains "por" as a substring. + // * `location : "us-west*"` to find Cloud resources whose location is + // prefixed with "us-west". + // * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + // a key or value. + // * `labels.env : "prod"` to find Cloud resources which have a label "env" + // and its value is "prod". + // * `labels.env : *` to find Cloud resources which have a label "env". + // * `"Important"` to find Cloud resources which contain "Important" as a word + // in any of the searchable fields. + // * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + // in any of the searchable fields. + // * `"*por*"` to find Cloud resources which contain "por" as a substring in + // any of the searchable fields. + // * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud + // resources which contain "Important" as a word in any of the searchable + // fields and are also located in the "us-west1" region or the "global" + // location. + // + // See [how to construct a + // query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + // for more details. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, + // it will search all the [searchable asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero, server will pick an + // appropriate default. Returned results may be fewer than requested. When + // this happens, there could be more results as long as `next_page_token` is + // returned. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of all other + // method parameters, must be identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma separated list of fields specifying the sorting order of + // the results. The default order is ascending. Add " DESC" after the field + // name to indicate descending order. Redundant space characters are ignored. + // Example: "location DESC, name". See [supported resource metadata + // fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) + // for more details. + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all resources response. +message SearchAllResourcesResponse { + // A list of Resources that match the search query. It contains the resource + // standard metadata information. + repeated ResourceSearchResult results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search all IAM policies request. +message SearchAllIamPoliciesRequest { + // Required. A scope can be a project, a folder or an organization. The search + // is limited to the IAM policies within the `scope`. + // + // The allowed values are: + // + // * projects/{PROJECT_ID} + // * projects/{PROJECT_NUMBER} + // * folders/{FOLDER_NUMBER} + // * organizations/{ORGANIZATION_NUMBER} + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. An empty query can be specified to search + // all the IAM policies within the given `scope`. + // + // Examples: + // + // * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that + // specify user "amy@gmail.com". + // * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that + // specify the Compute Admin role. + // * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM + // policy bindings that specify a role containing "storage.buckets.update" + // permission. + // * `resource : "organizations/123"` to find Cloud IAM policy bindings that + // are set on "organizations/123". + // * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` + // to find Cloud IAM policy bindings that are set on "organizations/123" or + // "folders/1234", and also specify user "amy". + // + // See [how to construct a + // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + // for more details. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero, server will pick an + // appropriate default. Returned results may be fewer than requested. When + // this happens, there could be more results as long as `next_page_token` is + // returned. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding + // call to this method. `page_token` must be the value of `next_page_token` + // from the previous response. The values of all other method parameters must + // be identical to those in the previous call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all IAM policies response. +message SearchAllIamPoliciesResponse { + // A list of IamPolicy that match the search query. Related information such + // as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; } // Asset content type. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 1e8b40a11d9..4e537d5ce8a 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.asset.v1; +import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; @@ -25,7 +26,6 @@ import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -111,7 +111,8 @@ message Asset { google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; } // The ancestry path of an asset in Google Cloud [resource @@ -169,4 +170,163 @@ message Resource { // The content of the resource, in which some sensitive fields are removed // and may not be present. google.protobuf.Struct data = 6; + + // The location of the resource in Google Cloud, such as its zone and region. + // For more information, see https://cloud.google.com/about/locations/. + string location = 8; +} + +// A result of Resource Search, containing information of a cloud resoure. +message ResourceSearchResult { + // The full resource name of this resource. Example: + // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // See [Cloud Asset Inventory Resource Name + // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for more information. + // + // To search against the `name`: + // + // * use a field query. Example: `name : "instance1"` + // * use a free text query. Example: `"instance1"` + string name = 1; + + // The type of this resource. Example: "compute.googleapis.com/Disk". + // + // To search against the `asset_type`: + // + // * specify the `asset_type` field in your search request. + string asset_type = 2; + + // The project that this resource belongs to, in the form of + // projects/{PROJECT_NUMBER}. + // + // To search against the `project`: + // + // * specify the `scope` field as this project in your search request. + string project = 3; + + // The display name of this resource. + // + // To search against the `display_name`: + // + // * use a field query. Example: `displayName : "My Instance"` + // * use a free text query. Example: `"My Instance"` + string display_name = 4; + + // One or more paragraphs of text description of this resource. Maximum length + // could be up to 1M bytes. + // + // To search against the `description`: + // + // * use a field query. Example: `description : "*important instance*"` + // * use a free text query. Example: `"*important instance*"` + string description = 5; + + // Location can be "global", regional like "us-east1", or zonal like + // "us-west1-b". + // + // To search against the `location`: + // + // * use a field query. Example: `location : "us-west*"` + // * use a free text query. Example: `"us-west*"` + string location = 6; + + // Labels associated with this resource. See [Labelling and grouping GCP + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + // + // To search against the `labels`: + // + // * use a field query, as following: + // - query on any label's key or value. Example: `labels : "prod"` + // - query by a given label. Example: `labels.env : "prod"` + // - query by a given label'sexistence. Example: `labels.env : *` + // * use a free text query. Example: `"prod"` + map labels = 7; + + // Network tags associated with this resource. Like labels, network tags are a + // type of annotations used to group GCP resources. See [Labelling GCP + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + // + // To search against the `network_tags`: + // + // * use a field query. Example: `networkTags : "internal"` + // * use a free text query. Example: `"internal"` + repeated string network_tags = 8; + + // The additional attributes of this resource. The attributes may vary from + // one resource type to another. Examples: "projectId" for Project, + // "dnsName" for DNS ManagedZone. + // + // To search against the `additional_attributes`: + // + // * use a free text query to match the attributes values. Example: to search + // additional_attributes = { dnsName: "foobar" }, you can issue a query + // `"foobar"`. + google.protobuf.Struct additional_attributes = 9; +} + +// A result of IAM Policy search, containing information of an IAM policy. +message IamPolicySearchResult { + // Explanation about the IAM policy search result. + message Explanation { + // IAM permissions + message Permissions { + // A list of permissions. A sample permission string: "compute.disk.get". + repeated string permissions = 1; + } + + // The map from roles to their included permissions that match the + // permission query (i.e., a query containing `policy.role.permissions:`). + // Example: if query `policy.role.permissions : "compute.disk.get"` + // matches a policy binding that contains owner role, the + // matched_permissions will be {"roles/owner": ["compute.disk.get"]}. The + // roles can also be found in the returned `policy` bindings. Note that the + // map is populated only for requests with permission queries. + map matched_permissions = 1; + } + + // The full resource name of the resource associated with this IAM policy. + // Example: + // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // See [Cloud Asset Inventory Resource Name + // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for more information. + // + // To search against the `resource`: + // + // * use a field query. Example: `resource : "organizations/123"` + string resource = 1; + + // The project that the associated GCP resource belongs to, in the form of + // projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM + // instance, Cloud Storage bucket), the project field will indicate the + // project that contains the resource. If an IAM policy is set on a folder or + // orgnization, the project field will be empty. + // + // To search against the `project`: + // + // * specify the `scope` field as this project in your search request. + string project = 2; + + // The IAM policy directly set on the given resource. Note that the original + // IAM policy can contain multiple bindings. This only contains the bindings + // that match the given query. For queries that don't contain a constrain on + // policies (e.g., an empty query), this contains all the bindings. + // + // To search against the `policy` bindings: + // + // * use a field query, as following: + // - query by the policy contained members. Example: + // `policy : "amy@gmail.com"` + // - query by the policy contained roles. Example: + // `policy : "roles/compute.admin"` + // - query by the policy contained roles' implied permissions. Example: + // `policy.role.permissions : "compute.instances.create"` + google.iam.v1.Policy policy = 3; + + // Explanation about the IAM policy search result. It contains additional + // information to explain why the search result matches the query. + Explanation explanation = 4; } diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 5ab4595fec4..734e82f02af 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -143,6 +143,34 @@ export namespace google { * @returns Promise */ public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; + + /** + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + */ + public searchAllResources(request: google.cloud.asset.v1.ISearchAllResourcesRequest, callback: google.cloud.asset.v1.AssetService.SearchAllResourcesCallback): void; + + /** + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @returns Promise + */ + public searchAllResources(request: google.cloud.asset.v1.ISearchAllResourcesRequest): Promise; + + /** + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + */ + public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest, callback: google.cloud.asset.v1.AssetService.SearchAllIamPoliciesCallback): void; + + /** + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @returns Promise + */ + public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): Promise; } namespace AssetService { @@ -195,6 +223,20 @@ export namespace google { * @param [response] Empty */ type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllResources}. + * @param error Error, if any + * @param [response] SearchAllResourcesResponse + */ + type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllIamPolicies}. + * @param error Error, if any + * @param [response] SearchAllIamPoliciesResponse + */ + type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllIamPoliciesResponse) => void; } /** Properties of an ExportAssetsRequest. */ @@ -1760,473 +1802,1331 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } + /** Properties of a SearchAllResourcesRequest. */ + interface ISearchAllResourcesRequest { - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { + /** SearchAllResourcesRequest scope */ + scope?: (string|null); - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); + /** SearchAllResourcesRequest query */ + query?: (string|null); - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** SearchAllResourcesRequest assetTypes */ + assetTypes?: (string[]|null); - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** SearchAllResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllResourcesRequest pageToken */ + pageToken?: (string|null); + + /** SearchAllResourcesRequest orderBy */ + orderBy?: (string|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a SearchAllResourcesRequest. */ + class SearchAllResourcesRequest implements ISearchAllResourcesRequest { /** - * Constructs a new TemporalAsset. + * Constructs a new SearchAllResourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + constructor(properties?: google.cloud.asset.v1.ISearchAllResourcesRequest); - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + /** SearchAllResourcesRequest scope. */ + public scope: string; - /** TemporalAsset deleted. */ - public deleted: boolean; + /** SearchAllResourcesRequest query. */ + public query: string; - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + /** SearchAllResourcesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchAllResourcesRequest pageToken. */ + public pageToken: string; + + /** SearchAllResourcesRequest orderBy. */ + public orderBy: string; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns SearchAllResourcesRequest instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.ISearchAllResourcesRequest): google.cloud.asset.v1.SearchAllResourcesRequest; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns SearchAllResourcesRequest * @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.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SearchAllResourcesRequest; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns SearchAllResourcesRequest * @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.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SearchAllResourcesRequest; /** - * Verifies a TemporalAsset message. + * Verifies a SearchAllResourcesRequest 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns SearchAllResourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllResourcesRequest; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @param message SearchAllResourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.SearchAllResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** Properties of a SearchAllResourcesResponse. */ + interface ISearchAllResourcesResponse { - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** SearchAllResourcesResponse results */ + results?: (google.cloud.asset.v1.IResourceSearchResult[]|null); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** SearchAllResourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents a SearchAllResourcesResponse. */ + class SearchAllResourcesResponse implements ISearchAllResourcesResponse { /** - * Constructs a new TimeWindow. + * Constructs a new SearchAllResourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1.ISearchAllResourcesResponse); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** SearchAllResourcesResponse results. */ + public results: google.cloud.asset.v1.IResourceSearchResult[]; - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** SearchAllResourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns SearchAllResourcesResponse instance */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public static create(properties?: google.cloud.asset.v1.ISearchAllResourcesResponse): google.cloud.asset.v1.SearchAllResourcesResponse; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns SearchAllResourcesResponse * @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.asset.v1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SearchAllResourcesResponse; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns SearchAllResourcesResponse * @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.asset.v1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SearchAllResourcesResponse; /** - * Verifies a TimeWindow message. + * Verifies a SearchAllResourcesResponse 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. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns SearchAllResourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllResourcesResponse; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @param message SearchAllResourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.SearchAllResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { + /** Properties of a SearchAllIamPoliciesRequest. */ + interface ISearchAllIamPoliciesRequest { - /** Asset name */ - name?: (string|null); + /** SearchAllIamPoliciesRequest scope */ + scope?: (string|null); - /** Asset assetType */ - assetType?: (string|null); + /** SearchAllIamPoliciesRequest query */ + query?: (string|null); - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** SearchAllIamPoliciesRequest pageSize */ + pageSize?: (number|null); - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** SearchAllIamPoliciesRequest pageToken */ + pageToken?: (string|null); + } - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + /** Represents a SearchAllIamPoliciesRequest. */ + class SearchAllIamPoliciesRequest implements ISearchAllIamPoliciesRequest { - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** + * Constructs a new SearchAllIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesRequest); - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** SearchAllIamPoliciesRequest scope. */ + public scope: string; - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** SearchAllIamPoliciesRequest query. */ + public query: string; - /** Asset ancestors */ - ancestors?: (string[]|null); - } + /** SearchAllIamPoliciesRequest pageSize. */ + public pageSize: number; - /** Represents an Asset. */ - class Asset implements IAsset { + /** SearchAllIamPoliciesRequest pageToken. */ + public pageToken: string; /** - * Constructs a new Asset. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set + * @returns SearchAllIamPoliciesRequest instance */ - constructor(properties?: google.cloud.asset.v1.IAsset); - - /** Asset name. */ - public name: string; + public static create(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): google.cloud.asset.v1.SearchAllIamPoliciesRequest; - /** Asset assetType. */ - public assetType: string; + /** + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset resource. */ + /** + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllIamPoliciesRequest + * @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.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllIamPoliciesRequest + * @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.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Verifies a SearchAllIamPoliciesRequest 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 SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllIamPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SearchAllIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllIamPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchAllIamPoliciesResponse. */ + interface ISearchAllIamPoliciesResponse { + + /** SearchAllIamPoliciesResponse results */ + results?: (google.cloud.asset.v1.IIamPolicySearchResult[]|null); + + /** SearchAllIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllIamPoliciesResponse. */ + class SearchAllIamPoliciesResponse implements ISearchAllIamPoliciesResponse { + + /** + * Constructs a new SearchAllIamPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesResponse); + + /** SearchAllIamPoliciesResponse results. */ + public results: google.cloud.asset.v1.IIamPolicySearchResult[]; + + /** SearchAllIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllIamPoliciesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesResponse): google.cloud.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllIamPoliciesResponse + * @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.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllIamPoliciesResponse + * @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.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Verifies a SearchAllIamPoliciesResponse 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 SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllIamPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SearchAllIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllIamPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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.asset.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.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ public resource?: (google.cloud.asset.v1.IResource|null); - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + + /** Resource location */ + location?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** Resource location. */ + public location: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Asset orgPolicy. */ - public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { - /** Asset accessPolicy. */ - public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** ResourceSearchResult name */ + name?: (string|null); - /** Asset accessLevel. */ - public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** ResourceSearchResult assetType */ + assetType?: (string|null); - /** Asset servicePerimeter. */ - public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** ResourceSearchResult project */ + project?: (string|null); - /** Asset ancestors. */ - public ancestors: string[]; + /** ResourceSearchResult displayName */ + displayName?: (string|null); - /** Asset accessContextPolicy. */ - public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + /** ResourceSearchResult description */ + description?: (string|null); + + /** ResourceSearchResult location */ + location?: (string|null); + + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); + + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + } + + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { /** - * Creates a new Asset instance using the specified properties. + * Constructs a new ResourceSearchResult. * @param [properties] Properties to set - * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a ResourceSearchResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns ResourceSearchResult * @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.asset.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ResourceSearchResult; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns ResourceSearchResult * @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.asset.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ResourceSearchResult; /** - * Verifies an Asset message. + * Verifies a ResourceSearchResult 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns ResourceSearchResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this ResourceSearchResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** IamPolicySearchResult resource */ + resource?: (string|null); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** IamPolicySearchResult project */ + project?: (string|null); - /** Resource parent */ - parent?: (string|null); + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { /** - * Constructs a new Resource. + * Constructs a new IamPolicySearchResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); - /** Resource discoveryName. */ - public discoveryName: string; + /** IamPolicySearchResult resource. */ + public resource: string; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** IamPolicySearchResult project. */ + public project: string; - /** Resource parent. */ - public parent: string; + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); /** - * Creates a new Resource instance using the specified properties. + * Creates a new IamPolicySearchResult instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns IamPolicySearchResult instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an IamPolicySearchResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns IamPolicySearchResult * @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.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns IamPolicySearchResult * @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.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult; /** - * Verifies a Resource message. + * Verifies an IamPolicySearchResult 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns IamPolicySearchResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this IamPolicySearchResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Explanation { + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index c3fada77a62..ef733355202 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -329,6 +329,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllResources}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef SearchAllResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse + */ + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { + return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1.SearchAllResourcesRequest, $root.google.cloud.asset.v1.SearchAllResourcesResponse, request, callback); + }, "name", { value: "SearchAllResources" }); + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllIamPolicies}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef SearchAllIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse + */ + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { + return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse, request, callback); + }, "name", { value: "SearchAllIamPolicies" }); + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); @@ -4072,46 +4138,30 @@ return Feed; })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; - })(); - - v1.TemporalAsset = (function() { + v1.SearchAllResourcesRequest = (function() { /** - * Properties of a TemporalAsset. + * Properties of a SearchAllResourcesRequest. * @memberof google.cloud.asset.v1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @interface ISearchAllResourcesRequest + * @property {string|null} [scope] SearchAllResourcesRequest scope + * @property {string|null} [query] SearchAllResourcesRequest query + * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize + * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken + * @property {string|null} [orderBy] SearchAllResourcesRequest orderBy */ /** - * Constructs a new TemporalAsset. + * Constructs a new SearchAllResourcesRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents a SearchAllResourcesRequest. + * @implements ISearchAllResourcesRequest * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest=} [properties] Properties to set */ - function TemporalAsset(properties) { + function SearchAllResourcesRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4119,101 +4169,143 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset + * SearchAllResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @instance */ - TemporalAsset.prototype.window = null; + SearchAllResourcesRequest.prototype.scope = ""; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset + * SearchAllResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @instance */ - TemporalAsset.prototype.deleted = false; + SearchAllResourcesRequest.prototype.query = ""; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * SearchAllResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @instance */ - TemporalAsset.prototype.asset = null; + SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; /** - * Creates a new TemporalAsset instance using the specified properties. + * SearchAllResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.pageSize = 0; + + /** + * SearchAllResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.pageToken = ""; + + /** + * SearchAllResourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + SearchAllResourcesRequest.create = function create(properties) { + return new SearchAllResourcesRequest(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + SearchAllResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && Object.hasOwnProperty.call(message, "window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + SearchAllResourcesRequest.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.asset.v1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + message.scope = reader.string(); break; case 2: - message.deleted = reader.bool(); + message.query = reader.string(); break; case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); + break; + case 6: + message.orderBy = reader.string(); break; default: reader.skipType(tag & 7); @@ -4224,135 +4316,163 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies a SearchAllResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + SearchAllResourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); - if (error) - return "asset." + error; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: 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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + SearchAllResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + var message = new $root.google.cloud.asset.v1.SearchAllResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1.SearchAllResourcesRequest} message SearchAllResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + SearchAllResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + SearchAllResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return SearchAllResourcesRequest; })(); - v1.TimeWindow = (function() { + v1.SearchAllResourcesResponse = (function() { /** - * Properties of a TimeWindow. + * Properties of a SearchAllResourcesResponse. * @memberof google.cloud.asset.v1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface ISearchAllResourcesResponse + * @property {Array.|null} [results] SearchAllResourcesResponse results + * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken */ /** - * Constructs a new TimeWindow. + * Constructs a new SearchAllResourcesResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents a SearchAllResourcesResponse. + * @implements ISearchAllResourcesResponse * @constructor - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse=} [properties] Properties to set */ - function TimeWindow(properties) { + function SearchAllResourcesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4360,88 +4480,91 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow + * SearchAllResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @instance */ - TimeWindow.prototype.startTime = null; + SearchAllResourcesResponse.prototype.results = $util.emptyArray; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow + * SearchAllResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @instance */ - TimeWindow.prototype.endTime = null; + SearchAllResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + SearchAllResourcesResponse.create = function create(properties) { + return new SearchAllResourcesResponse(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + SearchAllResourcesResponse.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(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1.ResourceSearchResult.encode(message.results[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 TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse * @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) { + SearchAllResourcesResponse.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.asset.v1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1.ResourceSearchResult.decode(reader, reader.uint32())); break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4452,136 +4575,136 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse * @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) { + SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies a SearchAllResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @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) { + SearchAllResourcesResponse.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; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1.ResourceSearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + SearchAllResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.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.asset.v1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.google.cloud.asset.v1.SearchAllResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1.ResourceSearchResult.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1.SearchAllResourcesResponse} message SearchAllResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + SearchAllResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1.ResourceSearchResult.toObject(message.results[j], options); } - 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); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + SearchAllResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return SearchAllResourcesResponse; })(); - v1.Asset = (function() { + v1.SearchAllIamPoliciesRequest = (function() { /** - * Properties of an Asset. + * Properties of a SearchAllIamPoliciesRequest. * @memberof google.cloud.asset.v1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [orgPolicy] Asset orgPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel - * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter - * @property {Array.|null} [ancestors] Asset ancestors + * @interface ISearchAllIamPoliciesRequest + * @property {string|null} [scope] SearchAllIamPoliciesRequest scope + * @property {string|null} [query] SearchAllIamPoliciesRequest query + * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken */ /** - * Constructs a new Asset. + * Constructs a new SearchAllIamPoliciesRequest. * @memberof google.cloud.asset.v1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a SearchAllIamPoliciesRequest. + * @implements ISearchAllIamPoliciesRequest * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest=} [properties] Properties to set */ - function Asset(properties) { - this.orgPolicy = []; - this.ancestors = []; + function SearchAllIamPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4589,199 +4712,114 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1.Asset + * SearchAllIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @instance */ - Asset.prototype.name = ""; + SearchAllIamPoliciesRequest.prototype.scope = ""; /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.assetType = ""; - - /** - * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.resource = null; - - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.iamPolicy = null; - - /** - * Asset orgPolicy. - * @member {Array.} orgPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.orgPolicy = $util.emptyArray; - - /** - * Asset accessPolicy. - * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessPolicy = null; - - /** - * Asset accessLevel. - * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessLevel = null; - - /** - * Asset servicePerimeter. - * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter - * @memberof google.cloud.asset.v1.Asset + * SearchAllIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @instance */ - Asset.prototype.servicePerimeter = null; + SearchAllIamPoliciesRequest.prototype.query = ""; /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset + * SearchAllIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @instance */ - Asset.prototype.ancestors = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + SearchAllIamPoliciesRequest.prototype.pageSize = 0; /** - * Asset accessContextPolicy. - * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy - * @memberof google.cloud.asset.v1.Asset + * SearchAllIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @instance */ - Object.defineProperty(Asset.prototype, "accessContextPolicy", { - get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), - set: $util.oneOfSetter($oneOfFields) - }); + SearchAllIamPoliciesRequest.prototype.pageToken = ""; /** - * Creates a new Asset instance using the specified properties. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance */ - Asset.create = function create(properties) { - return new Asset(properties); + SearchAllIamPoliciesRequest.create = function create(properties) { + return new SearchAllIamPoliciesRequest(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + SearchAllIamPoliciesRequest.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.orgPolicy != null && message.orgPolicy.length) - for (var i = 0; i < message.orgPolicy.length; ++i) - $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) - $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) - $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) - $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + 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); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + SearchAllIamPoliciesRequest.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.asset.v1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.scope = reader.string(); break; case 2: - message.assetType = reader.string(); + message.query = reader.string(); break; case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.orgPolicy && message.orgPolicy.length)) - message.orgPolicy = []; - message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); - break; - case 7: - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); - break; - case 8: - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); - break; - case 9: - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4792,253 +4830,134 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a SearchAllIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + SearchAllIamPoliciesRequest.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { - if (!Array.isArray(message.orgPolicy)) - return "orgPolicy: array expected"; - for (var i = 0; i < message.orgPolicy.length; ++i) { - var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); - if (error) - return "orgPolicy." + error; - } - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); - if (error) - return "accessPolicy." + error; - } - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); - if (error) - return "accessLevel." + error; - } - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); - if (error) - return "servicePerimeter." + error; - } - } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) + SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.orgPolicy) { - if (!Array.isArray(object.orgPolicy)) - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); - message.orgPolicy = []; - for (var i = 0; i < object.orgPolicy.length; ++i) { - if (typeof object.orgPolicy[i] !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); - message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); - } - } - if (object.accessPolicy != null) { - if (typeof object.accessPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); - } - if (object.accessLevel != null) { - if (typeof object.accessLevel !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); - } - if (object.servicePerimeter != null) { - if (typeof object.servicePerimeter !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); - } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } + var message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + 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 an Asset message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1.Asset} message Asset + * @param {google.cloud.asset.v1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.orgPolicy = []; - object.ancestors = []; - } if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.orgPolicy && message.orgPolicy.length) { - object.orgPolicy = []; - for (var j = 0; j < message.orgPolicy.length; ++j) - object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); - if (options.oneofs) - object.accessContextPolicy = "accessPolicy"; - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); - if (options.oneofs) - object.accessContextPolicy = "accessLevel"; - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); - if (options.oneofs) - object.accessContextPolicy = "servicePerimeter"; - } - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this Asset to JSON. + * Converts this SearchAllIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return SearchAllIamPoliciesRequest; })(); - v1.Resource = (function() { + v1.SearchAllIamPoliciesResponse = (function() { /** - * Properties of a Resource. + * Properties of a SearchAllIamPoliciesResponse. * @memberof google.cloud.asset.v1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data + * @interface ISearchAllIamPoliciesResponse + * @property {Array.|null} [results] SearchAllIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken */ /** - * Constructs a new Resource. + * Constructs a new SearchAllIamPoliciesResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents a Resource. - * @implements IResource + * @classdesc Represents a SearchAllIamPoliciesResponse. + * @implements ISearchAllIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse=} [properties] Properties to set */ - function Resource(properties) { + function SearchAllIamPoliciesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5046,140 +4965,91 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; - - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.Resource + * SearchAllIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @instance */ - Resource.prototype.parent = ""; + SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource + * SearchAllIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @instance */ - Resource.prototype.data = null; + SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; /** - * Creates a new Resource instance using the specified properties. + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance */ - Resource.create = function create(properties) { - return new Resource(properties); + SearchAllIamPoliciesResponse.create = function create(properties) { + return new SearchAllIamPoliciesResponse(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + SearchAllIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1.IamPolicySearchResult.encode(message.results[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 Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + SearchAllIamPoliciesResponse.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.asset.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1.IamPolicySearchResult.decode(reader, reader.uint32())); break; case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -5190,133 +5060,2472 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a SearchAllIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + SearchAllIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) + SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1.SearchAllIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1.SearchAllIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1.IamPolicySearchResult.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.Resource} message Resource + * @param {google.cloud.asset.v1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1.IamPolicySearchResult.toObject(message.results[j], options); } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Resource to JSON. + * Converts this SearchAllIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return SearchAllIamPoliciesResponse; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.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.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + case 7: + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + case 8: + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + case 9: + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {string|null} [location] Resource location + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 8: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.location = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + v1.ResourceSearchResult = (function() { + + /** + * Properties of a ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @interface IResourceSearchResult + * @property {string|null} [name] ResourceSearchResult name + * @property {string|null} [assetType] ResourceSearchResult assetType + * @property {string|null} [project] ResourceSearchResult project + * @property {string|null} [displayName] ResourceSearchResult displayName + * @property {string|null} [description] ResourceSearchResult description + * @property {string|null} [location] ResourceSearchResult location + * @property {Object.|null} [labels] ResourceSearchResult labels + * @property {Array.|null} [networkTags] ResourceSearchResult networkTags + * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes + */ + + /** + * Constructs a new ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ResourceSearchResult. + * @implements IResourceSearchResult + * @constructor + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + */ + function ResourceSearchResult(properties) { + this.labels = {}; + this.networkTags = []; + 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]]; + } + + /** + * ResourceSearchResult name. + * @member {string} name + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.name = ""; + + /** + * ResourceSearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.assetType = ""; + + /** + * ResourceSearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.project = ""; + + /** + * ResourceSearchResult displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.displayName = ""; + + /** + * ResourceSearchResult description. + * @member {string} description + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.description = ""; + + /** + * ResourceSearchResult location. + * @member {string} location + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.location = ""; + + /** + * ResourceSearchResult labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.labels = $util.emptyObject; + + /** + * ResourceSearchResult networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.networkTags = $util.emptyArray; + + /** + * ResourceSearchResult additionalAttributes. + * @member {google.protobuf.IStruct|null|undefined} additionalAttributes + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.additionalAttributes = null; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance + */ + ResourceSearchResult.create = function create(properties) { + return new ResourceSearchResult(properties); + }; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); + if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) + $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.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.asset.v1.ResourceSearchResult(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.project = reader.string(); + break; + case 4: + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.location = reader.string(); + break; + case 7: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 8: + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + case 9: + message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSearchResult.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); + if (error) + return "additionalAttributes." + error; + } + return null; + }; + + /** + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + */ + ResourceSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) + return object; + var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.additionalAttributes != null) { + if (typeof object.additionalAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); + message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); + } + return message; + }; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkTags = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + object.location = ""; + object.additionalAttributes = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) + object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); + return object; + }; + + /** + * Converts this ResourceSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + * @returns {Object.} JSON object + */ + ResourceSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSearchResult; + })(); + + v1.IamPolicySearchResult = (function() { + + /** + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation + */ + + /** + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + */ + function IamPolicySearchResult(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]]; + } + + /** + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.resource = ""; + + /** + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.project = ""; + + /** + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance + */ + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); + }; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.project = reader.string(); + break; + case 3: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 4: + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicySearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicySearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } + return null; + }; + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicySearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; + object.explanation = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + return object; + }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicySearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicySearchResult.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + this.matchedPermissions = {}; + 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]]; + } + + /** + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + */ + Explanation.prototype.matchedPermissions = $util.emptyObject; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.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.asset.v1.IamPolicySearchResult.Explanation(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + key = reader.string(); + reader.pos++; + message.matchedPermissions[key] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); + if (error) + return "matchedPermissions." + error; + } + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Explanation.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + this.permissions = []; + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Permissions; + })(); + + return Explanation; + })(); + + return IamPolicySearchResult; })(); return v1; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 6950b05a552..ae2da2f42b8 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -81,6 +81,22 @@ "(google.api.http).delete": "/v1/{name=*/*/feeds/*}", "(google.api.method_signature)": "name" } + }, + "SearchAllResources": { + "requestType": "SearchAllResourcesRequest", + "responseType": "SearchAllResourcesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:searchAllResources", + "(google.api.method_signature)": "scope,query,asset_types" + } + }, + "SearchAllIamPolicies": { + "requestType": "SearchAllIamPoliciesRequest", + "responseType": "SearchAllIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:searchAllIamPolicies", + "(google.api.method_signature)": "scope,query" + } } } }, @@ -377,6 +393,111 @@ } } }, + "SearchAllResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchAllResourcesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "ResourceSearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchAllIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "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" + } + } + } + }, + "SearchAllIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "ContentType": { "values": { "CONTENT_TYPE_UNSPECIFIED": 0, @@ -494,6 +615,94 @@ "data": { "type": "google.protobuf.Struct", "id": 6 + }, + "location": { + "type": "string", + "id": 8 + } + } + }, + "ResourceSearchResult": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "project": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "location": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "additionalAttributes": { + "type": "google.protobuf.Struct", + "id": 9 + } + } + }, + "IamPolicySearchResult": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 2 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 3 + }, + "explanation": { + "type": "Explanation", + "id": 4 + } + }, + "nested": { + "Explanation": { + "fields": { + "matchedPermissions": { + "keyType": "string", + "type": "Permissions", + "id": 1 + } + }, + "nested": { + "Permissions": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } } } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 25c2f8893e1..99c2983f1ac 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -23,9 +23,13 @@ import { 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 './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; @@ -165,6 +169,22 @@ export class AssetServiceClient { ), }; + // 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 = { + searchAllResources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchAllIamPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + }; + // 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. @@ -249,6 +269,8 @@ export class AssetServiceClient { 'listFeeds', 'updateFeed', 'deleteFeed', + 'searchAllResources', + 'searchAllIamPolicies', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -487,9 +509,8 @@ export class AssetServiceClient { * Required. This is the client-assigned asset feed identifier and it needs to * be unique under a specific parent project/folder/organization. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] @@ -736,8 +757,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. @@ -914,8 +935,9 @@ export class AssetServiceClient { /** * Exports assets with time and resource types to a given Cloud Storage * location. The output format is newline-delimited JSON. - * This API implements the {@link google.longrunning.Operation|google.longrunning.Operation} API allowing you - * to keep track of the export. + * This API implements the + * {@link google.longrunning.Operation|google.longrunning.Operation} API allowing + * you to keep track of the export. * * @param {Object} request * The request object that will be sent. @@ -1033,6 +1055,686 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest >; } + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IResourceSearchResult[], + protos.google.cloud.asset.v1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse + ] + >; + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + > + ): void; + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + > + ): void; + /** + * Searches all the resources within the given accessible scope (e.g., a + * project, a folder or an organization). Callers should have + * cloud.assets.SearchAllResources permission upon the requested scope, + * otherwise the request will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder or an organization. The search + * is limited to the resources within the `scope`. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} + * * projects/{PROJECT_NUMBER} + * * folders/{FOLDER_NUMBER} + * * organizations/{ORGANIZATION_NUMBER} + * @param {string} [request.query] + * Optional. The query statement. An empty query can be specified to search + * all the resources of certain `asset_types` within the given `scope`. + * + * Examples: + * + * * `name : "Important"` to find Cloud resources whose name contains + * "Important" as a word. + * * `displayName : "Impor*"` to find Cloud resources whose display name + * contains "Impor" as a word prefix. + * * `description : "*por*"` to find Cloud resources whose description + * contains "por" as a substring. + * * `location : "us-west*"` to find Cloud resources whose location is + * prefixed with "us-west". + * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * a key or value. + * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * and its value is "prod". + * * `labels.env : *` to find Cloud resources which have a label "env". + * * `"Important"` to find Cloud resources which contain "Important" as a word + * in any of the searchable fields. + * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * in any of the searchable fields. + * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * any of the searchable fields. + * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud + * resources which contain "Important" as a word in any of the searchable + * fields and are also located in the "us-west1" region or the "global" + * location. + * + * See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more details. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". See [supported resource metadata + * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) + * for more details. + * @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 [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult}. + * 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 [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult} 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 [SearchAllResourcesRequest]{@link google.cloud.asset.v1.SearchAllResourcesRequest} + * 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 + * [SearchAllResourcesResponse]{@link google.cloud.asset.v1.SearchAllResourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + >, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + > + ): Promise< + [ + protos.google.cloud.asset.v1.IResourceSearchResult[], + protos.google.cloud.asset.v1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse + ] + > | 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({ + scope: request.scope || '', + }); + this.initialize(); + return this.innerApiCalls.searchAllResources(request, options, callback); + } + + /** + * Equivalent to {@link searchAllResources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAllResources} 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.scope + * Required. A scope can be a project, a folder or an organization. The search + * is limited to the resources within the `scope`. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} + * * projects/{PROJECT_NUMBER} + * * folders/{FOLDER_NUMBER} + * * organizations/{ORGANIZATION_NUMBER} + * @param {string} [request.query] + * Optional. The query statement. An empty query can be specified to search + * all the resources of certain `asset_types` within the given `scope`. + * + * Examples: + * + * * `name : "Important"` to find Cloud resources whose name contains + * "Important" as a word. + * * `displayName : "Impor*"` to find Cloud resources whose display name + * contains "Impor" as a word prefix. + * * `description : "*por*"` to find Cloud resources whose description + * contains "por" as a substring. + * * `location : "us-west*"` to find Cloud resources whose location is + * prefixed with "us-west". + * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * a key or value. + * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * and its value is "prod". + * * `labels.env : *` to find Cloud resources which have a label "env". + * * `"Important"` to find Cloud resources which contain "Important" as a word + * in any of the searchable fields. + * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * in any of the searchable fields. + * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * any of the searchable fields. + * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud + * resources which contain "Important" as a word in any of the searchable + * fields and are also located in the "us-west1" region or the "global" + * location. + * + * See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more details. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". See [supported resource metadata + * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) + * for more details. + * @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 [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult} on 'data' event. + */ + searchAllResourcesStream( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + 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({ + scope: request.scope || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.searchAllResources.createStream( + this.innerApiCalls.searchAllResources as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link searchAllResources}, 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.scope + * Required. A scope can be a project, a folder or an organization. The search + * is limited to the resources within the `scope`. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} + * * projects/{PROJECT_NUMBER} + * * folders/{FOLDER_NUMBER} + * * organizations/{ORGANIZATION_NUMBER} + * @param {string} [request.query] + * Optional. The query statement. An empty query can be specified to search + * all the resources of certain `asset_types` within the given `scope`. + * + * Examples: + * + * * `name : "Important"` to find Cloud resources whose name contains + * "Important" as a word. + * * `displayName : "Impor*"` to find Cloud resources whose display name + * contains "Impor" as a word prefix. + * * `description : "*por*"` to find Cloud resources whose description + * contains "por" as a substring. + * * `location : "us-west*"` to find Cloud resources whose location is + * prefixed with "us-west". + * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * a key or value. + * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * and its value is "prod". + * * `labels.env : *` to find Cloud resources which have a label "env". + * * `"Important"` to find Cloud resources which contain "Important" as a word + * in any of the searchable fields. + * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * in any of the searchable fields. + * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * any of the searchable fields. + * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud + * resources which contain "Important" as a word in any of the searchable + * fields and are also located in the "us-west1" region or the "global" + * location. + * + * See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more details. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". See [supported resource metadata + * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) + * for more details. + * @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. + */ + searchAllResourcesAsync( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + 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({ + scope: request.scope || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.searchAllResources.asyncIterate( + this.innerApiCalls['searchAllResources'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + ] + >; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + > + ): void; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + > + ): void; + /** + * Searches all the IAM policies within the given accessible scope (e.g., a + * project, a folder or an organization). Callers should have + * cloud.assets.SearchAllIamPolicies permission upon the requested scope, + * otherwise the request will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder or an organization. The search + * is limited to the IAM policies within the `scope`. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} + * * projects/{PROJECT_NUMBER} + * * folders/{FOLDER_NUMBER} + * * organizations/{ORGANIZATION_NUMBER} + * @param {string} [request.query] + * Optional. The query statement. An empty query can be specified to search + * all the IAM policies within the given `scope`. + * + * Examples: + * + * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that + * specify user "amy@gmail.com". + * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that + * specify the Compute Admin role. + * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM + * policy bindings that specify a role containing "storage.buckets.update" + * permission. + * * `resource : "organizations/123"` to find Cloud IAM policy bindings that + * are set on "organizations/123". + * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` + * to find Cloud IAM policy bindings that are set on "organizations/123" or + * "folders/1234", and also specify user "amy". + * + * See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more details. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult}. + * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult} 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 [SearchAllIamPoliciesRequest]{@link google.cloud.asset.v1.SearchAllIamPoliciesRequest} + * 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 + * [SearchAllIamPoliciesResponse]{@link google.cloud.asset.v1.SearchAllIamPoliciesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + >, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + > + ): Promise< + [ + protos.google.cloud.asset.v1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + ] + > | 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({ + scope: request.scope || '', + }); + this.initialize(); + return this.innerApiCalls.searchAllIamPolicies(request, options, callback); + } + + /** + * Equivalent to {@link searchAllIamPolicies}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAllIamPolicies} 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.scope + * Required. A scope can be a project, a folder or an organization. The search + * is limited to the IAM policies within the `scope`. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} + * * projects/{PROJECT_NUMBER} + * * folders/{FOLDER_NUMBER} + * * organizations/{ORGANIZATION_NUMBER} + * @param {string} [request.query] + * Optional. The query statement. An empty query can be specified to search + * all the IAM policies within the given `scope`. + * + * Examples: + * + * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that + * specify user "amy@gmail.com". + * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that + * specify the Compute Admin role. + * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM + * policy bindings that specify a role containing "storage.buckets.update" + * permission. + * * `resource : "organizations/123"` to find Cloud IAM policy bindings that + * are set on "organizations/123". + * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` + * to find Cloud IAM policy bindings that are set on "organizations/123" or + * "folders/1234", and also specify user "amy". + * + * See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more details. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult} on 'data' event. + */ + searchAllIamPoliciesStream( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + 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({ + scope: request.scope || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.createStream( + this.innerApiCalls.searchAllIamPolicies as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link searchAllIamPolicies}, 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.scope + * Required. A scope can be a project, a folder or an organization. The search + * is limited to the IAM policies within the `scope`. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} + * * projects/{PROJECT_NUMBER} + * * folders/{FOLDER_NUMBER} + * * organizations/{ORGANIZATION_NUMBER} + * @param {string} [request.query] + * Optional. The query statement. An empty query can be specified to search + * all the IAM policies within the given `scope`. + * + * Examples: + * + * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that + * specify user "amy@gmail.com". + * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that + * specify the Compute Admin role. + * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM + * policy bindings that specify a role containing "storage.buckets.update" + * permission. + * * `resource : "organizations/123"` to find Cloud IAM policy bindings that + * are set on "organizations/123". + * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` + * to find Cloud IAM policy bindings that are set on "organizations/123" or + * "folders/1234", and also specify user "amy". + * + * See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more details. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @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. + */ + searchAllIamPoliciesAsync( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + 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({ + scope: request.scope || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.asyncIterate( + this.innerApiCalls['searchAllIamPolicies'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index f114f91b5cc..cac505fc9df 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -47,6 +47,14 @@ "DeleteFeed": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "SearchAllResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchAllIamPolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 098be3548e1..8112f52d13f 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "488a18ba934dbd3902595a5d4ea783033486b040" + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "238c11abedd65bc896762383a753e3c9bc4acddf" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2fc2caaacb15949c7f80426bfc7dafdd41dbc333", - "internalRef": "310239576" + "sha": "cdf59a76184d5ddc24531f41567cf2411ae74593", + "internalRef": "312479172" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "7ee92820e64c0aea379781b82399d6b3f3c8655f" } } ], diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 708f2acf973..40976e91e77 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as assetserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { @@ -82,6 +84,67 @@ function stubLongRunningCallWithCallback( : 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.AssetServiceClient', () => { it('has servicePath', () => { const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; @@ -1028,6 +1091,640 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('searchAllResources', () => { + it('invokes searchAllResources without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCall( + expectedResponse + ); + const [response] = await client.searchAllResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResources without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.searchAllResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IResourceSearchResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllResources with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAllResources(request), expectedError); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResourcesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + 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.searchAllResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllResources, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes searchAllResourcesStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllResources, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllResources without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = []; + const iterable = client.searchAllResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllResources with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchAllResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllResources + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( + expectedResponse + ); + const [response] = await client.searchAllIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.searchAllIamPolicies( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.asset.v1.IIamPolicySearchResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAllIamPolicies(request), expectedError); + assert( + (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllIamPoliciesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + ]; + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + 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.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes searchAllIamPoliciesStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.IamPolicySearchResult() + ), + ]; + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; + const iterable = client.searchAllIamPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchAllIamPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAllIamPolicies + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('folderFeed', () => { const fakePath = '/rendered/path/folderFeed'; From a742034eb8c63fd3e4e558ebe02262662a61f0c0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 May 2020 15:14:01 -0700 Subject: [PATCH 222/429] docs: properly format literal strings. (#333) PiperOrigin-RevId: 313202929 Source-Author: Google APIs Source-Date: Tue May 26 09:12:28 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: f563b1dffee42be2f61c326c39af4974c1984278 Source-Link: https://github.com/googleapis/googleapis/commit/f563b1dffee42be2f61c326c39af4974c1984278 --- .../protos/google/cloud/asset/v1/assets.proto | 36 +++++++++---------- packages/google-cloud-asset/synth.metadata | 8 ++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 4e537d5ce8a..df6a241435c 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -48,7 +48,7 @@ message TemporalAsset { Asset asset = 3; } -// A time window specified by its "start_time" and "end_time". +// A time window specified by its `start_time` and `end_time`. message TimeWindow { // Start time of the time window (exclusive). google.protobuf.Timestamp start_time = 1; @@ -70,14 +70,14 @@ message Asset { }; // The full name of the asset. For example: - // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1" + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` // // See [Resource // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. string name = 1; - // The type of the asset. For example: "compute.googleapis.com/Disk" + // The type of the asset. For example: `compute.googleapis.com/Disk` // // See [Supported asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) @@ -128,19 +128,19 @@ message Asset { // A representation of a Google Cloud resource. message Resource { - // The API version. For example: "v1" + // The API version. For example: `v1` string version = 1; // The URL of the discovery document containing the resource's JSON schema. // For example: - // "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest" + // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` // // This value is unspecified for resources that do not have an API based on a // discovery document, such as Cloud Bigtable. string discovery_document_uri = 2; // The JSON schema name listed in the discovery document. For example: - // "Project" + // `Project` // // This value is unspecified for resources that do not have an API based on a // discovery document, such as Cloud Bigtable. @@ -148,7 +148,7 @@ message Resource { // The REST URL for accessing the resource. An HTTP `GET` request using this // URL returns the resource itself. For example: - // "https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123" + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` // // This value is unspecified for resources without a REST API. string resource_url = 4; @@ -162,7 +162,7 @@ message Resource { // [Cloud IAM policy // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). // For example: - // "//cloudresourcemanager.googleapis.com/projects/my_project_123" + // `//cloudresourcemanager.googleapis.com/projects/my_project_123` // // For third-party assets, this field may be set differently. string parent = 5; @@ -179,7 +179,7 @@ message Resource { // A result of Resource Search, containing information of a cloud resoure. message ResourceSearchResult { // The full resource name of this resource. Example: - // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Cloud Asset Inventory Resource Name // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) // for more information. @@ -190,7 +190,7 @@ message ResourceSearchResult { // * use a free text query. Example: `"instance1"` string name = 1; - // The type of this resource. Example: "compute.googleapis.com/Disk". + // The type of this resource. Example: `compute.googleapis.com/Disk`. // // To search against the `asset_type`: // @@ -222,8 +222,8 @@ message ResourceSearchResult { // * use a free text query. Example: `"*important instance*"` string description = 5; - // Location can be "global", regional like "us-east1", or zonal like - // "us-west1-b". + // Location can be `global`, regional like `us-east1`, or zonal like + // `us-west1-b`. // // To search against the `location`: // @@ -256,13 +256,13 @@ message ResourceSearchResult { repeated string network_tags = 8; // The additional attributes of this resource. The attributes may vary from - // one resource type to another. Examples: "projectId" for Project, - // "dnsName" for DNS ManagedZone. + // one resource type to another. Examples: `projectId` for Project, + // `dnsName` for DNS ManagedZone. // // To search against the `additional_attributes`: // // * use a free text query to match the attributes values. Example: to search - // additional_attributes = { dnsName: "foobar" }, you can issue a query + // `additional_attributes = { dnsName: "foobar" }`, you can issue a query // `"foobar"`. google.protobuf.Struct additional_attributes = 9; } @@ -273,7 +273,7 @@ message IamPolicySearchResult { message Explanation { // IAM permissions message Permissions { - // A list of permissions. A sample permission string: "compute.disk.get". + // A list of permissions. A sample permission string: `compute.disk.get`. repeated string permissions = 1; } @@ -281,7 +281,7 @@ message IamPolicySearchResult { // permission query (i.e., a query containing `policy.role.permissions:`). // Example: if query `policy.role.permissions : "compute.disk.get"` // matches a policy binding that contains owner role, the - // matched_permissions will be {"roles/owner": ["compute.disk.get"]}. The + // matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The // roles can also be found in the returned `policy` bindings. Note that the // map is populated only for requests with permission queries. map matched_permissions = 1; @@ -289,7 +289,7 @@ message IamPolicySearchResult { // The full resource name of the resource associated with this IAM policy. // Example: - // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Cloud Asset Inventory Resource Name // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) // for more information. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 8112f52d13f..21424eca1bb 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,16 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "238c11abedd65bc896762383a753e3c9bc4acddf" + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "2f896c4fc347823549bd0b38df39fa30c25663bc" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cdf59a76184d5ddc24531f41567cf2411ae74593", - "internalRef": "312479172" + "sha": "f563b1dffee42be2f61c326c39af4974c1984278", + "internalRef": "313202929" } }, { From d4964e3ee7c700d69b2a963a71550f702abc78cc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 17:38:12 -0700 Subject: [PATCH 223/429] build: update protos.js (#334) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/041f5df7-f5d3-4b2a-9ede-0752bf41c185/targets --- .../google-cloud-asset/protos/protos.d.ts | 6 +++++ packages/google-cloud-asset/protos/protos.js | 26 +++++++++++++++++-- .../google-cloud-asset/protos/protos.json | 6 ++++- packages/google-cloud-asset/synth.metadata | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 734e82f02af..a94062d0375 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -10699,6 +10699,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -10740,6 +10743,9 @@ export namespace google { /** 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 diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index ef733355202..bd205401c12 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -26014,6 +26014,7 @@ * @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 */ /** @@ -26111,6 +26112,14 @@ */ 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 @@ -26155,6 +26164,8 @@ 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; }; @@ -26219,6 +26230,9 @@ 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; @@ -26313,6 +26327,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -26435,6 +26452,8 @@ 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; }; @@ -26462,6 +26481,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -26483,6 +26503,8 @@ 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; }; @@ -28276,7 +28298,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -28762,7 +28784,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index ae2da2f42b8..44f370d3b1b 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -2507,6 +2507,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -2742,7 +2746,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 21424eca1bb..8fc5b47385b 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "2f896c4fc347823549bd0b38df39fa30c25663bc" + "sha": "f55287c86b743004faee5269c2ecb9abb494b77c" } }, { From 8483caaee3baa7d4053dd13492e0d597e46bf710 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2020 10:39:29 -0700 Subject: [PATCH 224/429] chore: release 3.1.0 (#324) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 18 ++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index cec8f738277..652f1246e09 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,24 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.1.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.0.0...v3.1.0) (2020-06-04) + + +### Features + +* add `SearchAllResources` and `SearchAllIamPolicies` rpcs in asset service proto ([#332](https://www.github.com/googleapis/nodejs-asset/issues/332)) ([2f896c4](https://www.github.com/googleapis/nodejs-asset/commit/2f896c4fc347823549bd0b38df39fa30c25663bc)) +* added support for project id, order_by in SearchAllResources, search on location, labels and networkTags field ([321bc3a](https://www.github.com/googleapis/nodejs-asset/commit/321bc3ae0c187f29231037705a52ca4b805659ba)) +* check status of long running operation by its name ([#328](https://www.github.com/googleapis/nodejs-asset/issues/328)) ([488a18b](https://www.github.com/googleapis/nodejs-asset/commit/488a18ba934dbd3902595a5d4ea783033486b040)) +* clean proto list, add decoded function for longrunning method ([#327](https://www.github.com/googleapis/nodejs-asset/issues/327)) ([9e710b7](https://www.github.com/googleapis/nodejs-asset/commit/9e710b7a58132d2004ea8de0d1afdf2497ff702a)) + + +### Bug Fixes + +* remove eslint, update gax, fix generated protos, run the generator ([#311](https://www.github.com/googleapis/nodejs-asset/issues/311)) ([999b782](https://www.github.com/googleapis/nodejs-asset/commit/999b7824a2acb1538b1502029d7055aef930206c)) +* synth.py clean up for multiple version ([#326](https://www.github.com/googleapis/nodejs-asset/issues/326)) ([00e33b0](https://www.github.com/googleapis/nodejs-asset/commit/00e33b008089c8c1f7b8fba2eadef9ab744a75a6)) +* **deps:** update dependency @google-cloud/storage to v5 ([#330](https://www.github.com/googleapis/nodejs-asset/issues/330)) ([238c11a](https://www.github.com/googleapis/nodejs-asset/commit/238c11abedd65bc896762383a753e3c9bc4acddf)) +* **deps:** update dependency uuid to v8 ([#325](https://www.github.com/googleapis/nodejs-asset/issues/325)) ([dba0675](https://www.github.com/googleapis/nodejs-asset/commit/dba06757cbbcdcc244ae88197f01447176fc2ee3)) + ## [3.0.0](https://www.github.com/googleapis/nodejs-asset/compare/v2.2.0...v3.0.0) (2020-04-10) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1f78da5f283..4e030da65da 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.0.0", + "version": "3.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 9d7f9a0a53c..cf4dfb06049 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.0.0", + "@google-cloud/asset": "^3.1.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", "yargs": "^15.0.0" From 0b75fdec3d51f9f814a2041650db6156814c9745 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 9 Jun 2020 17:39:27 -0700 Subject: [PATCH 225/429] feat: move ts target to es2018 from es2016 (#337) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9b55eba7-85ee-48d5-a737-8b677439db4d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 --- packages/google-cloud-asset/protos/protos.js | 2 +- packages/google-cloud-asset/src/v1/asset_service_client.ts | 7 +++++++ .../google-cloud-asset/src/v1beta1/asset_service_client.ts | 7 +++++++ .../src/v1p1beta1/asset_service_client.ts | 7 +++++++ .../src/v1p2beta1/asset_service_client.ts | 7 +++++++ .../src/v1p4beta1/asset_service_client.ts | 7 +++++++ packages/google-cloud-asset/synth.metadata | 4 ++-- packages/google-cloud-asset/tsconfig.json | 2 +- 8 files changed, 39 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index bd205401c12..5ff357998b6 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_asset_3_0_0_protos || ($protobuf.roots._google_cloud_asset_3_0_0_protos = {}); + var $root = $protobuf.roots._google_cloud_asset_protos || ($protobuf.roots._google_cloud_asset_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 99c2983f1ac..4a2d0d3f605 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -101,6 +101,13 @@ export class AssetServiceClient { } 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 || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 672ea2cdf3c..3cc13069444 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -96,6 +96,13 @@ export class AssetServiceClient { } 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 || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index e4d5eb5ddd1..6179d5f9f78 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -98,6 +98,13 @@ export class AssetServiceClient { } 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 || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index be77b1a8fb6..e695e67bc86 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -90,6 +90,13 @@ export class AssetServiceClient { } 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 || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 8b495973712..b0fd0feb85f 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -96,6 +96,13 @@ export class AssetServiceClient { } 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 || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 8fc5b47385b..a28a2fc64c9 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "f55287c86b743004faee5269c2ecb9abb494b77c" + "sha": "5b830eb203eb03f88513c45e1ce4bd994957685b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7ee92820e64c0aea379781b82399d6b3f3c8655f" + "sha": "1c92077459db3dc50741e878f98b08c6261181e0" } } ], diff --git a/packages/google-cloud-asset/tsconfig.json b/packages/google-cloud-asset/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-asset/tsconfig.json +++ b/packages/google-cloud-asset/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From 81e3e1436def1474324eff6b1995eaf9f19713d6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:45:18 +0200 Subject: [PATCH 226/429] chore(deps): update dependency mocha to v8 (#341) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 4e030da65da..36baa9d7201 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -57,7 +57,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", - "mocha": "^7.1.1", + "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index cf4dfb06049..50294a59590 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -22,6 +22,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^7.0.0" + "mocha": "^8.0.0" } } From f0a30832602ebd89b58a5b39ee48303418663103 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 11 Jun 2020 09:56:45 -0700 Subject: [PATCH 227/429] chore(nodejs_templates): add script logging to node_library populate-secrets.sh (#342) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e306327b-605f-4c07-9420-c106e40c47d5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a28a2fc64c9..81359e86a47 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "5b830eb203eb03f88513c45e1ce4bd994957685b" + "sha": "0590785ac09c2459bc7c6eb77653a1a0696c27fe" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From c00c9a74ee2eb55590f67099e51d77d23430b7c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 12 Jun 2020 10:21:39 -0700 Subject: [PATCH 228/429] fix: handle fallback option properly autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .../src/v1/asset_service_client.ts | 13 +++++-------- .../src/v1beta1/asset_service_client.ts | 13 +++++-------- .../src/v1p1beta1/asset_service_client.ts | 13 +++++-------- .../src/v1p2beta1/asset_service_client.ts | 13 +++++-------- .../src/v1p4beta1/asset_service_client.ts | 13 +++++-------- packages/google-cloud-asset/synth.metadata | 2 +- 6 files changed, 26 insertions(+), 41 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 4a2d0d3f605..3b25dae0e8e 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -110,14 +110,11 @@ export class AssetServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // 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 AssetServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 3cc13069444..1e8bfc4f934 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -105,14 +105,11 @@ export class AssetServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // 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 AssetServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 6179d5f9f78..da49bfe4cad 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -107,14 +107,11 @@ export class AssetServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // 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 AssetServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index e695e67bc86..b67465d1745 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -99,14 +99,11 @@ export class AssetServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // 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 AssetServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index b0fd0feb85f..6d721079061 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -105,14 +105,11 @@ export class AssetServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // 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 AssetServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 81359e86a47..cbb4306eced 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "0590785ac09c2459bc7c6eb77653a1a0696c27fe" + "sha": "2b0f3e3953ee350ac71f18a2ac7dd51900425416" } }, { From 28a8609eeca6c1ce307c6a6720652944cc040d5c Mon Sep 17 00:00:00 2001 From: yuyifan-google <65194920+yuyifan-google@users.noreply.github.com> Date: Tue, 16 Jun 2020 10:24:49 -0700 Subject: [PATCH 229/429] docs(samples): add sample code for SearchAllResources and SearchAllIamPolicies (#343) --- .../google-cloud-asset/samples/package.json | 1 + .../samples/test/sample.test.js | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 50294a59590..5194b2df1f5 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@google-cloud/asset": "^3.1.0", + "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", "yargs": "^15.0.0" diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index f2b12b3a43e..dee632efa29 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -26,6 +26,12 @@ const storage = new Storage(); const bucketName = `asset-nodejs-${uuid.v4()}`; const bucket = storage.bucket(bucketName); +const Compute = require('@google-cloud/compute'); +const zone = new Compute().zone('us-central1-c'); +const vmName = `asset-nodejs-${uuid.v4()}`; + +let vm; + // Some of these tests can take an extremely long time, and occasionally // timeout, see: // "Timeout of 180000ms exceeded. For async tests and hooks". @@ -43,10 +49,12 @@ const delay = async test => { describe('quickstart sample tests', () => { before(async () => { await bucket.create(); + [vm] = await zone.createVM(vmName, {os: 'ubuntu'}); }); after(async () => { await bucket.delete(); + await vm.delete(); }); it('should export assets to specified path', async function () { @@ -71,4 +79,16 @@ describe('quickstart sample tests', () => { const stdout = execSync(`node quickstart ${assetName}`); assert.include(stdout, assetName); }); + + it('should search all resources successfully', async () => { + const query = `name:${vmName}`; + const stdout = execSync(`node searchAllResources '' ${query}`); + assert.include(stdout, vmName); + }); + + it('should search all iam policies successfully', async () => { + const query = 'policy:roles/owner'; + const stdout = execSync(`node searchAllIamPolicies '' ${query}`); + assert.include(stdout, 'roles/owner'); + }); }); From 789321fdeec36c0c7e2eb9f69152966c7b4a7879 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 13:12:10 -0700 Subject: [PATCH 230/429] chore: release 3.2.0 (#338) --- packages/google-cloud-asset/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 652f1246e09..10186ec5929 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.1.0...v3.2.0) (2020-06-16) + + +### Features + +* move ts target to es2018 from es2016 ([#337](https://www.github.com/googleapis/nodejs-asset/issues/337)) ([0590785](https://www.github.com/googleapis/nodejs-asset/commit/0590785ac09c2459bc7c6eb77653a1a0696c27fe)) + + +### Bug Fixes + +* handle fallback option properly ([77f9ca7](https://www.github.com/googleapis/nodejs-asset/commit/77f9ca77f9e2d0ea13964ba61d69e2fac7c5e969)) + ## [3.1.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.0.0...v3.1.0) (2020-06-04) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 36baa9d7201..faa72f6b640 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.1.0", + "version": "3.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 5194b2df1f5..297c019cb90 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.1.0", + "@google-cloud/asset": "^3.2.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 19903aacec33c2da2729ba4970b38d897632c6f9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 17 Jun 2020 15:13:22 -0700 Subject: [PATCH 231/429] feat: added support for condition in Feed (#346) --- packages/google-cloud-asset/README.md | 2 + .../google/cloud/asset/v1/asset_service.proto | 66 +- .../protos/google/cloud/asset/v1/assets.proto | 57 +- .../google-cloud-asset/protos/protos.d.ts | 290 ++++--- packages/google-cloud-asset/protos/protos.js | 771 +++++++++++------- .../google-cloud-asset/protos/protos.json | 127 +-- packages/google-cloud-asset/samples/README.md | 40 + .../src/v1/asset_service_client.ts | 32 +- packages/google-cloud-asset/synth.metadata | 6 +- 9 files changed, 851 insertions(+), 540 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 219f8e1f82a..a075ff84e41 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -100,6 +100,8 @@ has instructions for running the samples. | Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | | List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | | Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Search All Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) | +| Search All Resources | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllResources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) | | Update Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/updateFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) | diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 0eab6efdd13..db3ca4123df 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/asset/v1/assets.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"; @@ -41,10 +42,16 @@ service AssetService { "https://www.googleapis.com/auth/cloud-platform"; // Exports assets with time and resource types to a given Cloud Storage - // location. The output format is newline-delimited JSON. - // This API implements the - // [google.longrunning.Operation][google.longrunning.Operation] API allowing - // you to keep track of the export. + // location/BigQuery table. For Cloud Storage location destinations, the + // output format is newline-delimited JSON. Each line represents a + // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON + // format; for BigQuery table destinations, the output table stores the fields + // in asset proto as columns. This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API , which + // allows you to keep track of the export. We recommend intervals of at least + // 2 seconds with exponential retry to poll the export operation result. For + // regular-size resource parent, the export operation usually finishes within + // 5 minutes. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}:exportAssets" @@ -57,10 +64,10 @@ service AssetService { } // Batch gets the update history of assets that overlap a time window. - // For RESOURCE content, this API outputs history with asset in both - // non-delete or deleted status. // For IAM_POLICY content, this API outputs history when the asset and its // attached IAM POLICY both exist. This can create gaps in the output history. + // Otherwise, this API outputs history with asset in both non-delete or + // deleted status. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT // error. rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) @@ -158,7 +165,7 @@ message ExportAssetsRequest { // running the same query may get different results. google.protobuf.Timestamp read_time = 2; - // A list of asset types of which to take a snapshot for. For example: + // A list of asset types of which to take a snapshot for. Example: // "compute.googleapis.com/Disk". If specified, only matching assets will be // returned. See [Introduction to Cloud Asset // Inventory](https://cloud.google.com/asset-inventory/docs/overview) @@ -170,7 +177,7 @@ message ExportAssetsRequest { ContentType content_type = 4; // Required. Output configuration indicating where the results will be output - // to. All results will be in newline delimited JSON format. + // to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; } @@ -184,7 +191,6 @@ message ExportAssetsResponse { google.protobuf.Timestamp read_time = 1; // Output configuration indicating where the results were output to. - // All results are in JSON format. OutputConfig output_config = 2; } @@ -200,13 +206,11 @@ message BatchGetAssetsHistoryRequest { } ]; - // A list of the full names of the assets. For example: + // A list of the full names of the assets. + // See: https://cloud.google.com/asset-inventory/docs/resource-name-format + // Example: + // // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource - // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // and [Resource Name - // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - // for more info. // // The request becomes a no-op if the asset name list is empty, and the max // size of the asset name list is 100 in one request. @@ -310,9 +314,7 @@ message OutputConfig { GcsDestination gcs_destination = 1; // Destination on BigQuery. The output table stores the fields in asset - // proto as columns in BigQuery. The resource/iam_policy field is converted - // to a record with each field to a column, except metadata to a single JSON - // string. + // proto as columns in BigQuery. BigQueryDestination bigquery_destination = 2; } } @@ -322,16 +324,16 @@ message GcsDestination { // Required. oneof object_uri { // The uri of the Cloud Storage object. It's the same uri that is used by - // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and // Editing Object // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. string uri = 1; - // The uri prefix of all generated Cloud Storage objects. For example: + // The uri prefix of all generated Cloud Storage objects. Example: // "gs://bucket_name/object_name_prefix". Each object uri is in format: // "gs://bucket_name/object_name_prefix// and only - // contains assets for that type. starts from 0. For example: + // contains assets for that type. starts from 0. Example: // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is // the first shard of output objects containing all // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be @@ -341,7 +343,7 @@ message GcsDestination { } } -// A BigQuery destination. +// A BigQuery destination for exporting assets to. message BigQueryDestination { // Required. The BigQuery dataset in format // "projects/projectId/datasets/datasetId", to which the snapshot result @@ -364,7 +366,7 @@ message BigQueryDestination { // A Pub/Sub destination. message PubsubDestination { // The name of the Pub/Sub topic to publish to. - // For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + // Example: `projects/PROJECT_ID/topics/TOPIC_ID`. string topic = 1; } @@ -402,8 +404,8 @@ message Feed { // A list of the full names of the assets to receive updates. You must specify // either or both of asset_names and asset_types. Only asset updates matching - // specified asset_names and asset_types are exported to the feed. For - // example: + // specified asset_names or asset_types are exported to the feed. + // Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Resource // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) @@ -412,8 +414,8 @@ message Feed { // A list of types of the assets to receive updates. You must specify either // or both of asset_names and asset_types. Only asset updates matching - // specified asset_names and asset_types are exported to the feed. - // For example: `"compute.googleapis.com/Disk"` + // specified asset_names or asset_types are exported to the feed. + // Example: `"compute.googleapis.com/Disk"` // // See [this // topic](https://cloud.google.com/asset-inventory/docs/supported-asset-types) @@ -428,6 +430,16 @@ message Feed { // published to. FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; + + // A condition which determines whether an asset update should be published. + // If specified, an asset will be returned only when the expression evaluates + // to true. + // When set, `expression` field in the `Expr` must be a valid [CEL expression] + // (https://github.com/google/cel-spec) on a TemporalAsset with name + // `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted + // == true") will only publish Asset deletions. Other fields in `Expr` are + // optional. + google.type.Expr condition = 6; } // Search all resources request. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index df6a241435c..584259b18ff 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -26,6 +26,7 @@ import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/code.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -38,6 +39,24 @@ option php_namespace = "Google\\Cloud\\Asset\\V1"; // An asset in Google Cloud and its temporal metadata, including the time window // when it was observed and its status during that window. message TemporalAsset { + // State of prior asset. + enum PriorAssetState { + // prior_asset is not applicable for the current asset. + PRIOR_ASSET_STATE_UNSPECIFIED = 0; + + // prior_asset is populated correctly. + PRESENT = 1; + + // Failed to set prior_asset. + INVALID = 2; + + // Current asset is the first known state. + DOES_NOT_EXIST = 3; + + // prior_asset is a deletion. + DELETED = 4; + } + // The time window when the asset data and state was observed. TimeWindow window = 1; @@ -46,6 +65,13 @@ message TemporalAsset { // An asset in Google Cloud. Asset asset = 3; + + // State of prior_asset. + PriorAssetState prior_asset_state = 4; + + // Prior copy of the asset. Populated if prior_asset_state is PRESENT. + // Currently this is only set for responses in Real-Time Feed. + Asset prior_asset = 5; } // A time window specified by its `start_time` and `end_time`. @@ -62,14 +88,21 @@ message TimeWindow { // [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as Google -// Kubernetes Engine clusters and objects), or a Cloud IAM policy. +// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. message Asset { option (google.api.resource) = { type: "cloudasset.googleapis.com/Asset" pattern: "*" }; - // The full name of the asset. For example: + // The last update timestamp of an asset. update_time is updated when + // create/update/delete operation is performed. + google.protobuf.Timestamp update_time = 11; + + // The full name of the asset. Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` // // See [Resource @@ -77,7 +110,7 @@ message Asset { // for more information. string name = 1; - // The type of the asset. For example: `compute.googleapis.com/Disk` + // The type of the asset. Example: `compute.googleapis.com/Disk` // // See [Supported asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) @@ -107,10 +140,16 @@ message Asset { // A representation of an [access // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). oneof access_context_policy { + // Please also refer to the [access policy user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + // Please also refer to the [access level user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + // Please also refer to the [service perimeter user + // guide](https://cloud.google.com/vpc-service-controls/docs/overview). google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } @@ -122,24 +161,24 @@ message Asset { // is a project, folder, or organization, the ancestry path starts from the // asset itself. // - // For example: `["projects/123456789", "folders/5432", "organizations/1234"]` + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` repeated string ancestors = 10; } // A representation of a Google Cloud resource. message Resource { - // The API version. For example: `v1` + // The API version. Example: `v1` string version = 1; // The URL of the discovery document containing the resource's JSON schema. - // For example: + // Example: // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` // // This value is unspecified for resources that do not have an API based on a // discovery document, such as Cloud Bigtable. string discovery_document_uri = 2; - // The JSON schema name listed in the discovery document. For example: + // The JSON schema name listed in the discovery document. Example: // `Project` // // This value is unspecified for resources that do not have an API based on a @@ -147,7 +186,7 @@ message Resource { string discovery_name = 3; // The REST URL for accessing the resource. An HTTP `GET` request using this - // URL returns the resource itself. For example: + // URL returns the resource itself. Example: // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` // // This value is unspecified for resources without a REST API. @@ -161,7 +200,7 @@ message Resource { // For Google Cloud assets, this value is the parent resource defined in the // [Cloud IAM policy // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - // For example: + // Example: // `//cloudresourcemanager.googleapis.com/projects/my_project_123` // // For third-party assets, this field may be set differently. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index a94062d0375..710655b16ce 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1705,6 +1705,9 @@ export namespace google { /** Feed feedOutputConfig */ feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + + /** Feed condition */ + condition?: (google.type.IExpr|null); } /** Represents a Feed. */ @@ -1731,6 +1734,9 @@ export namespace google { /** Feed feedOutputConfig. */ public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** Feed condition. */ + public condition?: (google.type.IExpr|null); + /** * Creates a new Feed instance using the specified properties. * @param [properties] Properties to set @@ -2242,6 +2248,12 @@ export namespace google { /** TemporalAsset asset */ asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); } /** Represents a TemporalAsset. */ @@ -2262,6 +2274,12 @@ export namespace google { /** TemporalAsset asset. */ public asset?: (google.cloud.asset.v1.IAsset|null); + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set @@ -2333,6 +2351,18 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace TemporalAsset { + + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } + /** Properties of a TimeWindow. */ interface ITimeWindow { @@ -2432,6 +2462,9 @@ export namespace google { /** Properties of an Asset. */ interface IAsset { + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + /** Asset name */ name?: (string|null); @@ -2469,6 +2502,9 @@ export namespace google { */ constructor(properties?: google.cloud.asset.v1.IAsset); + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + /** Asset name. */ public name: string; @@ -15725,6 +15761,133 @@ export namespace google { } } + /** Namespace rpc. */ + namespace rpc { + + /** Code enum. */ + enum Code { + OK = 0, + CANCELLED = 1, + UNKNOWN = 2, + INVALID_ARGUMENT = 3, + DEADLINE_EXCEEDED = 4, + NOT_FOUND = 5, + ALREADY_EXISTS = 6, + PERMISSION_DENIED = 7, + UNAUTHENTICATED = 16, + RESOURCE_EXHAUSTED = 8, + FAILED_PRECONDITION = 9, + ABORTED = 10, + OUT_OF_RANGE = 11, + UNIMPLEMENTED = 12, + INTERNAL = 13, + UNAVAILABLE = 14, + DATA_LOSS = 15 + } + + /** 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 }; + } + } + /** Namespace longrunning. */ namespace longrunning { @@ -16640,131 +16803,4 @@ export namespace google { 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 }; - } - - /** Code enum. */ - enum Code { - OK = 0, - CANCELLED = 1, - UNKNOWN = 2, - INVALID_ARGUMENT = 3, - DEADLINE_EXCEEDED = 4, - NOT_FOUND = 5, - ALREADY_EXISTS = 6, - PERMISSION_DENIED = 7, - UNAUTHENTICATED = 16, - RESOURCE_EXHAUSTED = 8, - FAILED_PRECONDITION = 9, - ABORTED = 10, - OUT_OF_RANGE = 11, - UNIMPLEMENTED = 12, - INTERNAL = 13, - UNAVAILABLE = 14, - DATA_LOSS = 15 - } - } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 5ff357998b6..2c75151eed4 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -3806,6 +3806,7 @@ * @property {Array.|null} [assetTypes] Feed assetTypes * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + * @property {google.type.IExpr|null} [condition] Feed condition */ /** @@ -3865,6 +3866,14 @@ */ Feed.prototype.feedOutputConfig = null; + /** + * Feed condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.condition = null; + /** * Creates a new Feed instance using the specified properties. * @function create @@ -3901,6 +3910,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); if (message.feedOutputConfig != null && Object.hasOwnProperty.call(message, "feedOutputConfig")) $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -3954,6 +3965,9 @@ case 5: message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); break; + case 6: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -4022,6 +4036,11 @@ if (error) return "feedOutputConfig." + error; } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } return null; }; @@ -4080,6 +4099,11 @@ throw TypeError(".google.cloud.asset.v1.Feed.feedOutputConfig: object expected"); message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.fromObject(object.feedOutputConfig); } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.asset.v1.Feed.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } return message; }; @@ -4104,6 +4128,7 @@ object.name = ""; object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; object.feedOutputConfig = null; + object.condition = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4121,6 +4146,8 @@ object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; @@ -5198,6 +5225,8 @@ * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window * @property {boolean|null} [deleted] TemporalAsset deleted * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState + * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset */ /** @@ -5239,6 +5268,22 @@ */ TemporalAsset.prototype.asset = null; + /** + * TemporalAsset priorAssetState. + * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAssetState = 0; + + /** + * TemporalAsset priorAsset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAsset = null; + /** * Creates a new TemporalAsset instance using the specified properties. * @function create @@ -5269,6 +5314,10 @@ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); + if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) + $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -5312,6 +5361,12 @@ case 3: message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); break; + case 4: + message.priorAssetState = reader.int32(); + break; + case 5: + message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -5360,6 +5415,22 @@ if (error) return "asset." + error; } + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + switch (message.priorAssetState) { + default: + return "priorAssetState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); + if (error) + return "priorAsset." + error; + } return null; }; @@ -5387,6 +5458,33 @@ throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); } + switch (object.priorAssetState) { + case "PRIOR_ASSET_STATE_UNSPECIFIED": + case 0: + message.priorAssetState = 0; + break; + case "PRESENT": + case 1: + message.priorAssetState = 1; + break; + case "INVALID": + case 2: + message.priorAssetState = 2; + break; + case "DOES_NOT_EXIST": + case 3: + message.priorAssetState = 3; + break; + case "DELETED": + case 4: + message.priorAssetState = 4; + break; + } + if (object.priorAsset != null) { + if (typeof object.priorAsset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); + message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); + } return message; }; @@ -5407,6 +5505,8 @@ object.window = null; object.deleted = false; object.asset = null; + object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; + object.priorAsset = null; } if (message.window != null && message.hasOwnProperty("window")) object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); @@ -5414,6 +5514,10 @@ object.deleted = message.deleted; if (message.asset != null && message.hasOwnProperty("asset")) object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) + object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); return object; }; @@ -5428,6 +5532,26 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * PriorAssetState enum. + * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState + * @enum {number} + * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} INVALID=2 INVALID value + * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value + * @property {number} DELETED=4 DELETED value + */ + TemporalAsset.PriorAssetState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "DOES_NOT_EXIST"] = 3; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + return TemporalAsset; })(); @@ -5657,6 +5781,7 @@ * Properties of an Asset. * @memberof google.cloud.asset.v1 * @interface IAsset + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime * @property {string|null} [name] Asset name * @property {string|null} [assetType] Asset assetType * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource @@ -5685,6 +5810,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + /** * Asset name. * @member {string} name @@ -5815,6 +5948,8 @@ if (message.ancestors != null && message.ancestors.length) for (var i = 0; i < message.ancestors.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -5849,6 +5984,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 1: message.name = reader.string(); break; @@ -5916,6 +6054,11 @@ if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -5991,6 +6134,11 @@ if (object instanceof $root.google.cloud.asset.v1.Asset) return object; var message = new $root.google.cloud.asset.v1.Asset(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } if (object.name != null) message.name = String(object.name); if (object.assetType != null) @@ -6062,6 +6210,7 @@ object.assetType = ""; object.resource = null; object.iamPolicy = null; + object.updateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6096,6 +6245,8 @@ for (var j = 0; j < message.ancestors.length; ++j) object.ancestors[j] = message.ancestors[j]; } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; @@ -39406,6 +39557,316 @@ return identity; })(); + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + /** + * Code enum. + * @name google.rpc.Code + * @enum {number} + * @property {number} OK=0 OK value + * @property {number} CANCELLED=1 CANCELLED value + * @property {number} UNKNOWN=2 UNKNOWN value + * @property {number} INVALID_ARGUMENT=3 INVALID_ARGUMENT value + * @property {number} DEADLINE_EXCEEDED=4 DEADLINE_EXCEEDED value + * @property {number} NOT_FOUND=5 NOT_FOUND value + * @property {number} ALREADY_EXISTS=6 ALREADY_EXISTS value + * @property {number} PERMISSION_DENIED=7 PERMISSION_DENIED value + * @property {number} UNAUTHENTICATED=16 UNAUTHENTICATED value + * @property {number} RESOURCE_EXHAUSTED=8 RESOURCE_EXHAUSTED value + * @property {number} FAILED_PRECONDITION=9 FAILED_PRECONDITION value + * @property {number} ABORTED=10 ABORTED value + * @property {number} OUT_OF_RANGE=11 OUT_OF_RANGE value + * @property {number} UNIMPLEMENTED=12 UNIMPLEMENTED value + * @property {number} INTERNAL=13 INTERNAL value + * @property {number} UNAVAILABLE=14 UNAVAILABLE value + * @property {number} DATA_LOSS=15 DATA_LOSS value + */ + rpc.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "CANCELLED"] = 1; + values[valuesById[2] = "UNKNOWN"] = 2; + values[valuesById[3] = "INVALID_ARGUMENT"] = 3; + values[valuesById[4] = "DEADLINE_EXCEEDED"] = 4; + values[valuesById[5] = "NOT_FOUND"] = 5; + values[valuesById[6] = "ALREADY_EXISTS"] = 6; + values[valuesById[7] = "PERMISSION_DENIED"] = 7; + values[valuesById[16] = "UNAUTHENTICATED"] = 16; + values[valuesById[8] = "RESOURCE_EXHAUSTED"] = 8; + values[valuesById[9] = "FAILED_PRECONDITION"] = 9; + values[valuesById[10] = "ABORTED"] = 10; + values[valuesById[11] = "OUT_OF_RANGE"] = 11; + values[valuesById[12] = "UNIMPLEMENTED"] = 12; + values[valuesById[13] = "INTERNAL"] = 13; + values[valuesById[14] = "UNAVAILABLE"] = 14; + values[valuesById[15] = "DATA_LOSS"] = 15; + return values; + })(); + + 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; + })(); + google.longrunning = (function() { /** @@ -41407,316 +41868,6 @@ 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; - })(); - - /** - * Code enum. - * @name google.rpc.Code - * @enum {number} - * @property {number} OK=0 OK value - * @property {number} CANCELLED=1 CANCELLED value - * @property {number} UNKNOWN=2 UNKNOWN value - * @property {number} INVALID_ARGUMENT=3 INVALID_ARGUMENT value - * @property {number} DEADLINE_EXCEEDED=4 DEADLINE_EXCEEDED value - * @property {number} NOT_FOUND=5 NOT_FOUND value - * @property {number} ALREADY_EXISTS=6 ALREADY_EXISTS value - * @property {number} PERMISSION_DENIED=7 PERMISSION_DENIED value - * @property {number} UNAUTHENTICATED=16 UNAUTHENTICATED value - * @property {number} RESOURCE_EXHAUSTED=8 RESOURCE_EXHAUSTED value - * @property {number} FAILED_PRECONDITION=9 FAILED_PRECONDITION value - * @property {number} ABORTED=10 ABORTED value - * @property {number} OUT_OF_RANGE=11 OUT_OF_RANGE value - * @property {number} UNIMPLEMENTED=12 UNIMPLEMENTED value - * @property {number} INTERNAL=13 INTERNAL value - * @property {number} UNAVAILABLE=14 UNAVAILABLE value - * @property {number} DATA_LOSS=15 DATA_LOSS value - */ - rpc.Code = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OK"] = 0; - values[valuesById[1] = "CANCELLED"] = 1; - values[valuesById[2] = "UNKNOWN"] = 2; - values[valuesById[3] = "INVALID_ARGUMENT"] = 3; - values[valuesById[4] = "DEADLINE_EXCEEDED"] = 4; - values[valuesById[5] = "NOT_FOUND"] = 5; - values[valuesById[6] = "ALREADY_EXISTS"] = 6; - values[valuesById[7] = "PERMISSION_DENIED"] = 7; - values[valuesById[16] = "UNAUTHENTICATED"] = 16; - values[valuesById[8] = "RESOURCE_EXHAUSTED"] = 8; - values[valuesById[9] = "FAILED_PRECONDITION"] = 9; - values[valuesById[10] = "ABORTED"] = 10; - values[valuesById[11] = "OUT_OF_RANGE"] = 11; - values[valuesById[12] = "UNIMPLEMENTED"] = 12; - values[valuesById[13] = "INTERNAL"] = 13; - values[valuesById[14] = "UNAVAILABLE"] = 14; - values[valuesById[15] = "DATA_LOSS"] = 15; - return values; - })(); - - return rpc; - })(); - return google; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 44f370d3b1b..1baca8739b0 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -390,6 +390,10 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "condition": { + "type": "google.type.Expr", + "id": 6 } } }, @@ -520,6 +524,25 @@ "asset": { "type": "Asset", "id": 3 + }, + "priorAssetState": { + "type": "PriorAssetState", + "id": 4 + }, + "priorAsset": { + "type": "Asset", + "id": 5 + } + }, + "nested": { + "PriorAssetState": { + "values": { + "PRIOR_ASSET_STATE_UNSPECIFIED": 0, + "PRESENT": 1, + "INVALID": 2, + "DOES_NOT_EXIST": 3, + "DELETED": 4 + } } } }, @@ -550,6 +573,10 @@ } }, "fields": { + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, "name": { "type": "string", "id": 1 @@ -3770,6 +3797,56 @@ } } }, + "rpc": { + "options": { + "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", + "cc_enable_arenas": true + }, + "nested": { + "Code": { + "values": { + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15 + } + }, + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, "longrunning": { "options": { "cc_enable_arenas": true, @@ -3944,56 +4021,6 @@ } } } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/code;code", - "java_multiple_files": true, - "java_outer_classname": "CodeProto", - "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 - } - } - }, - "Code": { - "values": { - "OK": 0, - "CANCELLED": 1, - "UNKNOWN": 2, - "INVALID_ARGUMENT": 3, - "DEADLINE_EXCEEDED": 4, - "NOT_FOUND": 5, - "ALREADY_EXISTS": 6, - "PERMISSION_DENIED": 7, - "UNAUTHENTICATED": 16, - "RESOURCE_EXHAUSTED": 8, - "FAILED_PRECONDITION": 9, - "ABORTED": 10, - "OUT_OF_RANGE": 11, - "UNIMPLEMENTED": 12, - "INTERNAL": 13, - "UNAVAILABLE": 14, - "DATA_LOSS": 15 - } - } - } } } } diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index 85caa258991..03266aa3600 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -19,6 +19,8 @@ * [Get Feed](#get-feed) * [List Feeds](#list-feeds) * [Asset History Quickstart](#asset-history-quickstart) + * [Search All Iam Policies](#search-all-iam-policies) + * [Search All Resources](#search-all-resources) * [Update Feed](#update-feed) ## Before you begin @@ -169,6 +171,44 @@ __Usage:__ +### Search All Iam Policies + +Search All Iam Policies. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllIamPolicies.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) + +__Usage:__ + + +`node searchAllIamPolicies ` + + +----- + + + + +### Search All Resources + +Search All Resources. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllResources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) + +__Usage:__ + + +`node searchAllResources ` + + +----- + + + + ### Update Feed Update Feed. diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 3b25dae0e8e..ea71ab01140 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -387,10 +387,10 @@ export class AssetServiceClient { ): void; /** * Batch gets the update history of assets that overlap a time window. - * For RESOURCE content, this API outputs history with asset in both - * non-delete or deleted status. * For IAM_POLICY content, this API outputs history when the asset and its * attached IAM POLICY both exist. This can create gaps in the output history. + * Otherwise, this API outputs history with asset in both non-delete or + * deleted status. * If a specified asset does not exist, this API returns an INVALID_ARGUMENT * error. * @@ -401,13 +401,11 @@ export class AssetServiceClient { * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id")", or a project number (such as "projects/12345"). * @param {string[]} request.assetNames - * A list of the full names of the assets. For example: + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - * for more info. * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. @@ -938,10 +936,16 @@ export class AssetServiceClient { ): void; /** * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the - * {@link google.longrunning.Operation|google.longrunning.Operation} API allowing - * you to keep track of the export. + * location/BigQuery table. For Cloud Storage location destinations, the + * output format is newline-delimited JSON. Each line represents a + * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON + * format; for BigQuery table destinations, the output table stores the fields + * in asset proto as columns. This API implements the + * {@link google.longrunning.Operation|google.longrunning.Operation} API , which + * allows you to keep track of the export. We recommend intervals of at least + * 2 seconds with exponential retry to poll the export operation result. For + * regular-size resource parent, the export operation usually finishes within + * 5 minutes. * * @param {Object} request * The request object that will be sent. @@ -957,7 +961,7 @@ export class AssetServiceClient { * data collection and indexing, there is a volatile window during which * running the same query may get different results. * @param {string[]} request.assetTypes - * A list of asset types of which to take a snapshot for. For example: + * A list of asset types of which to take a snapshot for. Example: * "compute.googleapis.com/Disk". If specified, only matching assets will be * returned. See [Introduction to Cloud Asset * Inventory](https://cloud.google.com/asset-inventory/docs/overview) @@ -967,7 +971,7 @@ export class AssetServiceClient { * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. + * to. * @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. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index cbb4306eced..0bb3295623c 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "2b0f3e3953ee350ac71f18a2ac7dd51900425416" + "sha": "9032b4821cdeeac3f72c1a19b56f1b8b4f59cec6" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f563b1dffee42be2f61c326c39af4974c1984278", - "internalRef": "313202929" + "sha": "3dcb344dd2a03043708b3ba40c4df141a3d5b06b", + "internalRef": "316789767" } }, { From f1d522d9e2e192c3986e18d7dacef93c3d76ccb2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2020 15:25:29 -0700 Subject: [PATCH 232/429] chore: release 3.3.0 (#347) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 10186ec5929..d6996c6f640 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.3.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.2.0...v3.3.0) (2020-06-17) + + +### Features + +* added support for condition in Feed ([#346](https://www.github.com/googleapis/nodejs-asset/issues/346)) ([3508ee5](https://www.github.com/googleapis/nodejs-asset/commit/3508ee5a7cf7eead10e6d3e2c3df91487898d40e)) + ## [3.2.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.1.0...v3.2.0) (2020-06-16) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index faa72f6b640..655072be020 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.2.0", + "version": "3.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 297c019cb90..7d594d93e4c 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.2.0", + "@google-cloud/asset": "^3.3.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From c3d2e54b0c9ffef09c4e55e3edb6b82fd3fda049 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Jun 2020 07:46:45 -0700 Subject: [PATCH 233/429] chore: update node issue template (#348) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/37f383f8-7560-459e-b66c-def10ff830cb/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/b10590a4a1568548dd13cfcea9aa11d40898144b --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0bb3295623c..772405c4ffa 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "9032b4821cdeeac3f72c1a19b56f1b8b4f59cec6" + "sha": "77722620bce763a1f2e92afb8af6dfb5a507cad2" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" } } ], From f7ebdaab52b042f162b0c34240d0343beb9351c0 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 26 Jun 2020 15:25:25 -0700 Subject: [PATCH 234/429] feat: add v1p5beta1 API surface (#349) --- .../cloud/asset/v1p5beta1/asset_service.proto | 112 ++ .../google/cloud/asset/v1p5beta1/assets.proto | 127 ++ .../google-cloud-asset/protos/protos.d.ts | 541 ++++++ packages/google-cloud-asset/protos/protos.js | 1472 +++++++++++++++++ .../google-cloud-asset/protos/protos.json | 169 ++ packages/google-cloud-asset/src/index.ts | 12 +- .../src/v1p5beta1/asset_service_client.ts | 567 +++++++ .../asset_service_client_config.json | 30 + .../v1p5beta1/asset_service_proto_list.json | 9 + .../google-cloud-asset/src/v1p5beta1/index.ts | 19 + packages/google-cloud-asset/synth.metadata | 24 +- packages/google-cloud-asset/synth.py | 2 +- .../test/gapic_asset_service_v1p5beta1.ts | 486 ++++++ 13 files changed, 3557 insertions(+), 13 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto create mode 100644 packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts create mode 100644 packages/google-cloud-asset/src/v1p5beta1/asset_service_client_config.json create mode 100644 packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json create mode 100644 packages/google-cloud-asset/src/v1p5beta1/index.ts create mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto new file mode 100644 index 00000000000..52233ad05b3 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto @@ -0,0 +1,112 @@ +// 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.asset.v1p5beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p5beta1/assets.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P5Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p5beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists assets with time and resource types and returns paged results in + // response. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1p5beta1/{parent=*/*}/assets" + }; + } +} + +// ListAssets request. +message ListAssetsRequest { + // Required. Name of the organization or project the assets belong to. Format: + // "organizations/[organization-number]" (such as "organizations/123"), + // "projects/[project-number]" (such as "projects/my-project-id"), or + // "projects/[project-id]" (such as "projects/12345"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between 2018-10-02 UTC (inclusive) and the current time. If not specified, + // the current time will be used. Due to delays in resource data collection + // and indexing, there is a volatile window during which running the same + // query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types of which to take a snapshot for. For example: + // "compute.googleapis.com/Disk". If specified, only matching assets will be + // returned. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will + // be returned. + ContentType content_type = 4; + + // The maximum number of assets to be returned in a single response. Default + // is 100, minimum is 1, and maximum is 1000. + int32 page_size = 5; + + // The `next_page_token` returned from the previous `ListAssetsResponse`, or + // unspecified for the first `ListAssetsRequest`. It is a continuation of a + // prior `ListAssets` call, and the API should return the next page of assets. + string page_token = 6; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The Cloud Organization Policy set on an asset. + ORG_POLICY = 4; + + // The Cloud Access context mananger Policy set on an asset. + ACCESS_POLICY = 5; +} + +// ListAssets response. +message ListAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Assets. + repeated Asset assets = 2; + + // Token to retrieve the next page of results. Set to empty if there are no + // remaining results. + string next_page_token = 3; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto new file mode 100644 index 00000000000..b9d1e199157 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto @@ -0,0 +1,127 @@ +// 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.asset.v1p5beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1p5Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p5beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1"; + +// Cloud asset. This includes all Google Cloud Platform resources, +// Cloud IAM policies, and other non-GCP assets. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The full name of the asset. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // Type of the asset. Example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // Representation of the resource. + Resource resource = 3; + + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. + google.iam.v1.Policy iam_policy = 4; + + // Representation of the Cloud Organization Policy set on an asset. For each + // asset, there could be multiple Organization policies with different + // constraints. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // Representation of the Cloud Organization access policy. + oneof access_context_policy { + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, + // represented as a list of relative resource names. Ancestry path starts with + // the closest CRM ancestor and ends at root. If the asset is a CRM + // project/folder/organization, this starts from the asset itself. + // + // Example: ["projects/123456789", "folders/5432", "organizations/1234"] + repeated string ancestors = 10; +} + +// Representation of a cloud resource. +message Resource { + // The API version. Example: "v1". + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // For example: + // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. + // It will be left unspecified for resources without a discovery-based API, + // such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. + // Example: "Project". It will be left unspecified for resources (such as + // Cloud Bigtable) without a discovery-based API. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP GET operation using this + // URL returns the resource itself. + // Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + // It will be left unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For GCP assets, it is the parent resource defined in the [Cloud IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // For example: + // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + // + // For third-party assets, it is up to the users to define. + string parent = 5; + + // The content of the resource, in which some sensitive fields are scrubbed + // away and may not be present. + google.protobuf.Struct data = 6; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 710655b16ce..bfdd15d1708 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -8999,6 +8999,547 @@ export namespace google { } } } + + /** Namespace v1p5beta1. */ + namespace v1p5beta1 { + + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.asset.v1p5beta1.IListAssetsRequest, callback: google.cloud.asset.v1p5beta1.AssetService.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.asset.v1p5beta1.IListAssetsRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1p5beta1.ListAssetsResponse) => void; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ListAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1p5beta1.ContentType|keyof typeof google.cloud.asset.v1p5beta1.ContentType|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ListAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1p5beta1.ContentType|keyof typeof google.cloud.asset.v1p5beta1.ContentType); + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IListAssetsRequest): google.cloud.asset.v1p5beta1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @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.asset.v1p5beta1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @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.asset.v1p5beta1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets */ + assets?: (google.cloud.asset.v1p5beta1.IAsset[]|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IListAssetsResponse); + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets. */ + public assets: google.cloud.asset.v1p5beta1.IAsset[]; + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IListAssetsResponse): google.cloud.asset.v1p5beta1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @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.asset.v1p5beta1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @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.asset.v1p5beta1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1p5beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p5beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IAsset): google.cloud.asset.v1p5beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1p5beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1p5beta1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IResource): google.cloud.asset.v1p5beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1p5beta1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1p5beta1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } /** Namespace orgpolicy. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 2c75151eed4..2794026f7cc 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -21536,6 +21536,1478 @@ return v1p4beta1; })(); + asset.v1p5beta1 = (function() { + + /** + * Namespace v1p5beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p5beta1 = {}; + + v1p5beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService#listAssets}. + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p5beta1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.asset.v1p5beta1.AssetService.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.asset.v1p5beta1.ListAssetsRequest, $root.google.cloud.asset.v1p5beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p5beta1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {Array.|null} [assetTypes] ListAssetsRequest assetTypes + * @property {google.cloud.asset.v1p5beta1.ContentType|null} [contentType] ListAssetsRequest contentType + * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @property {string|null} [pageToken] ListAssetsRequest pageToken + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ListAssetsRequest contentType. + * @member {google.cloud.asset.v1p5beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.contentType = 0; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.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.asset.v1p5beta1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.pageSize = reader.int32(); + break; + case 6: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + 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 ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p5beta1.ContentType[message.contentType] : message.contentType; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssetsRequest; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p5beta1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1p5beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1p5beta1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IListAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {Array.|null} [assets] ListAssetsResponse assets + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.assets = $util.emptyArray; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1p5beta1.Asset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.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.asset.v1p5beta1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1p5beta1.Asset.decode(reader, reader.uint32())); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1p5beta1.Asset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.ListAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1p5beta1.Asset.fromObject(object.assets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1p5beta1.Asset.toObject(message.assets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssetsResponse; + })(); + + v1p5beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p5beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1p5beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + 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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p5beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1p5beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1p5beta1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1p5beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + case 7: + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + case 8: + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + case 9: + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p5beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.Asset) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p5beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p5beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1p5beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p5beta1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1p5beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.Resource) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + return v1p5beta1; + })(); + return asset; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 1baca8739b0..152c8eea39c 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -2003,6 +2003,175 @@ } } } + }, + "v1p5beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1p5Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p5beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p5beta1", + "cc_enable_arenas": true + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1p5beta1/{parent=*/*}/assets" + } + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5 + } + }, + "ListAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "Asset", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "oneofs": { + "accessContextPolicy": { + "oneof": [ + "accessPolicy", + "accessLevel", + "servicePerimeter" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "orgPolicy": { + "rule": "repeated", + "type": "google.cloud.orgpolicy.v1.Policy", + "id": 6 + }, + "accessPolicy": { + "type": "google.identity.accesscontextmanager.v1.AccessPolicy", + "id": 7 + }, + "accessLevel": { + "type": "google.identity.accesscontextmanager.v1.AccessLevel", + "id": 8 + }, + "servicePerimeter": { + "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", + "id": 9 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + } + } } } }, diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 41d52a5b663..36cccbfcd83 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -21,16 +21,26 @@ import * as v1 from './v1'; import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; import * as v1p4beta1 from './v1p4beta1'; +import * as v1p5beta1 from './v1p5beta1'; const AssetServiceClient = v1.AssetServiceClient; -export {v1beta1, v1, v1p1beta1, v1p2beta1, v1p4beta1, AssetServiceClient}; +export { + v1beta1, + v1, + v1p1beta1, + v1p2beta1, + v1p4beta1, + v1p5beta1, + AssetServiceClient, +}; export default { v1beta1, v1, v1p1beta1, v1p2beta1, v1p4beta1, + v1p5beta1, AssetServiceClient, }; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts new file mode 100644 index 00000000000..8dfcaef3277 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -0,0 +1,567 @@ +// 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, + 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 './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p5beta1 + */ +export class AssetServiceClient { + 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}; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @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 AssetServiceClient; + 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 AssetServiceClient 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 AssetServiceClient).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 + ); + + // 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 = { + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assets' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p5beta1.AssetService', + 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.assetServiceStub) { + return this.assetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.asset.v1p5beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p5beta1.AssetService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.asset.v1p5beta1.AssetService, + 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 assetServiceStubMethods = ['listAssets']; + for (const methodName of assetServiceStubMethods) { + const callPromise = this.assetServiceStub.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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.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 -- + // ------------------- + + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1p5beta1.IAsset[], + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest | null, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + > + ): void; + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + > + ): void; + /** + * Lists assets with time and resource types and returns paged results in + * response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-number]" (such as "projects/my-project-id"), or + * "projects/[project-id]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p5beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @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 [Asset]{@link google.cloud.asset.v1p5beta1.Asset}. + * 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 [Asset]{@link google.cloud.asset.v1p5beta1.Asset} 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 [ListAssetsRequest]{@link google.cloud.asset.v1p5beta1.ListAssetsRequest} + * 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 + * [ListAssetsResponse]{@link google.cloud.asset.v1p5beta1.ListAssetsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + >, + callback?: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + > + ): Promise< + [ + protos.google.cloud.asset.v1p5beta1.IAsset[], + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest | null, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + ] + > | 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.listAssets(request, options, callback); + } + + /** + * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssets} 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. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-number]" (such as "projects/my-project-id"), or + * "projects/[project-id]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p5beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @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 [Asset]{@link google.cloud.asset.v1p5beta1.Asset} on 'data' event. + */ + listAssetsStream( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + 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.listAssets.createStream( + this.innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listAssets}, 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. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-number]" (such as "projects/my-project-id"), or + * "projects/[project-id]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p5beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @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. + */ + listAssetsAsync( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + 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.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.assetServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client_config.json new file mode 100644 index 00000000000..1ac24652bc2 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.asset.v1p5beta1.AssetService": { + "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": { + "ListAssets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..98ff312c565 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/asset/v1p5beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p5beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" +] diff --git a/packages/google-cloud-asset/src/v1p5beta1/index.ts b/packages/google-cloud-asset/src/v1p5beta1/index.ts new file mode 100644 index 00000000000..275cf4b6f1b --- /dev/null +++ b/packages/google-cloud-asset/src/v1p5beta1/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 {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 772405c4ffa..0dd55e3beb1 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,23 +3,16 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "77722620bce763a1f2e92afb8af6dfb5a507cad2" + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "38548856357b8de69f86c8d127d6f2e876f35b2f" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3dcb344dd2a03043708b3ba40c4df141a3d5b06b", - "internalRef": "316789767" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "7c577e89f1c84545113b393b7d7964473251d123", + "internalRef": "318542700" } } ], @@ -68,6 +61,15 @@ "language": "typescript", "generator": "gapic-generator-typescript" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p5beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 36a8694f6fd..5c1968993b0 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -25,7 +25,7 @@ gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1'] +versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1', 'v1p5beta1'] name = 'asset' for version in versions: library = gapic.typescript_library( diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts new file mode 100644 index 00000000000..85fbafbae82 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -0,0 +1,486 @@ +// 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 assetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v1p5beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p5beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p5beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = assetserviceModule.v1p5beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + + it('has close method', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + 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 assetserviceModule.v1p5beta1.AssetServiceClient({ + 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('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1p5beta1.IAsset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p5beta1.Asset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1p5beta1.Asset) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p5beta1.Asset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1p5beta1.Asset) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.asset.v1p5beta1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1p5beta1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); From 2fec7cd31186a63ab0a6b5feab4f9a419f702df9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 Jun 2020 15:33:39 -0700 Subject: [PATCH 235/429] chore: release 3.4.0 (#350) --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index d6996c6f640..9fb57b85659 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.4.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.3.0...v3.4.0) (2020-06-26) + + +### Features + +* add v1p5beta1 API surface ([#349](https://www.github.com/googleapis/nodejs-asset/issues/349)) ([12b8ade](https://www.github.com/googleapis/nodejs-asset/commit/12b8ade2dee42b8578b0364d8876a6932288970c)) + ## [3.3.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.2.0...v3.3.0) (2020-06-17) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 655072be020..2c8332c8618 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.3.0", + "version": "3.4.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 7d594d93e4c..6c3705b4cc3 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.3.0", + "@google-cloud/asset": "^3.4.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 69f269b36ea2c22c19a1b4276a1b61fb9e8ae513 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 30 Jun 2020 21:13:42 -0700 Subject: [PATCH 236/429] chore: update gitattributes (#351) --- packages/google-cloud-asset/.gitattributes | 3 +++ packages/google-cloud-asset/synth.metadata | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-asset/.gitattributes diff --git a/packages/google-cloud-asset/.gitattributes b/packages/google-cloud-asset/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-asset/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0dd55e3beb1..4ad692d17fc 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "38548856357b8de69f86c8d127d6f2e876f35b2f" + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "495f9ed3bea66db2f340db6b9566bf9c34cb7935" } }, { @@ -14,6 +14,13 @@ "sha": "7c577e89f1c84545113b393b7d7964473251d123", "internalRef": "318542700" } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + } } ], "destinations": [ From b59c5d47275bc2ef2fd58be54aebe8956aafca2a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 11:50:04 -0700 Subject: [PATCH 237/429] build: use bazel build (#352) --- packages/google-cloud-asset/src/index.ts | 6 +-- .../src/v1/asset_service_client_config.json | 21 ++++++--- .../src/v1/asset_service_proto_list.json | 7 +-- .../v1beta1/asset_service_client_config.json | 4 +- .../src/v1beta1/asset_service_proto_list.json | 7 +-- .../asset_service_client_config.json | 6 ++- .../v1p1beta1/asset_service_proto_list.json | 7 +-- .../asset_service_client_config.json | 11 +++-- .../v1p2beta1/asset_service_proto_list.json | 7 +-- .../asset_service_client_config.json | 7 ++- .../v1p4beta1/asset_service_proto_list.json | 7 +-- .../v1p5beta1/asset_service_proto_list.json | 7 +-- packages/google-cloud-asset/synth.metadata | 44 +++++++++---------- packages/google-cloud-asset/synth.py | 19 ++------ 14 files changed, 71 insertions(+), 89 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 36cccbfcd83..c1c252fc3e6 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -17,30 +17,30 @@ // ** All changes to this file may be overwritten. ** import * as v1beta1 from './v1beta1'; -import * as v1 from './v1'; import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; import * as v1p4beta1 from './v1p4beta1'; import * as v1p5beta1 from './v1p5beta1'; +import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; export { v1beta1, - v1, v1p1beta1, v1p2beta1, v1p4beta1, v1p5beta1, + v1, AssetServiceClient, }; export default { v1beta1, - v1, v1p1beta1, v1p2beta1, v1p4beta1, v1p5beta1, + v1, AssetServiceClient, }; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index cac505fc9df..ac06aea1e81 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -21,39 +21,48 @@ }, "methods": { "ExportAssets": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateFeed": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFeeds": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFeed": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "SearchAllResources": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 15000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "SearchAllIamPolicies": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 15000, + "retry_codes_name": "idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 44d0dc0156d..37185e2cc13 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1/asset_service.proto", - "../../protos/google/cloud/asset/v1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json index db596172fbe..dc9c90c255f 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json @@ -21,11 +21,13 @@ }, "methods": { "ExportAssets": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json index dc31fc2f4dc..6c8ef83a9be 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1beta1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json index 6379b9d29cc..fe7cd34beeb 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json @@ -21,11 +21,13 @@ }, "methods": { "SearchAllResources": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 15000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "SearchAllIamPolicies": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 15000, + "retry_codes_name": "idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json index fc21c31880e..4eba2431088 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p1beta1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1p1beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json index dc9dd42627e..aa7547b8a79 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json @@ -21,23 +21,28 @@ }, "methods": { "CreateFeed": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFeeds": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFeed": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json index d83da645e39..060b459873e 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p2beta1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1p2beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json index f43a62e3581..9f0c6639043 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -21,10 +24,12 @@ }, "methods": { "AnalyzeIamPolicy": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 300000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ExportIamPolicyAnalysis": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json index 10492e653da..081fb125b33 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1p4beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p4beta1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1p4beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json index 98ff312c565..cb107dd3fa8 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1p5beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p5beta1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1p5beta1/assets.proto" ] diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 4ad692d17fc..730bc32aaab 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "495f9ed3bea66db2f340db6b9566bf9c34cb7935" + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "1c34573510622fa114248f4f1682d910ef738905" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7c577e89f1c84545113b393b7d7964473251d123", - "internalRef": "318542700" + "sha": "b085d0af47a9addead321737ebde7448fd179a51", + "internalRef": "319801234" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -29,53 +29,53 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", "apiName": "asset", - "apiVersion": "v1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "apiVersion": "v1p1beta1", + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", "apiName": "asset", - "apiVersion": "v1p1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "apiVersion": "v1p2beta1", + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", "apiName": "asset", - "apiVersion": "v1p2beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "apiVersion": "v1p4beta1", + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", "apiName": "asset", - "apiVersion": "v1p4beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "apiVersion": "v1p5beta1", + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", "apiName": "asset", - "apiVersion": "v1p5beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "apiVersion": "v1", + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 5c1968993b0..386467dced0 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -24,26 +24,15 @@ AUTOSYNTH_MULTIPLE_COMMITS = True -gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1', 'v1p5beta1'] +gapic = gcp.GAPICBazel() +versions = ['v1beta1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1', 'v1p5beta1', 'v1'] name = 'asset' for version in versions: - library = gapic.typescript_library( - name, - proto_path=f'google/cloud/{name}/{version}', - generator_args={ - 'grpc-service-config': f'google/cloud/{name}/{version}/cloud{name}_grpc_service_config.json', - 'package-name': f'@google-cloud/{name}' - }, - # This API has dependencies outside of its own folder so we list them here. - # Switching to bazel build should help get rid of this. - extra_proto_files=['google/cloud/common_resources.proto', - 'google/cloud/orgpolicy/v1', 'google/identity/accesscontextmanager'], - version=version), + library = gapic.node_library(name, version) # skip index, protos, package.json, and README.md s.copy( library, - excludes=['package.json'] + excludes=['package.json', 'README.md'] ) # Copy common templates From 42d11d306535f65c1fb95b0442f4103616241b2c Mon Sep 17 00:00:00 2001 From: Larittic-GG <59073661+Larittic-GG@users.noreply.github.com> Date: Wed, 8 Jul 2020 11:45:05 -0700 Subject: [PATCH 238/429] feat(samples): add sample code for ListAssets v1p5beta1 (#355) --- packages/google-cloud-asset/samples/test/sample.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index dee632efa29..bdd96c7937b 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -91,4 +91,10 @@ describe('quickstart sample tests', () => { const stdout = execSync(`node searchAllIamPolicies '' ${query}`); assert.include(stdout, 'roles/owner'); }); + + it('should list assets successfully', async () => { + const assetType = 'storage.googleapis.com/Bucket'; + const stdout = execSync(`node listAssets ${assetType}`); + assert.include(stdout, assetType); + }); }); From d2610555261f98d9314d8bfc91d93ed3000a60db Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Jul 2020 01:13:25 +0000 Subject: [PATCH 239/429] chore: release 3.5.0 (#356) :robot: I have created a release \*beep\* \*boop\* --- ## [3.5.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.4.0...v3.5.0) (2020-07-08) ### Features * **samples:** add sample code for ListAssets v1p5beta1 ([#355](https://www.github.com/googleapis/nodejs-asset/issues/355)) ([1f4cef8](https://www.github.com/googleapis/nodejs-asset/commit/1f4cef8af558cc000aec52c4e92afc1774141c53)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 9fb57b85659..aaf84d54586 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.5.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.4.0...v3.5.0) (2020-07-08) + + +### Features + +* **samples:** add sample code for ListAssets v1p5beta1 ([#355](https://www.github.com/googleapis/nodejs-asset/issues/355)) ([1f4cef8](https://www.github.com/googleapis/nodejs-asset/commit/1f4cef8af558cc000aec52c4e92afc1774141c53)) + ## [3.4.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.3.0...v3.4.0) (2020-06-26) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 2c8332c8618..e8cd618173f 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.4.0", + "version": "3.5.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 6c3705b4cc3..286ebee8634 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.4.0", + "@google-cloud/asset": "^3.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 8cfb9a653b7daf17fb209c3df4c97142223d5ae6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 21:38:35 +0200 Subject: [PATCH 240/429] chore(deps): update dependency ts-loader to v8 (#357) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0) - [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**
--- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index e8cd618173f..bf876bdc61b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -61,7 +61,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^7.0.0", + "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" From 4e0eede96c22c4c03bb369b4ecb909d5db542c95 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 10 Jul 2020 15:36:17 -0700 Subject: [PATCH 241/429] build: typo in gitattribute (#360) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b --- packages/google-cloud-asset/.gitattributes | 2 +- packages/google-cloud-asset/README.md | 1 + packages/google-cloud-asset/samples/README.md | 20 +++++++++++++++++++ packages/google-cloud-asset/synth.metadata | 6 +++--- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/.gitattributes b/packages/google-cloud-asset/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-asset/.gitattributes +++ b/packages/google-cloud-asset/.gitattributes @@ -1,3 +1,3 @@ *.ts text eol=lf -*.js test eol=lf +*.js text eol=lf protos/* linguist-generated diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index a075ff84e41..9fec6b6d170 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -98,6 +98,7 @@ has instructions for running the samples. | Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | | Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | | Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | +| List Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) | | List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | | Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | Search All Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index 03266aa3600..b883ab1c86b 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -17,6 +17,7 @@ * [Export Assets](#export-assets) * [Get Batch Asset History](#get-batch-asset-history) * [Get Feed](#get-feed) + * [List Assets](#list-assets) * [List Feeds](#list-feeds) * [Asset History Quickstart](#asset-history-quickstart) * [Search All Iam Policies](#search-all-iam-policies) @@ -133,6 +134,25 @@ __Usage:__ +### List Assets + +List assets under the current project. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listAssets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) + +__Usage:__ + + +`node listAssets ` + + +----- + + + + ### List Feeds List Feeds. diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 730bc32aaab..355db4c9fe6 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "1c34573510622fa114248f4f1682d910ef738905" + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "1f4cef8af558cc000aec52c4e92afc1774141c53" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From d0034be743f2fbf2ccfc51c07d7f77fa8c97ce25 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:50:20 +0200 Subject: [PATCH 242/429] chore(deps): update dependency @types/mocha to v8 (#361) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.2` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### 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#googleapis/nodejs-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index bf876bdc61b..8840b4b3ddb 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -47,7 +47,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.2", + "@types/mocha": "^8.0.0", "@types/node": "^13.9.3", "@types/sinon": "^9.0.0", "c8": "^7.1.0", From d655e3185b72932c111f9e45edc3531820c63f67 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 14 Jul 2020 18:12:21 -0700 Subject: [PATCH 243/429] chore: update generated protos.js (#363) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9c6207e5-a7a6-4e44-ab6b-91751e0230b1/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-asset/protos/protos.js | 120 +++++++++++++++---- packages/google-cloud-asset/synth.metadata | 2 +- 2 files changed, 96 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 2794026f7cc..22201609fa0 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -6769,7 +6769,7 @@ ResourceSearchResult.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.asset.v1.ResourceSearchResult(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ResourceSearchResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6792,12 +6792,26 @@ message.location = reader.string(); break; case 7: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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 8: if (!(message.networkTags && message.networkTags.length)) @@ -7350,17 +7364,31 @@ Explanation.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.asset.v1.IamPolicySearchResult.Explanation(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.matchedPermissions === $util.emptyObject) message.matchedPermissions = {}; - key = reader.string(); - reader.pos++; - message.matchedPermissions[key] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; break; default: reader.skipType(tag & 7); @@ -11650,7 +11678,7 @@ StandardResourceMetadata.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.asset.v1p1beta1.StandardResourceMetadata(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11678,12 +11706,26 @@ message.location = reader.string(); break; case 12: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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: if (!(message.networkTags && message.networkTags.length)) @@ -12241,17 +12283,31 @@ Explanation.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.asset.v1p1beta1.IamPolicySearchResult.Explanation(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.matchedPermissions === $util.emptyObject) message.matchedPermissions = {}; - key = reader.string(); - reader.pos++; - message.matchedPermissions[key] = $root.google.cloud.asset.v1p1beta1.Permissions.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1p1beta1.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; break; default: reader.skipType(tag & 7); @@ -35015,17 +35071,31 @@ Struct.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.Struct(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.fields === $util.emptyObject) message.fields = {}; - key = reader.string(); - reader.pos++; - message.fields[key] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; break; default: reader.skipType(tag & 7); diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 355db4c9fe6..ea1eafea201 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "1f4cef8af558cc000aec52c4e92afc1774141c53" + "sha": "046d8e6fa77376bc6b70067002ee822d527713fa" } }, { From fad13571e70bdbe7a6e83e928d618a09431e0171 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 14 Jul 2020 18:18:13 -0700 Subject: [PATCH 244/429] build: missing closing paren in publish script (#364) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9c6207e5-a7a6-4e44-ab6b-91751e0230b1/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/d82deccf657a66e31bd5da9efdb96c6fa322fc7e --- packages/google-cloud-asset/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index ea1eafea201..f2037c10c67 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" } } ], From b4d5de0e913d0ba9a56c1f10cd394575cb8f44b6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 15:10:07 -0700 Subject: [PATCH 245/429] chore: add config files for cloud-rad for node.js, delete Node 8 templates (#368) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5e903fff-57bb-4395-bb94-8b4d1909dbf6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21f1470ecd01424dc91c70f1a7c798e4e87d1eec Source-Link: https://github.com/googleapis/synthtool/commit/388e10f5ae302d3e8de1fac99f3a95d1ab8f824a --- .../google-cloud-asset/api-extractor.json | 369 ++++++++++++++++++ packages/google-cloud-asset/synth.metadata | 4 +- 2 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-asset/api-extractor.json diff --git a/packages/google-cloud-asset/api-extractor.json b/packages/google-cloud-asset/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-asset/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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f2037c10c67..0ba688d8ad6 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "046d8e6fa77376bc6b70067002ee822d527713fa" + "sha": "3bec1d691a0ab16c50fb36cd8e85184924588f3e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From ebd5ae0f4fc689fe4a76e57fc6a333e3ddb32b2d Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:45:49 -0400 Subject: [PATCH 246/429] chore: add dev dependencies for cloud-rad ref docs (#369) --- packages/google-cloud-asset/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 8840b4b3ddb..a7f3335a346 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -41,7 +41,9 @@ "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "google-gax": "^2.1.0" @@ -64,6 +66,8 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", - "webpack-cli": "^3.3.11" + "webpack-cli": "^3.3.11", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" } } From 0d6440b8854b08365d7a4e5458d75d2ff50e677b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 22 Jul 2020 17:40:10 -0700 Subject: [PATCH 247/429] build: rename _toc to toc (#370) Source-Author: F. Hinkelmann Source-Date: Tue Jul 21 10:53:20 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 99c93fe09f8c1dca09dfc0301c8668e3a70dd796 Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0ba688d8ad6..15634bfce17 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "3bec1d691a0ab16c50fb36cd8e85184924588f3e" + "sha": "b74af9f32cfd111cd5964486b7738c4177610e06" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" } } ], From a0d973f6eca16c8d384649758d8e1e7fd6002cab Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Jul 2020 05:18:52 -0700 Subject: [PATCH 248/429] fix: move gitattributes files to node templates (#371) Source-Author: F. Hinkelmann Source-Date: Thu Jul 23 01:45:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-asset/.gitattributes | 1 + packages/google-cloud-asset/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.gitattributes b/packages/google-cloud-asset/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-asset/.gitattributes +++ b/packages/google-cloud-asset/.gitattributes @@ -1,3 +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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 15634bfce17..489589762be 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "b74af9f32cfd111cd5964486b7738c4177610e06" + "sha": "aa6462b6221710ee9d0cc17e4826e8a685efd0b6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From 86e835e48747343667d346ec4280e0522c13aa0d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2020 12:38:48 -0700 Subject: [PATCH 249/429] chore: release 3.5.1 (#372) * chore: updated samples/package.json [ci skip] * chore: updated CHANGELOG.md [ci skip] * chore: updated package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index aaf84d54586..49c6a8f48bd 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.5.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.5.0...v3.5.1) (2020-07-27) + + +### Bug Fixes + +* move gitattributes files to node templates ([#371](https://www.github.com/googleapis/nodejs-asset/issues/371)) ([e05f810](https://www.github.com/googleapis/nodejs-asset/commit/e05f810f0f15975d52fd9f6d62c8b194c8e96b5a)) + ## [3.5.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.4.0...v3.5.0) (2020-07-08) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index a7f3335a346..4a393ec4c70 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.5.0", + "version": "3.5.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 286ebee8634..1dee684bb8c 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.5.0", + "@google-cloud/asset": "^3.5.1", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 2c6d5edffd7d1b7ed4c0ee564da3ba31ade7bdd7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jul 2020 11:58:04 -0700 Subject: [PATCH 250/429] chore(node): fix kokoro build path for cloud-rad (#373) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4bdc1826-2f69-49f1-a63b-94f99cceb5ee/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 489589762be..1f54fa051db 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "aa6462b6221710ee9d0cc17e4826e8a685efd0b6" + "sha": "704044ac028a300e1c5cd500a76a6683e9b9d516" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 39fc9e0abb17cb2538a3fb7183ea655ab7011d4a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 19:44:17 -0700 Subject: [PATCH 251/429] build: update protos --- packages/google-cloud-asset/protos/protos.d.ts | 2 +- packages/google-cloud-asset/protos/protos.js | 2 +- packages/google-cloud-asset/synth.metadata | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index bfdd15d1708..2cb313c9d4a 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import * as Long from "long"; -import * as $protobuf from "protobufjs"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 22201609fa0..75dce3c91c8 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/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("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 1f54fa051db..0210011c0aa 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "704044ac028a300e1c5cd500a76a6683e9b9d516" + "sha": "c6c829cca12344dc439488541d825c49ba465159" } }, { From 697ccb2843d26e447903db813dd9f3a0a7f90386 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 31 Jul 2020 09:24:37 -0700 Subject: [PATCH 252/429] docs: add links to the CHANGELOG from the README.md for Java and Node (#375) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7b446397-88f3-4463-9e7d-d2ce7069989d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc --- packages/google-cloud-asset/README.md | 3 +++ packages/google-cloud-asset/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 9fec6b6d170..6585cd39ea1 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -14,6 +14,9 @@ Cloud Asset API client for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-asset/blob/master/CHANGELOG.md). + * [Cloud Asset Inventory Node.js Client API Reference][client-docs] * [Cloud Asset Inventory Documentation][product-docs] * [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0210011c0aa..0c28585e79e 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "c6c829cca12344dc439488541d825c49ba465159" + "sha": "6873b973cc02fd2a7a1e6015ac1d084f1ff6af7d" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From 0e2a80fcdc56872e37768bd01839b194cc92725d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 8 Aug 2020 11:36:23 -0700 Subject: [PATCH 253/429] build: --credential-file-override is no longer required (#377) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4de22315-84b1-493d-8da2-dfa7688128f5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0c28585e79e..26da05a128d 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "6873b973cc02fd2a7a1e6015ac1d084f1ff6af7d" + "sha": "11629d463902df67fc0f89aaa28d67378759ab41" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From 1987cd3f549f16dfcbd22a7ccb6a7c9813616e7d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 11 Aug 2020 11:24:08 -0700 Subject: [PATCH 254/429] build: use gapic-generator-typescript v1.0.7. (#378) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5f7f9c6d-c75a-4c60-8bb8-0026a14cead7/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 325949033 Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../google-cloud-asset/src/v1/asset_service_client.ts | 8 +++++--- .../src/v1beta1/asset_service_client.ts | 5 ++--- .../src/v1p1beta1/asset_service_client.ts | 5 ++--- .../src/v1p2beta1/asset_service_client.ts | 5 ++--- .../src/v1p4beta1/asset_service_client.ts | 5 ++--- .../src/v1p5beta1/asset_service_client.ts | 5 ++--- packages/google-cloud-asset/synth.metadata | 6 +++--- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index ea71ab01140..6afa5594263 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -290,12 +290,14 @@ export class AssetServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 1e8bfc4f934..bd554294b9d 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -244,12 +244,11 @@ export class AssetServiceClient { } ); + const descriptor = this.descriptors.longrunning[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index da49bfe4cad..f91f50ceac5 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -234,12 +234,11 @@ export class AssetServiceClient { } ); + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index b67465d1745..955d9fede69 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -228,12 +228,11 @@ export class AssetServiceClient { } ); + const descriptor = undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 6d721079061..0246454c843 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -251,12 +251,11 @@ export class AssetServiceClient { } ); + const descriptor = this.descriptors.longrunning[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 8dfcaef3277..12b511edabc 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -226,12 +226,11 @@ export class AssetServiceClient { } ); + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 26da05a128d..0d442e6ef01 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "11629d463902df67fc0f89aaa28d67378759ab41" + "sha": "c5bd3b7dfae1bf424b54b086c0db47310b2efc5b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b085d0af47a9addead321737ebde7448fd179a51", - "internalRef": "319801234" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From 733b4319bf51a01c73e4ff6a93f04d78ef469593 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 09:36:27 -0700 Subject: [PATCH 255/429] chore: update cloud rad kokoro build job (#379) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/bd0deaa1113b588d70449535ab9cbf0f2bd0e72f --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 0d442e6ef01..636bc0350a1 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "c5bd3b7dfae1bf424b54b086c0db47310b2efc5b" + "sha": "9a82f395d2550e38392b1e410d1da83208298996" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" } } ], From 1e64672c6f818c201f66768ff423b624dba1fd7a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 09:14:43 -0700 Subject: [PATCH 256/429] build: perform publish using Node 12 (#380) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5747555f7620113d9a2078a48f4c047a99d31b3e --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 636bc0350a1..bae50597055 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "9a82f395d2550e38392b1e410d1da83208298996" + "sha": "14fb06a1ca1d56888d0b86a5e16dd89cd1d65b6d" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From dccc67dcdae4d53ccaf211c4938a1aad7600fac3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Aug 2020 09:15:13 -0700 Subject: [PATCH 257/429] feat: added support OutputResult in ExportAssetsResponse. docs: updated existing docs. (#381) Clients receive detailed OutputResult in ExportAssetsResponse. PiperOrigin-RevId: 326582222 Source-Author: Google APIs Source-Date: Thu Aug 13 20:45:57 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 3a54e988edcbdef1e47c6ac19d3074a87214f667 Source-Link: https://github.com/googleapis/googleapis/commit/3a54e988edcbdef1e47c6ac19d3074a87214f667 --- .../google/cloud/asset/v1/asset_service.proto | 284 +++++---- .../protos/google/cloud/asset/v1/assets.proto | 65 ++- .../google-cloud-asset/protos/protos.d.ts | 189 ++++++ packages/google-cloud-asset/protos/protos.js | 441 ++++++++++++++ .../google-cloud-asset/protos/protos.json | 28 + .../src/v1/asset_service_client.ts | 547 ++++++++++-------- packages/google-cloud-asset/synth.metadata | 6 +- 7 files changed, 1163 insertions(+), 397 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index db3ca4123df..4aa3ee74ee2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -38,20 +38,18 @@ option php_namespace = "Google\\Cloud\\Asset\\V1"; // Asset service definition. service AssetService { option (google.api.default_host) = "cloudasset.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"; // Exports assets with time and resource types to a given Cloud Storage // location/BigQuery table. For Cloud Storage location destinations, the // output format is newline-delimited JSON. Each line represents a - // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON - // format; for BigQuery table destinations, the output table stores the fields - // in asset proto as columns. This API implements the - // [google.longrunning.Operation][google.longrunning.Operation] API , which - // allows you to keep track of the export. We recommend intervals of at least - // 2 seconds with exponential retry to poll the export operation result. For - // regular-size resource parent, the export operation usually finishes within - // 5 minutes. + // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table + // destinations, the output table stores the fields in asset proto as columns. + // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API + // , which allows you to keep track of the export. We recommend intervals of + // at least 2 seconds with exponential retry to poll the export operation + // result. For regular-size resource parent, the export operation usually + // finishes within 5 minutes. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}:exportAssets" @@ -70,8 +68,7 @@ service AssetService { // deleted status. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT // error. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) - returns (BatchGetAssetsHistoryResponse) { + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}:batchGetAssetsHistory" }; @@ -120,24 +117,22 @@ service AssetService { option (google.api.method_signature) = "name"; } - // Searches all the resources within the given accessible scope (e.g., a - // project, a folder or an organization). Callers should have - // cloud.assets.SearchAllResources permission upon the requested scope, + // Searches all Cloud resources within the specified scope, such as a project, + // folder, or organization. The caller must be granted the + // `cloudasset.assets.searchAllResources` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllResources(SearchAllResourcesRequest) - returns (SearchAllResourcesResponse) { + rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllResources" }; option (google.api.method_signature) = "scope,query,asset_types"; } - // Searches all the IAM policies within the given accessible scope (e.g., a - // project, a folder or an organization). Callers should have - // cloud.assets.SearchAllIamPolicies permission upon the requested scope, + // Searches all IAM policies within the specified scope, such as a project, + // folder, or organization. The caller must be granted the + // `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) - returns (SearchAllIamPoliciesResponse) { + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllIamPolicies" }; @@ -165,9 +160,22 @@ message ExportAssetsRequest { // running the same query may get different results. google.protobuf.Timestamp read_time = 2; - // A list of asset types of which to take a snapshot for. Example: - // "compute.googleapis.com/Disk". If specified, only matching assets will be - // returned. See [Introduction to Cloud Asset + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset // Inventory](https://cloud.google.com/asset-inventory/docs/overview) // for all supported asset types. repeated string asset_types = 3; @@ -176,22 +184,26 @@ message ExportAssetsRequest { // returned. ContentType content_type = 4; - // Required. Output configuration indicating where the results will be output - // to. + // Required. Output configuration indicating where the results will be output to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; } // The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] -// method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] -// field. +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. message ExportAssetsResponse { // Time the snapshot was taken. google.protobuf.Timestamp read_time = 1; // Output configuration indicating where the results were output to. OutputConfig output_config = 2; + + // Output result indicating where the assets were exported to. For example, a + // set of actual Google Cloud Storage object uris where the assets are + // exported to. The uris can be different from what [output_config] has + // specified, as the service will split the output object into multiple ones + // once it exceeds a single Google Cloud Storage object limit. + OutputResult output_result = 3; } // Batch get assets history request. @@ -247,8 +259,9 @@ message CreateFeedRequest { // be unique under a specific parent project/folder/organization. string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The feed details. The field `name` must be empty and it will be - // generated in the format of: projects/project_number/feeds/feed_id + // Required. The feed details. The field `name` must be empty and it will be generated + // in the format of: + // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; @@ -262,7 +275,9 @@ message GetFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } ]; } @@ -281,8 +296,8 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // Required. The new values of feed details. It must match an existing feed - // and the field `name` must be in the format of: + // Required. The new values of feed details. It must match an existing feed and the + // field `name` must be in the format of: // projects/project_number/feeds/feed_id or // folders/folder_number/feeds/feed_id or // organizations/organization_number/feeds/feed_id. @@ -291,8 +306,7 @@ message UpdateFeedRequest { // Required. Only updates the `feed` fields indicated by this mask. // The field mask must not be empty, and it must not contain fields that // are immutable or only set by the server. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } message DeleteFeedRequest { @@ -302,7 +316,9 @@ message DeleteFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } ]; } @@ -319,6 +335,22 @@ message OutputConfig { } } +// Output result of export assets. +message OutputResult { + // Asset export result. + oneof result { + // Export result on Cloud Storage. + GcsOutputResult gcs_result = 1; + } +} + +// A Cloud Storage output result. +message GcsOutputResult { + // List of uris of the Cloud Storage objects. Example: + // "gs://bucket_name/object_name". + repeated string uris = 1; +} + // A Cloud Storage location. message GcsDestination { // Required. @@ -428,8 +460,7 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5 - [(google.api.field_behavior) = REQUIRED]; + FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; // A condition which determines whether an asset update should be published. // If specified, an asset will be returned only when the expression evaluates @@ -437,82 +468,92 @@ message Feed { // When set, `expression` field in the `Expr` must be a valid [CEL expression] // (https://github.com/google/cel-spec) on a TemporalAsset with name // `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted - // == true") will only publish Asset deletions. Other fields in `Expr` are + // == true") will only publish Asset deletions. Other fields of `Expr` are // optional. + // + // See our [user + // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes#feed_with_condition) + // for detailed instructions. google.type.Expr condition = 6; } // Search all resources request. message SearchAllResourcesRequest { - // Required. A scope can be a project, a folder or an organization. The search - // is limited to the resources within the `scope`. + // Required. A scope can be a project, a folder, or an organization. The search is + // limited to the resources within the `scope`. The caller must be granted the + // [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // permission on the desired scope. // // The allowed values are: // - // * projects/{PROJECT_ID} - // * projects/{PROJECT_NUMBER} - // * folders/{FOLDER_NUMBER} - // * organizations/{ORGANIZATION_NUMBER} + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") string scope = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The query statement. An empty query can be specified to search - // all the resources of certain `asset_types` within the given `scope`. + // Optional. The query statement. See [how to construct a + // query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + // for more information. If not specified or empty, it will search all the + // resources within the specified `scope`. Note that the query string is + // compared against each Cloud IAM policy binding, including its members, + // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + // contain the bindings that match your query. To learn more about the IAM + // policy structure, see [IAM policy + // doc](https://cloud.google.com/iam/docs/policies#structure). // // Examples: // - // * `name : "Important"` to find Cloud resources whose name contains + // * `name:Important` to find Cloud resources whose name contains // "Important" as a word. - // * `displayName : "Impor*"` to find Cloud resources whose display name - // contains "Impor" as a word prefix. - // * `description : "*por*"` to find Cloud resources whose description + // * `displayName:Impor*` to find Cloud resources whose display name + // contains "Impor" as a prefix. + // * `description:*por*` to find Cloud resources whose description // contains "por" as a substring. - // * `location : "us-west*"` to find Cloud resources whose location is + // * `location:us-west*` to find Cloud resources whose location is // prefixed with "us-west". - // * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + // * `labels:prod` to find Cloud resources whose labels contain "prod" as // a key or value. - // * `labels.env : "prod"` to find Cloud resources which have a label "env" + // * `labels.env:prod` to find Cloud resources that have a label "env" // and its value is "prod". - // * `labels.env : *` to find Cloud resources which have a label "env". - // * `"Important"` to find Cloud resources which contain "Important" as a word + // * `labels.env:*` to find Cloud resources that have a label "env". + // * `Important` to find Cloud resources that contain "Important" as a word // in any of the searchable fields. - // * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + // * `Impor*` to find Cloud resources that contain "Impor" as a prefix // in any of the searchable fields. - // * `"*por*"` to find Cloud resources which contain "por" as a substring in + // * `*por*` to find Cloud resources that contain "por" as a substring in // any of the searchable fields. - // * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - // resources which contain "Important" as a word in any of the searchable + // * `Important location:(us-west1 OR global)` to find Cloud + // resources that contain "Important" as a word in any of the searchable // fields and are also located in the "us-west1" region or the "global" // location. - // - // See [how to construct a - // query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - // for more details. string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of asset types that this request searches for. If empty, - // it will search all the [searchable asset + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped - // at 500 even if a larger value is given. If set to zero, server will pick an - // appropriate default. Returned results may be fewer than requested. When - // this happens, there could be more results as long as `next_page_token` is - // returned. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If present, then retrieve the next batch of results from the - // preceding call to this method. `page_token` must be the value of - // `next_page_token` from the previous response. The values of all other - // method parameters, must be identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `page_token` must be the value of `next_page_token` from + // the previous response. The values of all other method parameters, must be + // identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma separated list of fields specifying the sorting order of - // the results. The default order is ascending. Add " DESC" after the field - // name to indicate descending order. Redundant space characters are ignored. - // Example: "location DESC, name". See [supported resource metadata - // fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - // for more details. + // Optional. A comma separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " DESC" after the field name + // to indicate descending order. Redundant space characters are ignored. + // Example: "location DESC, name". Only string fields in the response are + // sortable, including `name`, `displayName`, `description`, `location`. All + // the other fields such as repeated fields (e.g., `networkTags`), map + // fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + // are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -530,51 +571,58 @@ message SearchAllResourcesResponse { // Search all IAM policies request. message SearchAllIamPoliciesRequest { - // Required. A scope can be a project, a folder or an organization. The search - // is limited to the IAM policies within the `scope`. + // Required. A scope can be a project, a folder, or an organization. The search is + // limited to the IAM policies within the `scope`. The caller must be granted + // the + // [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // permission on the desired scope. // // The allowed values are: // - // * projects/{PROJECT_ID} - // * projects/{PROJECT_NUMBER} - // * folders/{FOLDER_NUMBER} - // * organizations/{ORGANIZATION_NUMBER} + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") string scope = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The query statement. An empty query can be specified to search - // all the IAM policies within the given `scope`. + // Optional. The query statement. See [how to construct a + // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + // for more information. If not specified or empty, it will search all the + // IAM policies within the specified `scope`. // // Examples: // - // * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - // specify user "amy@gmail.com". - // * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - // specify the Compute Admin role. - // * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - // policy bindings that specify a role containing "storage.buckets.update" - // permission. - // * `resource : "organizations/123"` to find Cloud IAM policy bindings that - // are set on "organizations/123". - // * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - // to find Cloud IAM policy bindings that are set on "organizations/123" or - // "folders/1234", and also specify user "amy". - // - // See [how to construct a - // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - // for more details. + // * `policy:amy@gmail.com` to find IAM policy bindings that specify user + // "amy@gmail.com". + // * `policy:roles/compute.admin` to find IAM policy bindings that specify + // the Compute Admin role. + // * `policy.role.permissions:storage.buckets.update` to find IAM policy + // bindings that specify a role containing "storage.buckets.update" + // permission. Note that if callers don't have `iam.roles.get` access to a + // role's included permissions, policy bindings that specify this role will + // be dropped from the search results. + // * `resource:organizations/123456` to find IAM policy bindings + // that are set on "organizations/123456". + // * `Important` to find IAM policy bindings that contain "Important" as a + // word in any of the searchable fields (except for the included + // permissions). + // * `*por*` to find IAM policy bindings that contain "por" as a substring + // in any of the searchable fields (except for the included permissions). + // * `resource:(instance1 OR instance2) policy:amy` to find + // IAM policy bindings that are set on resources "instance1" or + // "instance2" and also specify user "amy". string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped - // at 500 even if a larger value is given. If set to zero, server will pick an - // appropriate default. Returned results may be fewer than requested. When - // this happens, there could be more results as long as `next_page_token` is - // returned. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If present, retrieve the next batch of results from the preceding - // call to this method. `page_token` must be the value of `next_page_token` - // from the previous response. The values of all other method parameters must - // be identical to those in the previous call. + // Optional. If present, retrieve the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of all other method parameters must be + // identical to those in the previous call. string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -604,6 +652,6 @@ enum ContentType { // The Cloud Organization Policy set on an asset. ORG_POLICY = 4; - // The Cloud Access context mananger Policy set on an asset. + // The Cloud Access context manager Policy set on an asset. ACCESS_POLICY = 5; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 584259b18ff..b9d56744e16 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.asset.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; @@ -27,6 +26,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -150,8 +150,7 @@ message Asset { // Please also refer to the [service perimeter user // guide](https://cloud.google.com/vpc-service-controls/docs/overview). - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = - 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } // The ancestry path of an asset in Google Cloud [resource @@ -215,7 +214,7 @@ message Resource { string location = 8; } -// A result of Resource Search, containing information of a cloud resoure. +// A result of Resource Search, containing information of a cloud resource. message ResourceSearchResult { // The full resource name of this resource. Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. @@ -225,8 +224,8 @@ message ResourceSearchResult { // // To search against the `name`: // - // * use a field query. Example: `name : "instance1"` - // * use a free text query. Example: `"instance1"` + // * use a field query. Example: `name:instance1` + // * use a free text query. Example: `instance1` string name = 1; // The type of this resource. Example: `compute.googleapis.com/Disk`. @@ -248,7 +247,7 @@ message ResourceSearchResult { // // To search against the `display_name`: // - // * use a field query. Example: `displayName : "My Instance"` + // * use a field query. Example: `displayName:"My Instance"` // * use a free text query. Example: `"My Instance"` string display_name = 4; @@ -257,7 +256,7 @@ message ResourceSearchResult { // // To search against the `description`: // - // * use a field query. Example: `description : "*important instance*"` + // * use a field query. Example: `description:"*important instance*"` // * use a free text query. Example: `"*important instance*"` string description = 5; @@ -266,8 +265,8 @@ message ResourceSearchResult { // // To search against the `location`: // - // * use a field query. Example: `location : "us-west*"` - // * use a free text query. Example: `"us-west*"` + // * use a field query. Example: `location:us-west*` + // * use a free text query. Example: `us-west*` string location = 6; // Labels associated with this resource. See [Labelling and grouping GCP @@ -276,11 +275,11 @@ message ResourceSearchResult { // // To search against the `labels`: // - // * use a field query, as following: - // - query on any label's key or value. Example: `labels : "prod"` - // - query by a given label. Example: `labels.env : "prod"` - // - query by a given label'sexistence. Example: `labels.env : *` - // * use a free text query. Example: `"prod"` + // * use a field query: + // - query on any label's key or value. Example: `labels:prod` + // - query by a given label. Example: `labels.env:prod` + // - query by a given label's existence. Example: `labels.env:*` + // * use a free text query. Example: `prod` map labels = 7; // Network tags associated with this resource. Like labels, network tags are a @@ -290,19 +289,29 @@ message ResourceSearchResult { // // To search against the `network_tags`: // - // * use a field query. Example: `networkTags : "internal"` - // * use a free text query. Example: `"internal"` + // * use a field query. Example: `networkTags:internal` + // * use a free text query. Example: `internal` repeated string network_tags = 8; - // The additional attributes of this resource. The attributes may vary from - // one resource type to another. Examples: `projectId` for Project, - // `dnsName` for DNS ManagedZone. + // The additional searchable attributes of this resource. The attributes may + // vary from one resource type to another. Examples: `projectId` for Project, + // `dnsName` for DNS ManagedZone. This field contains a subset of the resource + // metadata fields that are returned by the List or Get APIs provided by the + // corresponding GCP service (e.g., Compute Engine). see [API references and + // supported searchable + // attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) + // for more information. + // + // You can search values of these fields through free text search. However, + // you should not consume the field programically as the field names and + // values may change as the GCP service updates to a new incompatible API + // version. // // To search against the `additional_attributes`: // // * use a free text query to match the attributes values. Example: to search // `additional_attributes = { dnsName: "foobar" }`, you can issue a query - // `"foobar"`. + // `foobar`. google.protobuf.Struct additional_attributes = 9; } @@ -318,7 +327,7 @@ message IamPolicySearchResult { // The map from roles to their included permissions that match the // permission query (i.e., a query containing `policy.role.permissions:`). - // Example: if query `policy.role.permissions : "compute.disk.get"` + // Example: if query `policy.role.permissions:compute.disk.get` // matches a policy binding that contains owner role, the // matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The // roles can also be found in the returned `policy` bindings. Note that the @@ -335,7 +344,7 @@ message IamPolicySearchResult { // // To search against the `resource`: // - // * use a field query. Example: `resource : "organizations/123"` + // * use a field query. Example: `resource:organizations/123` string resource = 1; // The project that the associated GCP resource belongs to, in the form of @@ -356,13 +365,13 @@ message IamPolicySearchResult { // // To search against the `policy` bindings: // - // * use a field query, as following: + // * use a field query: // - query by the policy contained members. Example: - // `policy : "amy@gmail.com"` + // `policy:amy@gmail.com` // - query by the policy contained roles. Example: - // `policy : "roles/compute.admin"` - // - query by the policy contained roles' implied permissions. Example: - // `policy.role.permissions : "compute.instances.create"` + // `policy:roles/compute.admin` + // - query by the policy contained roles' included permissions. Example: + // `policy.role.permissions:compute.instances.create` google.iam.v1.Policy policy = 3; // Explanation about the IAM policy search result. It contains additional diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 2cb313c9d4a..5e5c844f96b 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -361,6 +361,9 @@ export namespace google { /** ExportAssetsResponse outputConfig */ outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsResponse outputResult */ + outputResult?: (google.cloud.asset.v1.IOutputResult|null); } /** Represents an ExportAssetsResponse. */ @@ -378,6 +381,9 @@ export namespace google { /** ExportAssetsResponse outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** ExportAssetsResponse outputResult. */ + public outputResult?: (google.cloud.asset.v1.IOutputResult|null); + /** * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set @@ -1304,6 +1310,189 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an OutputResult. */ + interface IOutputResult { + + /** OutputResult gcsResult */ + gcsResult?: (google.cloud.asset.v1.IGcsOutputResult|null); + } + + /** Represents an OutputResult. */ + class OutputResult implements IOutputResult { + + /** + * Constructs a new OutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IOutputResult); + + /** OutputResult gcsResult. */ + public gcsResult?: (google.cloud.asset.v1.IGcsOutputResult|null); + + /** OutputResult result. */ + public result?: "gcsResult"; + + /** + * Creates a new OutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputResult instance + */ + public static create(properties?: google.cloud.asset.v1.IOutputResult): google.cloud.asset.v1.OutputResult; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputResult + * @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.asset.v1.OutputResult; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputResult + * @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.asset.v1.OutputResult; + + /** + * Verifies an OutputResult 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 OutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputResult; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @param message OutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.OutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsOutputResult. */ + interface IGcsOutputResult { + + /** GcsOutputResult uris */ + uris?: (string[]|null); + } + + /** Represents a GcsOutputResult. */ + class GcsOutputResult implements IGcsOutputResult { + + /** + * Constructs a new GcsOutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGcsOutputResult); + + /** GcsOutputResult uris. */ + public uris: string[]; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputResult instance + */ + public static create(properties?: google.cloud.asset.v1.IGcsOutputResult): google.cloud.asset.v1.GcsOutputResult; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputResult + * @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.asset.v1.GcsOutputResult; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputResult + * @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.asset.v1.GcsOutputResult; + + /** + * Verifies a GcsOutputResult 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 GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsOutputResult; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @param message GcsOutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GcsOutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a GcsDestination. */ interface IGcsDestination { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 75dce3c91c8..75251f38f6e 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -737,6 +737,7 @@ * @interface IExportAssetsResponse * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * @property {google.cloud.asset.v1.IOutputResult|null} [outputResult] ExportAssetsResponse outputResult */ /** @@ -770,6 +771,14 @@ */ ExportAssetsResponse.prototype.outputConfig = null; + /** + * ExportAssetsResponse outputResult. + * @member {google.cloud.asset.v1.IOutputResult|null|undefined} outputResult + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputResult = null; + /** * Creates a new ExportAssetsResponse instance using the specified properties. * @function create @@ -798,6 +807,8 @@ $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputResult != null && Object.hasOwnProperty.call(message, "outputResult")) + $root.google.cloud.asset.v1.OutputResult.encode(message.outputResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -838,6 +849,9 @@ case 2: message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); break; + case 3: + message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -883,6 +897,11 @@ if (error) return "outputConfig." + error; } + if (message.outputResult != null && message.hasOwnProperty("outputResult")) { + var error = $root.google.cloud.asset.v1.OutputResult.verify(message.outputResult); + if (error) + return "outputResult." + error; + } return null; }; @@ -908,6 +927,11 @@ throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); } + if (object.outputResult != null) { + if (typeof object.outputResult !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputResult: object expected"); + message.outputResult = $root.google.cloud.asset.v1.OutputResult.fromObject(object.outputResult); + } return message; }; @@ -927,11 +951,14 @@ if (options.defaults) { object.readTime = null; object.outputConfig = null; + object.outputResult = null; } if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.outputResult != null && message.hasOwnProperty("outputResult")) + object.outputResult = $root.google.cloud.asset.v1.OutputResult.toObject(message.outputResult, options); return object; }; @@ -2932,6 +2959,420 @@ return OutputConfig; })(); + v1.OutputResult = (function() { + + /** + * Properties of an OutputResult. + * @memberof google.cloud.asset.v1 + * @interface IOutputResult + * @property {google.cloud.asset.v1.IGcsOutputResult|null} [gcsResult] OutputResult gcsResult + */ + + /** + * Constructs a new OutputResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an OutputResult. + * @implements IOutputResult + * @constructor + * @param {google.cloud.asset.v1.IOutputResult=} [properties] Properties to set + */ + function OutputResult(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]]; + } + + /** + * OutputResult gcsResult. + * @member {google.cloud.asset.v1.IGcsOutputResult|null|undefined} gcsResult + * @memberof google.cloud.asset.v1.OutputResult + * @instance + */ + OutputResult.prototype.gcsResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputResult result. + * @member {"gcsResult"|undefined} result + * @memberof google.cloud.asset.v1.OutputResult + * @instance + */ + Object.defineProperty(OutputResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["gcsResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputResult} OutputResult instance + */ + OutputResult.create = function create(properties) { + return new OutputResult(properties); + }; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsResult != null && Object.hasOwnProperty.call(message, "gcsResult")) + $root.google.cloud.asset.v1.GcsOutputResult.encode(message.gcsResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.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.asset.v1.OutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputResult message. + * @function verify + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + properties.result = 1; + { + var error = $root.google.cloud.asset.v1.GcsOutputResult.verify(message.gcsResult); + if (error) + return "gcsResult." + error; + } + } + return null; + }; + + /** + * Creates an OutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + */ + OutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputResult) + return object; + var message = new $root.google.cloud.asset.v1.OutputResult(); + if (object.gcsResult != null) { + if (typeof object.gcsResult !== "object") + throw TypeError(".google.cloud.asset.v1.OutputResult.gcsResult: object expected"); + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.fromObject(object.gcsResult); + } + return message; + }; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.OutputResult} message OutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + object.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.toObject(message.gcsResult, options); + if (options.oneofs) + object.result = "gcsResult"; + } + return object; + }; + + /** + * Converts this OutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.OutputResult + * @instance + * @returns {Object.} JSON object + */ + OutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputResult; + })(); + + v1.GcsOutputResult = (function() { + + /** + * Properties of a GcsOutputResult. + * @memberof google.cloud.asset.v1 + * @interface IGcsOutputResult + * @property {Array.|null} [uris] GcsOutputResult uris + */ + + /** + * Constructs a new GcsOutputResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GcsOutputResult. + * @implements IGcsOutputResult + * @constructor + * @param {google.cloud.asset.v1.IGcsOutputResult=} [properties] Properties to set + */ + function GcsOutputResult(properties) { + this.uris = []; + 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]]; + } + + /** + * GcsOutputResult uris. + * @member {Array.} uris + * @memberof google.cloud.asset.v1.GcsOutputResult + * @instance + */ + GcsOutputResult.prototype.uris = $util.emptyArray; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult instance + */ + GcsOutputResult.create = function create(properties) { + return new GcsOutputResult(properties); + }; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.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.asset.v1.GcsOutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputResult message. + * @function verify + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + */ + GcsOutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsOutputResult) + return object; + var message = new $root.google.cloud.asset.v1.GcsOutputResult(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.asset.v1.GcsOutputResult.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.GcsOutputResult} message GcsOutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this GcsOutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GcsOutputResult + * @instance + * @returns {Object.} JSON object + */ + GcsOutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsOutputResult; + })(); + v1.GcsDestination = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 152c8eea39c..e4d819f310f 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -141,6 +141,10 @@ "outputConfig": { "type": "OutputConfig", "id": 2 + }, + "outputResult": { + "type": "OutputResult", + "id": 3 } } }, @@ -291,6 +295,30 @@ } } }, + "OutputResult": { + "oneofs": { + "result": { + "oneof": [ + "gcsResult" + ] + } + }, + "fields": { + "gcsResult": { + "type": "GcsOutputResult", + "id": 1 + } + } + }, + "GcsOutputResult": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "GcsDestination": { "oneofs": { "objectUri": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 6afa5594263..c6827482b5d 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -513,8 +513,9 @@ export class AssetServiceClient { * Required. This is the client-assigned asset feed identifier and it needs to * be unique under a specific parent project/folder/organization. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The feed details. The field `name` must be empty and it will be - * generated in the format of: projects/project_number/feeds/feed_id + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] @@ -761,8 +762,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The new values of feed details. It must match an existing feed - * and the field `name` must be in the format of: + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. @@ -940,14 +941,13 @@ export class AssetServiceClient { * Exports assets with time and resource types to a given Cloud Storage * location/BigQuery table. For Cloud Storage location destinations, the * output format is newline-delimited JSON. Each line represents a - * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON - * format; for BigQuery table destinations, the output table stores the fields - * in asset proto as columns. This API implements the - * {@link google.longrunning.Operation|google.longrunning.Operation} API , which - * allows you to keep track of the export. We recommend intervals of at least - * 2 seconds with exponential retry to poll the export operation result. For - * regular-size resource parent, the export operation usually finishes within - * 5 minutes. + * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON format; for BigQuery table + * destinations, the output table stores the fields in asset proto as columns. + * This API implements the {@link google.longrunning.Operation|google.longrunning.Operation} API + * , which allows you to keep track of the export. We recommend intervals of + * at least 2 seconds with exponential retry to poll the export operation + * result. For regular-size resource parent, the export operation usually + * finishes within 5 minutes. * * @param {Object} request * The request object that will be sent. @@ -963,17 +963,29 @@ export class AssetServiceClient { * data collection and indexing, there is a volatile window during which * running the same query may get different results. * @param {string[]} request.assetTypes - * A list of asset types of which to take a snapshot for. Example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset * Inventory](https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types. * @param {google.cloud.asset.v1.ContentType} request.contentType * Asset content type. If not specified, no content but the asset name will be * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. + * Required. Output configuration indicating where the results will be output to. * @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. @@ -1097,78 +1109,84 @@ export class AssetServiceClient { > ): void; /** - * Searches all the resources within the given accessible scope (e.g., a - * project, a folder or an organization). Callers should have - * cloud.assets.SearchAllResources permission upon the requested scope, + * Searches all Cloud resources within the specified scope, such as a project, + * folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllResources` permission on the desired scope, * otherwise the request will be rejected. * * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the resources within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the resources of certain `asset_types` within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * - * * `name : "Important"` to find Cloud resources whose name contains + * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. - * * `displayName : "Impor*"` to find Cloud resources whose display name - * contains "Impor" as a word prefix. - * * `description : "*por*"` to find Cloud resources whose description + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix. + * * `description:*por*` to find Cloud resources whose description * contains "por" as a substring. - * * `location : "us-west*"` to find Cloud resources whose location is + * * `location:us-west*` to find Cloud resources whose location is * prefixed with "us-west". - * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. - * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". - * * `labels.env : *` to find Cloud resources which have a label "env". - * * `"Important"` to find Cloud resources which contain "Important" as a word + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix * in any of the searchable fields. - * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * * `*por*` to find Cloud resources that contain "por" as a substring in * any of the searchable fields. - * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - * resources which contain "Important" as a word in any of the searchable + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" * location. - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - * for more details. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". See [supported resource metadata - * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - * for more details. + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". Only string fields in the response are + * sortable, including `name`, `displayName`, `description`, `location`. All + * the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not 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. @@ -1248,70 +1266,76 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the resources within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the resources of certain `asset_types` within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * - * * `name : "Important"` to find Cloud resources whose name contains + * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. - * * `displayName : "Impor*"` to find Cloud resources whose display name - * contains "Impor" as a word prefix. - * * `description : "*por*"` to find Cloud resources whose description + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix. + * * `description:*por*` to find Cloud resources whose description * contains "por" as a substring. - * * `location : "us-west*"` to find Cloud resources whose location is + * * `location:us-west*` to find Cloud resources whose location is * prefixed with "us-west". - * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. - * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". - * * `labels.env : *` to find Cloud resources which have a label "env". - * * `"Important"` to find Cloud resources which contain "Important" as a word + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix * in any of the searchable fields. - * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * * `*por*` to find Cloud resources that contain "por" as a substring in * any of the searchable fields. - * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - * resources which contain "Important" as a word in any of the searchable + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" * location. - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - * for more details. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". See [supported resource metadata - * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - * for more details. + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". Only string fields in the response are + * sortable, including `name`, `displayName`, `description`, `location`. All + * the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1347,70 +1371,76 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the resources within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the resources of certain `asset_types` within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * - * * `name : "Important"` to find Cloud resources whose name contains + * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. - * * `displayName : "Impor*"` to find Cloud resources whose display name - * contains "Impor" as a word prefix. - * * `description : "*por*"` to find Cloud resources whose description + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix. + * * `description:*por*` to find Cloud resources whose description * contains "por" as a substring. - * * `location : "us-west*"` to find Cloud resources whose location is + * * `location:us-west*` to find Cloud resources whose location is * prefixed with "us-west". - * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. - * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". - * * `labels.env : *` to find Cloud resources which have a label "env". - * * `"Important"` to find Cloud resources which contain "Important" as a word + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix * in any of the searchable fields. - * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * * `*por*` to find Cloud resources that contain "por" as a substring in * any of the searchable fields. - * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - * resources which contain "Important" as a word in any of the searchable + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" * location. - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - * for more details. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". See [supported resource metadata - * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - * for more details. + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". Only string fields in the response are + * sortable, including `name`, `displayName`, `description`, `location`. All + * the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1470,56 +1500,63 @@ export class AssetServiceClient { > ): void; /** - * Searches all the IAM policies within the given accessible scope (e.g., a - * project, a folder or an organization). Callers should have - * cloud.assets.SearchAllIamPolicies permission upon the requested scope, + * Searches all IAM policies within the specified scope, such as a project, + * folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, * otherwise the request will be rejected. * * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the IAM policies within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the IAM policies within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. * * Examples: * - * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - * specify user "amy@gmail.com". - * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - * specify the Compute Admin role. - * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - * policy bindings that specify a role containing "storage.buckets.update" - * permission. - * * `resource : "organizations/123"` to find Cloud IAM policy bindings that - * are set on "organizations/123". - * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - * to find Cloud IAM policy bindings that are set on "organizations/123" or - * "folders/1234", and also specify user "amy". - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - * for more details. + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `*por*` to find IAM policy bindings that contain "por" as a substring + * in any of the searchable fields (except for the included permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. * @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. @@ -1599,48 +1636,55 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the IAM policies within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the IAM policies within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. * * Examples: * - * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - * specify user "amy@gmail.com". - * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - * specify the Compute Admin role. - * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - * policy bindings that specify a role containing "storage.buckets.update" - * permission. - * * `resource : "organizations/123"` to find Cloud IAM policy bindings that - * are set on "organizations/123". - * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - * to find Cloud IAM policy bindings that are set on "organizations/123" or - * "folders/1234", and also specify user "amy". - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - * for more details. + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `*por*` to find IAM policy bindings that contain "por" as a substring + * in any of the searchable fields (except for the included permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1676,48 +1720,55 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the IAM policies within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the IAM policies within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. * * Examples: * - * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - * specify user "amy@gmail.com". - * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - * specify the Compute Admin role. - * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - * policy bindings that specify a role containing "storage.buckets.update" - * permission. - * * `resource : "organizations/123"` to find Cloud IAM policy bindings that - * are set on "organizations/123". - * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - * to find Cloud IAM policy bindings that are set on "organizations/123" or - * "folders/1234", and also specify user "amy". - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - * for more details. + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `*por*` to find IAM policy bindings that contain "por" as a substring + * in any of the searchable fields (except for the included permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index bae50597055..bcaa6e4b5a8 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "14fb06a1ca1d56888d0b86a5e16dd89cd1d65b6d" + "sha": "9aaf3976088f3e0a84aaf56637326c086d7bc767" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "3a54e988edcbdef1e47c6ac19d3074a87214f667", + "internalRef": "326582222" } }, { From 8260a642e7efd8530435458bde9903d100cd3c3f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2020 10:06:20 -0700 Subject: [PATCH 258/429] chore: release 3.6.0 (#382) * chore: updated samples/package.json [ci skip] * chore: updated CHANGELOG.md [ci skip] * chore: updated package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 49c6a8f48bd..e08b44f84bd 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.6.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.5.1...v3.6.0) (2020-08-14) + + +### Features + +* added support OutputResult in ExportAssetsResponse. docs: updated existing docs. ([#381](https://www.github.com/googleapis/nodejs-asset/issues/381)) ([fa8aadd](https://www.github.com/googleapis/nodejs-asset/commit/fa8aaddeadc21f1a7c343d208df21561ecb3ac8c)) + ### [3.5.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.5.0...v3.5.1) (2020-07-27) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 4a393ec4c70..795ac027afe 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.5.1", + "version": "3.6.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 1dee684bb8c..dd9ed2a0f80 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.5.1", + "@google-cloud/asset": "^3.6.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 72f1ecf0cdd8752b9d05409af5c5b2c137f9111c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Aug 2020 09:42:09 -0700 Subject: [PATCH 259/429] chore: start tracking obsolete files (#384) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7a1b0b96-8ddb-4836-a1a2-d2f73b7e6ffe/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-asset/synth.metadata | 116 ++++++++++++++++++++- 1 file changed, 112 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index bcaa6e4b5a8..db81d84bec2 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "9aaf3976088f3e0a84aaf56637326c086d7bc767" + "sha": "257717139b775213d058a1fa74118a226f6e0e9d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3a54e988edcbdef1e47c6ac19d3074a87214f667", - "internalRef": "326582222" + "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", + "internalRef": "327369997" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" + "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" } } ], @@ -78,5 +78,113 @@ "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/publish.yml", + ".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/lint.cfg", + ".kokoro/continuous/node10/samples-test.cfg", + ".kokoro/continuous/node10/system-test.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node10/samples-test.cfg", + ".kokoro/presubmit/node10/system-test.cfg", + ".kokoro/presubmit/node12/common.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", + "package-lock.json.1328904904", + "protos/google/cloud/asset/v1/asset_service.proto", + "protos/google/cloud/asset/v1/assets.proto", + "protos/google/cloud/asset/v1beta1/asset_service.proto", + "protos/google/cloud/asset/v1beta1/assets.proto", + "protos/google/cloud/asset/v1p1beta1/asset_service.proto", + "protos/google/cloud/asset/v1p1beta1/assets.proto", + "protos/google/cloud/asset/v1p2beta1/asset_service.proto", + "protos/google/cloud/asset/v1p2beta1/assets.proto", + "protos/google/cloud/asset/v1p4beta1/asset_service.proto", + "protos/google/cloud/asset/v1p4beta1/assets.proto", + "protos/google/cloud/asset/v1p5beta1/asset_service.proto", + "protos/google/cloud/asset/v1p5beta1/assets.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.2228148889", + "src/index.ts", + "src/v1/asset_service_client.ts", + "src/v1/asset_service_client_config.json", + "src/v1/asset_service_proto_list.json", + "src/v1/index.ts", + "src/v1beta1/asset_service_client.ts", + "src/v1beta1/asset_service_client_config.json", + "src/v1beta1/asset_service_proto_list.json", + "src/v1beta1/index.ts", + "src/v1p1beta1/asset_service_client.ts", + "src/v1p1beta1/asset_service_client_config.json", + "src/v1p1beta1/asset_service_proto_list.json", + "src/v1p1beta1/index.ts", + "src/v1p2beta1/asset_service_client.ts", + "src/v1p2beta1/asset_service_client_config.json", + "src/v1p2beta1/asset_service_proto_list.json", + "src/v1p2beta1/index.ts", + "src/v1p4beta1/asset_service_client.ts", + "src/v1p4beta1/asset_service_client_config.json", + "src/v1p4beta1/asset_service_proto_list.json", + "src/v1p4beta1/index.ts", + "src/v1p5beta1/asset_service_client.ts", + "src/v1p5beta1/asset_service_client_config.json", + "src/v1p5beta1/asset_service_proto_list.json", + "src/v1p5beta1/index.ts", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_asset_service_v1.ts", + "test/gapic_asset_service_v1beta1.ts", + "test/gapic_asset_service_v1p1beta1.ts", + "test/gapic_asset_service_v1p2beta1.ts", + "test/gapic_asset_service_v1p4beta1.ts", + "test/gapic_asset_service_v1p5beta1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From e047e32f1ba59bcb71bded42a04ad69c5580ab76 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 09:28:28 -0700 Subject: [PATCH 260/429] build: move system and samples test from Node 10 to Node 12 (#385) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/05de3e1e14a0b07eab8b474e669164dbd31f81fb --- packages/google-cloud-asset/synth.metadata | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index db81d84bec2..ac8732ec609 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "257717139b775213d058a1fa74118a226f6e0e9d" + "sha": "daa9de568ed01ba84ae64bce0ad09d82172cf707" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -96,19 +96,19 @@ ".kokoro/common.cfg", ".kokoro/continuous/node10/common.cfg", ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/lint.cfg", - ".kokoro/continuous/node10/samples-test.cfg", - ".kokoro/continuous/node10/system-test.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/node10/samples-test.cfg", - ".kokoro/presubmit/node10/system-test.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", @@ -131,7 +131,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.1328904904", "protos/google/cloud/asset/v1/asset_service.proto", "protos/google/cloud/asset/v1/assets.proto", "protos/google/cloud/asset/v1beta1/asset_service.proto", @@ -149,7 +148,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.2228148889", "src/index.ts", "src/v1/asset_service_client.ts", "src/v1/asset_service_client_config.json", From 4150414b7bffa7c8aeba1b2e023540b1370f2c63 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 24 Aug 2020 10:11:42 -0700 Subject: [PATCH 261/429] feat: add AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs (#386) PiperOrigin-RevId: 328059685 Source-Author: Google APIs Source-Date: Sun Aug 23 17:12:48 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 72eb54c45231d84266ca059473bc1793c394fcb2 Source-Link: https://github.com/googleapis/googleapis/commit/72eb54c45231d84266ca059473bc1793c394fcb2 --- .../google/cloud/asset/v1/asset_service.proto | 425 + .../protos/google/cloud/asset/v1/assets.proto | 160 +- .../google-cloud-asset/protos/protos.d.ts | 3715 +++++-- packages/google-cloud-asset/protos/protos.js | 9738 +++++++++++++---- .../google-cloud-asset/protos/protos.json | 524 +- .../src/v1/asset_service_client.ts | 274 + .../src/v1/asset_service_client_config.json | 13 + packages/google-cloud-asset/synth.metadata | 6 +- .../test/gapic_asset_service_v1.ts | 318 + 9 files changed, 12451 insertions(+), 2722 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 4aa3ee74ee2..fce88c71c5c 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -138,6 +138,36 @@ service AssetService { }; option (google.api.method_signature) = "scope,query"; } + + // Analyzes IAM policies to answer which identities have what accesses on + // which resources. + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) + returns (AnalyzeIamPolicyResponse) { + option (google.api.http) = { + get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + }; + } + + // Exports the answers of which identities have what accesses on which + // resources to a Google Cloud Storage or a BigQuery destination. For Cloud + // Storage destination, the output format is the JSON format that represents a + // [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. + // This method implements the + // [google.longrunning.Operation][google.longrunning.Operation], which allows + // you to track the export status. We recommend intervals of at least 2 + // seconds with exponential retry to poll the export operation result. The + // metadata contains the request to help callers to map responses to requests. + rpc ExportIamPolicyAnalysis(ExportIamPolicyAnalysisRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{analysis_query.scope=*/*}:exportIamPolicyAnalysis" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1.ExportIamPolicyAnalysisResponse" + metadata_type: "google.cloud.asset.v1.ExportIamPolicyAnalysisRequest" + }; + } } // Export asset request. @@ -638,6 +668,401 @@ message SearchAllIamPoliciesResponse { string next_page_token = 2; } +// IAM policy analysis query message. +message IamPolicyAnalysisQuery { + // The relative name of the root asset. Only resources and IAM policies within + // the scope will be analyzed. + // + // This can only be an organization number (such as "organizations/123"), a + // folder number (such as "folders/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + // + // To know how to get organization id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // To know how to get folder or project id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + string scope = 1 [ + (google.api.field_behavior) = REQUIRED + ]; + + // Specifies the resource to analyze for access policies, which may be set + // directly on the resource, or on ancestors such as organizations, folders or + // projects. + message ResourceSelector { + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of a resource of [supported resource + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies a resource for analysis. + ResourceSelector resource_selector = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Specifies an identity for which to determine resource access, based on + // roles assigned either directly to them or to the groups they belong to, + // directly or indirectly. + message IdentitySelector { + // The identity appear in the form of members in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + // + // The examples of supported forms are: + // "user:mike@example.com", + // "group:admins@example.com", + // "domain:google.com", + // "serviceAccount:my-project-id@appspot.gserviceaccount.com". + // + // Notice that wildcard characters (such as * and ?) are not supported. + // You must give a specific identity. + string identity = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies an identity for analysis. + IdentitySelector identity_selector = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Specifies roles and/or permissions to analyze, to determine both the + // identities possessing them and the resources they control. If multiple + // values are specified, results will include roles or permissions matching + // any of them. + message AccessSelector { + // The roles to appear in result. + repeated string roles = 1 [(google.api.field_behavior) = OPTIONAL]; + + // The permissions to appear in result. + repeated string permissions = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Specifies roles or permissions for analysis. This is optional. + AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Contains query options. + message Options { + // If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If + // [google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + // is specified, the identity in the result will be determined by the + // selector, and this flag is not allowed to set. + // + // Default is false. + bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; + + // If true, the access section of result will expand any roles + // appearing in IAM policy bindings to include their permissions. + // + // If + // [google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + // is specified, the access section of the result will be determined by the + // selector, and this flag is not allowed to set. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If true and + // [google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is not specified, the resource section of the result will expand any + // resource attached to an IAM policy to include resources lower in the + // resource hierarchy. + // + // For example, if the request analyzes for which resources user A has + // permission P, and the results include an IAM policy with P on a GCP + // folder, the results will also include resources in that folder with + // permission P. + // + // If true and + // [google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is specified, the resource section of the result will expand the + // specified resource to include resources lower in the resource hierarchy. + // + // For example, if the request analyzes for which users have permission P on + // a GCP folder with this option enabled, the results will include all users + // who have permission P on that folder or any lower resource(ex. project). + // + // Default is false. + bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; + + // If true, the result will output resource edges, starting + // from the policy attached resource, to any expanded resources. + // Default is false. + bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; + + // If true, the result will output group identity edges, starting + // from the binding's group members, to any expanded identities. + // Default is false. + bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; + + // If true, the response will include access analysis from identities to + // resources via service account impersonation. This is a very expensive + // operation, because many derived queries will be executed. We highly + // recommend you use + // [google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysis][google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysis] + // rpc instead. + // + // For example, if the request analyzes for which resources user A has + // permission P, and there's an IAM policy states user A has + // iam.serviceAccounts.getAccessToken permission to a service account SA, + // and there's another IAM policy states service account SA has permission P + // to a GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a GCP folder F, and there's an IAM policy states user A + // has iam.serviceAccounts.actAs permission to a service account SA, and + // there's another IAM policy states service account SA has permission P to + // the GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Default is false. + bool analyze_service_account_impersonation = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // The maximum number of fanouts per group when [expand_groups][expand_groups] + // is enabled. This internal field is to help load testing and determine a + // proper value, and won't be public in the future. + int32 max_fanouts_per_group = 7 [ + (google.api.field_behavior) = OPTIONAL + ]; + + // The maximum number of fanouts per parent resource, such as + // GCP Project etc., when [expand_resources][] is enabled. This internal + // field is to help load testing and determine a proper value, and won't be + // public in the future. + int32 max_fanouts_per_resource = 8 [ + (google.api.field_behavior) = OPTIONAL + ]; + } + + // The query options. + Options options = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for +// [google.cloud.asset.v1.AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyRequest { + // The request query. + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Amount of time executable has to complete. See JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + // + // If this field is set with a value less than the RPC deadline, and the + // execution of your query hasn't finished in the specified + // execution timeout, you will get a response with partial result. + // Otherwise, your query's execution will continue until the RPC deadline. + // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + // + // Default is empty. + // + // (-- We had discussion of whether we should have this field in the --) + // (-- request or use the RPC deadline instead. We finally choose this --) + // (-- approach for the following reasons (detailed in --) + // (-- go/analyze-iam-policy-deadlines): --) + // (-- * HTTP clients have very limited support of the RPC deadline. --) + // (-- There is an X-Server-Timeout header introduced in 2019/09, but --) + // (-- only implemented in the C++ HTTP server library. --) + // (-- * The purpose of the RPC deadline is for RPC clients to --) + // (-- communicate its max waiting time to the server. This deadline --) + // (-- could be further propagated to the downstream servers. It is --) + // (-- mainly used for servers to cancel the request processing --) + // (-- to avoid resource wasting. Overloading the RPC deadline for --) + // (-- other purposes could make our backend system harder to reason --) + // (-- about. --) + google.protobuf.Duration execution_timeout = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for +// [google.cloud.asset.v1.AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyResponse { + // An analysis message to group the query and results. + message IamPolicyAnalysis { + // The analysis query. + IamPolicyAnalysisQuery analysis_query = 1; + + // A list of [google.cloud.asset.v1.IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + // that matches the analysis query, or empty if no result is found. + repeated IamPolicyAnalysisResult analysis_results = 2; + + // Represents whether all entries in the + // [analysis_results][analysis_results] have been fully explored to answer + // the query. + bool fully_explored = 3; + + // A stats message that contains a set of analysis metrics. + // + // Here are some equations to show relationships of the explicitly specified + // metrics with other implicit metrics: + // * node_count = discovered_node_count + undiscovered_node_count(implicit) + // * discovered_node_count = explored_node_count + + // unexplored_node_count(implicit) + // * explored_node_count = capped_node_count + uncapped_node_count(implicit) + // * unexplored_node_count(implicit) = permission_denied_node_count + + // execution_timeout_node_count + other_unexplored_node_count(implicit) + // * discovered_node_count = matched_node_count + + // unmatched_node_count(implicit) + message Stats { + // Type of the node. + enum NodeType { + // Unspecified node type. + NODE_TYPE_UNSPECIFIED = 0; + // IAM Policy Binding node type. + BINDING = 1; + // Identity node type. + IDENTITY = 2; + // Resource node type. + RESOURCE = 3; + // Access node type. + ACCESS = 4; + } + + // Node type. + NodeType node_type = 1; + + // The subtype of a node, such as: + // * For Identity: Group, User, ServiceAccount etc. + // * For Resource: resource type name, such as + // cloudresourcemanager.googleapis.com/Organization, etc. + // * For Access: Role or Permission + string node_subtype = 2; + + // The count of discovered nodes. + int32 discovered_node_count = 3; + + // The count of nodes that match the query. These nodes form a sub-graph + // of discovered nodes. + int32 matched_node_count = 4; + + // The count of explored nodes. + int32 explored_node_count = 5; + + // The count of nodes that get explored, but are capped by max fanout + // setting. + int32 capped_node_count = 6; + + // The count of unexplored nodes caused by permission denied error. + int32 permision_denied_node_count = 7; + + // The count of unexplored nodes caused by execution timeout. + int32 execution_timeout_node_count = 8; + } + + // The stats of how the analysis has been explored. + repeated Stats stats = 4; + + // A list of non-critical errors happened during the query handling. + repeated IamPolicyAnalysisState non_critical_errors = 5; + } + + // The main analysis that matches the original request. + IamPolicyAnalysis main_analysis = 1; + + // The service account impersonation analysis if + // [google.cloud.asset.v1.AnalyzeIamPolicyRequest.analyze_service_account_impersonation][google.cloud.asset.v1.AnalyzeIamPolicyRequest.analyze_service_account_impersonation] + // is enabled. + repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; + + // Represents whether all entries in the [main_analysis][main_analysis] and + // [service_account_impersonation_analysis][] have been fully explored to + // answer the query in the request. + bool fully_explored = 3; +} + +// Output configuration for export IAM policy analysis destination. +message IamPolicyAnalysisOutputConfig { + // A Cloud Storage location. + message GcsDestination { + // The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A BigQuery destination. + message BigQueryDestination { + // The BigQuery dataset in format "projects/projectId/datasets/datasetId", + // to which the analysis results should be exported. If this dataset does + // not exist, the export call will return an INVALID_ARGUMENT error. + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED + ]; + + // The prefix of the BigQuery tables to which the analysis results will be + // written. Tables will be created based on this table_prefix if not exist: + // * _analysis table will contain export operation's metadata. + // * _analysis_result will contain all the + // [IamPolicyAnalysisResult][]. + // When [partition_key] is specified, both tables will be partitioned based + // on the [partition_key]. + string table_prefix = 2 [ + (google.api.field_behavior) = REQUIRED + ]; + + // This enum determines the partition key column for the bigquery tables. + // Partitioning can improve query performance and reduce query cost by + // filtering partitions. Refer to + // https://cloud.google.com/bigquery/docs/partitioned-tables for details. + enum PartitionKey { + // Unspecified partition key. Tables won't be partitioned using this + // option. + PARTITION_KEY_UNSPECIFIED = 0; + // The time when the request is received. If specified as partition key, + // the result table(s) is partitoned by the RequestTime column, an + // additional timestamp column representing when the request was received. + REQUEST_TIME = 1; + } + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 3; + + // Write mode types if table exists. + enum WriteMode { + // Unspecified write mode. We expect one of the following valid modes must + // be specified when table or partition exists. + WRITE_MODE_UNSPECIFIED = 0; + // Abort the export when table or partition exists. + ABORT = 1; + // Overwrite the table when table exists. When partitioned, overwrite + // the existing partition. + OVERWRITE = 2; + } + // The write mode when table exists. WriteMode is ignored when no existing + // tables, or no existing partitions are found. + WriteMode write_mode = 4; + } + + // IAM policy analysis export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on BigQuery. + BigQueryDestination bigquery_destination = 2; + } +} + +// A request message for [AssetService.ExportIamPolicyAnalysis][]. +message ExportIamPolicyAnalysisRequest { + // The request query. + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Output configuration indicating where the results will be output to. + IamPolicyAnalysisOutputConfig output_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The export IAM policy analysis response. +message ExportIamPolicyAnalysisResponse {} + // Asset content type. enum ContentType { // Unspecified content type. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index b9d56744e16..01c768532b1 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -22,11 +22,9 @@ import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; -import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -150,7 +148,8 @@ message Asset { // Please also refer to the [service perimeter user // guide](https://cloud.google.com/vpc-service-controls/docs/overview). - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; } // The ancestry path of an asset in Google Cloud [resource @@ -378,3 +377,158 @@ message IamPolicySearchResult { // information to explain why the search result matches the query. Explanation explanation = 4; } + +// Represents the detailed state of an entity under analysis, such as a +// resource, an identity or an access. +message IamPolicyAnalysisState { + // The Google standard error code that best describes the state. + // For example: + // - OK means the analysis on this entity has been successfully finished; + // - PERMISSION_DENIED means an access denied error is encountered; + // - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + // in time; + google.rpc.Code code = 1; + + // The human-readable description of the cause of failure. + string cause = 2; +} + +// IAM Policy analysis result, consisting of one IAM policy binding and derived +// access control lists. +message IamPolicyAnalysisResult { + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the resource to which the [iam_binding][iam_binding] policy attaches. + // (-- api-linter: core::0122::name-suffix=disabled + // aip.dev/not-precedent: full_resource_name is a public notion in GCP. + // --) + string attached_resource_full_name = 1; + + // The Cloud IAM policy binding under analysis. + google.iam.v1.Binding iam_binding = 2; + + // A Google Cloud resource under analysis. + message Resource { + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // (-- api-linter: core::0122::name-suffix=disabled + // aip.dev/not-precedent: full_resource_name is a public notion in GCP. + // --) + string full_resource_name = 1; + + // The analysis state of this resource. + IamPolicyAnalysisState analysis_state = 2; + } + + // An IAM role or permission under analysis. + message Access { + oneof oneof_access { + // The role. + string role = 1; + + // The permission. + string permission = 2; + } + + // The analysis state of this access. + IamPolicyAnalysisState analysis_state = 3; + } + + // An identity under analysis. + // (-- api-linter: core::0123::resource-annotation=disabled + // aip.dev/not-precedent: Identity name is not a resource. --) + message Identity { + // The identity name in any form of members appear in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such + // as: + // - user:foo@google.com + // - group:group1@google.com + // - serviceAccount:s1@prj1.iam.gserviceaccount.com + // - projectOwner:some_project_id + // - domain:google.com + // - allUsers + // - etc. + // + string name = 1; + + // The analysis state of this identity. + IamPolicyAnalysisState analysis_state = 2; + } + + // A directional edge. + message Edge { + // The source node of the edge. For example, it could be a full resource + // name for a resource node or an email of an identity. + string source_node = 1; + + // The target node of the edge. For example, it could be a full resource + // name for a resource node or an email of an identity. + string target_node = 2; + } + + // An access control list, derived from the above IAM policy binding, which + // contains a set of resources and accesses. May include one + // item from each set to compose an access control entry. + // + // NOTICE that there could be multiple access control lists for one IAM policy + // binding. The access control lists are created based on resource and access + // combinations. + // + // For example, assume we have the following cases in one IAM policy binding: + // - Permission P1 and P2 apply to resource R1 and R2; + // - Permission P3 applies to resource R2 and R3; + // + // This will result in the following access control lists: + // - AccessControlList 1: [R1, R2], [P1, P2] + // - AccessControlList 2: [R2, R3], [P3] + message AccessControlList { + // The resources that match one of the following conditions: + // - The resource_selector, if it is specified in request; + // - Otherwise, resources reachable from the policy attached resource. + repeated Resource resources = 1; + + // The accesses that match one of the following conditions: + // - The access_selector, if it is specified in request; + // - Otherwise, access specifiers reachable from the policy binding's role. + repeated Access accesses = 2; + + // Resource edges of the graph starting from the policy attached + // resource to any descendant resources. The [Edge.source_node][] contains + // the full resource name of a parent resource and [Edge.target_node][] + // contains the full resource name of a child resource. This field is + // present only if the output_resource_edges option is enabled in request. + repeated Edge resource_edges = 3; + } + + // The access control lists derived from the [iam_binding][iam_binding] that + // match or potentially match resource and access selectors specified in the + // request. + repeated AccessControlList access_control_lists = 3; + + // The identities and group edges. + message IdentityList { + // Only the identities that match one of the following conditions will be + // presented: + // - The identity_selector, if it is specified in request; + // - Otherwise, identities reachable from the policy binding's members. + repeated Identity identities = 1; + + // Group identity edges of the graph starting from the binding's + // group members to any node of the [identities][]. The [Edge.source_node][] + // contains a group, such as `group:parent@google.com`. The + // [Edge.target_node][] contains a member of the group, + // such as `group:child@google.com` or `user:foo@google.com`. + // This field is present only if the output_group_edges option is enabled in + // request. + repeated Edge group_edges = 2; + } + + // The identity list derived from members of the [iam_binding][iam_binding] + // that match or potentially match identity selector specified in the request. + IdentityList identity_list = 4; + + // Represents whether all analyses on the [iam_binding][iam_binding] have + // successfully finished. + bool fully_explored = 5; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 5e5c844f96b..8ed56fff2cb 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -171,6 +171,34 @@ export namespace google { * @returns Promise */ public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): Promise; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + */ + public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback): void; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): Promise; + + /** + * Calls ExportIamPolicyAnalysis. + * @param request ExportIamPolicyAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportIamPolicyAnalysis(request: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, callback: google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysisCallback): void; + + /** + * Calls ExportIamPolicyAnalysis. + * @param request ExportIamPolicyAnalysisRequest message or plain object + * @returns Promise + */ + public exportIamPolicyAnalysis(request: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest): Promise; } namespace AssetService { @@ -237,6 +265,20 @@ export namespace google { * @param [response] SearchAllIamPoliciesResponse */ type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllIamPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. + * @param error Error, if any + * @param [response] AnalyzeIamPolicyResponse + */ + type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeIamPolicyResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportIamPolicyAnalysis}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportIamPolicyAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of an ExportAssetsRequest. */ @@ -2417,939 +2459,3226 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { + /** Properties of an IamPolicyAnalysisQuery. */ + interface IIamPolicyAnalysisQuery { - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); + /** IamPolicyAnalysisQuery scope */ + scope?: (string|null); - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** IamPolicyAnalysisQuery resourceSelector */ + resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery identitySelector */ + identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); - /** TemporalAsset priorAssetState */ - priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + /** IamPolicyAnalysisQuery accessSelector */ + accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); - /** TemporalAsset priorAsset */ - priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery options */ + options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an IamPolicyAnalysisQuery. */ + class IamPolicyAnalysisQuery implements IIamPolicyAnalysisQuery { /** - * Constructs a new TemporalAsset. + * Constructs a new IamPolicyAnalysisQuery. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery); - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + /** IamPolicyAnalysisQuery scope. */ + public scope: string; - /** TemporalAsset deleted. */ - public deleted: boolean; + /** IamPolicyAnalysisQuery resourceSelector. */ + public resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery identitySelector. */ + public identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); - /** TemporalAsset priorAssetState. */ - public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + /** IamPolicyAnalysisQuery accessSelector. */ + public accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); - /** TemporalAsset priorAsset. */ - public priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery options. */ + public options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns IamPolicyAnalysisQuery instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns IamPolicyAnalysisQuery * @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.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns IamPolicyAnalysisQuery * @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.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Verifies a TemporalAsset message. + * Verifies an IamPolicyAnalysisQuery 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns IamPolicyAnalysisQuery */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this IamPolicyAnalysisQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace TemporalAsset { + namespace IamPolicyAnalysisQuery { - /** PriorAssetState enum. */ - enum PriorAssetState { - PRIOR_ASSET_STATE_UNSPECIFIED = 0, - PRESENT = 1, - INVALID = 2, - DOES_NOT_EXIST = 3, - DELETED = 4 + /** Properties of a ResourceSelector. */ + interface IResourceSelector { + + /** ResourceSelector fullResourceName */ + fullResourceName?: (string|null); } - } - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** Represents a ResourceSelector. */ + class ResourceSelector implements IResourceSelector { - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new ResourceSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } + /** ResourceSelector fullResourceName. */ + public fullResourceName: string; - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** + * Creates a new ResourceSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSelector instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * Constructs a new TimeWindow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSelector + * @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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * Creates a new TimeWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeWindow instance - */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSelector + * @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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a ResourceSelector 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); - /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * 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.asset.v1.TimeWindow; + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @param message ResourceSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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.asset.v1.TimeWindow; + /** + * Converts this ResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of an IdentitySelector. */ + interface IIdentitySelector { - /** - * 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.asset.v1.TimeWindow; + /** IdentitySelector identity */ + identity?: (string|null); + } - /** - * 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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an IdentitySelector. */ + class IdentitySelector implements IIdentitySelector { - /** - * Converts this TimeWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new IdentitySelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector); - /** Properties of an Asset. */ - interface IAsset { + /** IdentitySelector identity. */ + public identity: string; - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new IdentitySelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentitySelector instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset name */ - name?: (string|null); + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset assetType */ - assetType?: (string|null); + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentitySelector + * @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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentitySelector + * @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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + /** + * Verifies an IdentitySelector 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); - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** + * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentitySelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @param message IdentitySelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** + * Converts this IdentitySelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Asset ancestors */ - ancestors?: (string[]|null); - } + /** Properties of an AccessSelector. */ + interface IAccessSelector { - /** Represents an Asset. */ - class Asset implements IAsset { + /** AccessSelector roles */ + roles?: (string[]|null); - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAsset); + /** AccessSelector permissions */ + permissions?: (string[]|null); + } - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** Represents an AccessSelector. */ + class AccessSelector implements IAccessSelector { - /** Asset name. */ - public name: string; + /** + * Constructs a new AccessSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector); - /** Asset assetType. */ - public assetType: string; + /** AccessSelector roles. */ + public roles: string[]; - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); + /** AccessSelector permissions. */ + public permissions: string[]; - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** + * Creates a new AccessSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSelector instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** Asset orgPolicy. */ - public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset accessPolicy. */ - public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset accessLevel. */ - public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSelector + * @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.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** Asset servicePerimeter. */ - public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSelector + * @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.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** Asset ancestors. */ - public ancestors: string[]; + /** + * Verifies an AccessSelector 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); - /** Asset accessContextPolicy. */ - public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + /** + * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @param message AccessSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this AccessSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an Options. */ + interface IOptions { - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @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.asset.v1.Asset; + /** Options expandGroups */ + expandGroups?: (boolean|null); - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @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.asset.v1.Asset; + /** Options expandRoles */ + expandRoles?: (boolean|null); - /** - * Verifies an Asset 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); + /** Options expandResources */ + expandResources?: (boolean|null); - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + /** Options outputResourceEdges */ + outputResourceEdges?: (boolean|null); - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Options outputGroupEdges */ + outputGroupEdges?: (boolean|null); - /** - * Converts this Asset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Options analyzeServiceAccountImpersonation */ + analyzeServiceAccountImpersonation?: (boolean|null); - /** Properties of a Resource. */ - interface IResource { + /** Options maxFanoutsPerGroup */ + maxFanoutsPerGroup?: (number|null); - /** Resource version */ - version?: (string|null); + /** Options maxFanoutsPerResource */ + maxFanoutsPerResource?: (number|null); + } - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Represents an Options. */ + class Options implements IOptions { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** + * Constructs a new Options. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** Options expandGroups. */ + public expandGroups: boolean; - /** Resource parent */ - parent?: (string|null); + /** Options expandRoles. */ + public expandRoles: boolean; - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** Options expandResources. */ + public expandResources: boolean; - /** Resource location */ - location?: (string|null); - } + /** Options outputResourceEdges. */ + public outputResourceEdges: boolean; - /** Represents a Resource. */ - class Resource implements IResource { + /** Options outputGroupEdges. */ + public outputGroupEdges: boolean; - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IResource); + /** Options analyzeServiceAccountImpersonation. */ + public analyzeServiceAccountImpersonation: boolean; - /** Resource version. */ - public version: string; + /** Options maxFanoutsPerGroup. */ + public maxFanoutsPerGroup: number; - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** Options maxFanoutsPerResource. */ + public maxFanoutsPerResource: number; - /** Resource discoveryName. */ - public discoveryName: string; + /** + * Creates a new Options instance using the specified properties. + * @param [properties] Properties to set + * @returns Options instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Resource parent. */ - public parent: string; + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** + * Decodes an Options message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Options + * @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.asset.v1.IamPolicyAnalysisQuery.Options; - /** Resource location. */ - public location: string; + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Options + * @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.asset.v1.IamPolicyAnalysisQuery.Options; + + /** + * Verifies an Options 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 Options message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Options + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @param message Options + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeIamPolicyRequest. */ + interface IAnalyzeIamPolicyRequest { + + /** AnalyzeIamPolicyRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an AnalyzeIamPolicyRequest. */ + class AnalyzeIamPolicyRequest implements IAnalyzeIamPolicyRequest { /** - * Creates a new Resource instance using the specified properties. + * Constructs a new AnalyzeIamPolicyRequest. * @param [properties] Properties to set - * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest); + + /** AnalyzeIamPolicyRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): google.cloud.asset.v1.AnalyzeIamPolicyRequest; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns AnalyzeIamPolicyRequest * @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.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyRequest; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns AnalyzeIamPolicyRequest * @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.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyRequest; /** - * Verifies a Resource message. + * Verifies an AnalyzeIamPolicyRequest 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns AnalyzeIamPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyRequest; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this AnalyzeIamPolicyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceSearchResult. */ - interface IResourceSearchResult { - - /** ResourceSearchResult name */ - name?: (string|null); - - /** ResourceSearchResult assetType */ - assetType?: (string|null); - - /** ResourceSearchResult project */ - project?: (string|null); - - /** ResourceSearchResult displayName */ - displayName?: (string|null); - - /** ResourceSearchResult description */ - description?: (string|null); - - /** ResourceSearchResult location */ - location?: (string|null); + /** Properties of an AnalyzeIamPolicyResponse. */ + interface IAnalyzeIamPolicyResponse { - /** ResourceSearchResult labels */ - labels?: ({ [k: string]: string }|null); + /** AnalyzeIamPolicyResponse mainAnalysis */ + mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); - /** ResourceSearchResult networkTags */ - networkTags?: (string[]|null); + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis */ + serviceAccountImpersonationAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]|null); - /** ResourceSearchResult additionalAttributes */ - additionalAttributes?: (google.protobuf.IStruct|null); + /** AnalyzeIamPolicyResponse fullyExplored */ + fullyExplored?: (boolean|null); } - /** Represents a ResourceSearchResult. */ - class ResourceSearchResult implements IResourceSearchResult { + /** Represents an AnalyzeIamPolicyResponse. */ + class AnalyzeIamPolicyResponse implements IAnalyzeIamPolicyResponse { /** - * Constructs a new ResourceSearchResult. + * Constructs a new AnalyzeIamPolicyResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse); - /** ResourceSearchResult name. */ - public name: string; + /** AnalyzeIamPolicyResponse mainAnalysis. */ + public mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); - /** ResourceSearchResult assetType. */ - public assetType: string; + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. */ + public serviceAccountImpersonationAnalysis: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]; - /** ResourceSearchResult project. */ - public project: string; + /** AnalyzeIamPolicyResponse fullyExplored. */ + public fullyExplored: boolean; - /** ResourceSearchResult displayName. */ - public displayName: string; - - /** ResourceSearchResult description. */ - public description: string; - - /** ResourceSearchResult location. */ - public location: string; - - /** ResourceSearchResult labels. */ - public labels: { [k: string]: string }; - - /** ResourceSearchResult networkTags. */ - public networkTags: string[]; - - /** ResourceSearchResult additionalAttributes. */ - public additionalAttributes?: (google.protobuf.IStruct|null); - - /** - * Creates a new ResourceSearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceSearchResult instance - */ - public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceSearchResult + * @returns AnalyzeIamPolicyResponse * @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.asset.v1.ResourceSearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceSearchResult + * @returns AnalyzeIamPolicyResponse * @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.asset.v1.ResourceSearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Verifies a ResourceSearchResult message. + * Verifies an AnalyzeIamPolicyResponse 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceSearchResult + * @returns AnalyzeIamPolicyResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @param message ResourceSearchResult + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceSearchResult to JSON. + * Converts this AnalyzeIamPolicyResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an IamPolicySearchResult. */ - interface IIamPolicySearchResult { + namespace AnalyzeIamPolicyResponse { - /** IamPolicySearchResult resource */ - resource?: (string|null); + /** Properties of an IamPolicyAnalysis. */ + interface IIamPolicyAnalysis { - /** IamPolicySearchResult project */ - project?: (string|null); + /** IamPolicyAnalysis analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); - /** IamPolicySearchResult policy */ - policy?: (google.iam.v1.IPolicy|null); + /** IamPolicyAnalysis analysisResults */ + analysisResults?: (google.cloud.asset.v1.IIamPolicyAnalysisResult[]|null); - /** IamPolicySearchResult explanation */ - explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** IamPolicyAnalysis fullyExplored */ + fullyExplored?: (boolean|null); + + /** IamPolicyAnalysis stats */ + stats?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats[]|null); + + /** IamPolicyAnalysis nonCriticalErrors */ + nonCriticalErrors?: (google.cloud.asset.v1.IIamPolicyAnalysisState[]|null); + } + + /** Represents an IamPolicyAnalysis. */ + class IamPolicyAnalysis implements IIamPolicyAnalysis { + + /** + * Constructs a new IamPolicyAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis); + + /** IamPolicyAnalysis analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults. */ + public analysisResults: google.cloud.asset.v1.IIamPolicyAnalysisResult[]; + + /** IamPolicyAnalysis fullyExplored. */ + public fullyExplored: boolean; + + /** IamPolicyAnalysis stats. */ + public stats: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats[]; + + /** IamPolicyAnalysis nonCriticalErrors. */ + public nonCriticalErrors: google.cloud.asset.v1.IIamPolicyAnalysisState[]; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysis instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysis + * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysis + * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Verifies an IamPolicyAnalysis 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 IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @param message IamPolicyAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysis { + + /** Properties of a Stats. */ + interface IStats { + + /** Stats nodeType */ + nodeType?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|keyof typeof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|null); + + /** Stats nodeSubtype */ + nodeSubtype?: (string|null); + + /** Stats discoveredNodeCount */ + discoveredNodeCount?: (number|null); + + /** Stats matchedNodeCount */ + matchedNodeCount?: (number|null); + + /** Stats exploredNodeCount */ + exploredNodeCount?: (number|null); + + /** Stats cappedNodeCount */ + cappedNodeCount?: (number|null); + + /** Stats permisionDeniedNodeCount */ + permisionDeniedNodeCount?: (number|null); + + /** Stats executionTimeoutNodeCount */ + executionTimeoutNodeCount?: (number|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats); + + /** Stats nodeType. */ + public nodeType: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|keyof typeof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType); + + /** Stats nodeSubtype. */ + public nodeSubtype: string; + + /** Stats discoveredNodeCount. */ + public discoveredNodeCount: number; + + /** Stats matchedNodeCount. */ + public matchedNodeCount: number; + + /** Stats exploredNodeCount. */ + public exploredNodeCount: number; + + /** Stats cappedNodeCount. */ + public cappedNodeCount: number; + + /** Stats permisionDeniedNodeCount. */ + public permisionDeniedNodeCount: number; + + /** Stats executionTimeoutNodeCount. */ + public executionTimeoutNodeCount: number; + + /** + * Creates a new Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Stats instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stats + * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stats + * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + + /** + * Verifies a Stats 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 Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Stats { + + /** NodeType enum. */ + enum NodeType { + NODE_TYPE_UNSPECIFIED = 0, + BINDING = 1, + IDENTITY = 2, + RESOURCE = 3, + ACCESS = 4 + } + } + } } - /** Represents an IamPolicySearchResult. */ - class IamPolicySearchResult implements IIamPolicySearchResult { + /** Properties of an IamPolicyAnalysisOutputConfig. */ + interface IIamPolicyAnalysisOutputConfig { + + /** IamPolicyAnalysisOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + + /** IamPolicyAnalysisOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); + } + + /** Represents an IamPolicyAnalysisOutputConfig. */ + class IamPolicyAnalysisOutputConfig implements IIamPolicyAnalysisOutputConfig { /** - * Constructs a new IamPolicySearchResult. + * Constructs a new IamPolicyAnalysisOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig); - /** IamPolicySearchResult resource. */ - public resource: string; + /** IamPolicyAnalysisOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); - /** IamPolicySearchResult project. */ - public project: string; + /** IamPolicyAnalysisOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); - /** IamPolicySearchResult policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** IamPolicyAnalysisOutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); - /** IamPolicySearchResult explanation. */ - public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisOutputConfig + * @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.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisOutputConfig + * @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.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Verifies an IamPolicyAnalysisOutputConfig 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 IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisOutputConfig { + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination tablePrefix */ + tablePrefix?: (string|null); + + /** BigQueryDestination partitionKey */ + partitionKey?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null); + + /** BigQueryDestination writeMode */ + writeMode?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination tablePrefix. */ + public tablePrefix: string; + + /** BigQueryDestination partitionKey. */ + public partitionKey: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey); + + /** BigQueryDestination writeMode. */ + public writeMode: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode); + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Verifies a BigQueryDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BigQueryDestination { + + /** PartitionKey enum. */ + enum PartitionKey { + PARTITION_KEY_UNSPECIFIED = 0, + REQUEST_TIME = 1 + } + + /** WriteMode enum. */ + enum WriteMode { + WRITE_MODE_UNSPECIFIED = 0, + ABORT = 1, + OVERWRITE = 2 + } + } + } + + /** Properties of an ExportIamPolicyAnalysisRequest. */ + interface IExportIamPolicyAnalysisRequest { + + /** ExportIamPolicyAnalysisRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** ExportIamPolicyAnalysisRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an ExportIamPolicyAnalysisRequest. */ + class ExportIamPolicyAnalysisRequest implements IExportIamPolicyAnalysisRequest { + + /** + * Constructs a new ExportIamPolicyAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest); + + /** ExportIamPolicyAnalysisRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** ExportIamPolicyAnalysisRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIamPolicyAnalysisRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest): google.cloud.asset.v1.ExportIamPolicyAnalysisRequest; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @param message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @param message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIamPolicyAnalysisRequest + * @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.asset.v1.ExportIamPolicyAnalysisRequest; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIamPolicyAnalysisRequest + * @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.asset.v1.ExportIamPolicyAnalysisRequest; + + /** + * Verifies an ExportIamPolicyAnalysisRequest 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 ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIamPolicyAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportIamPolicyAnalysisRequest; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. + * @param message ExportIamPolicyAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ExportIamPolicyAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIamPolicyAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportIamPolicyAnalysisResponse. */ + interface IExportIamPolicyAnalysisResponse { + } + + /** Represents an ExportIamPolicyAnalysisResponse. */ + class ExportIamPolicyAnalysisResponse implements IExportIamPolicyAnalysisResponse { + + /** + * Constructs a new ExportIamPolicyAnalysisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse); + + /** + * Creates a new ExportIamPolicyAnalysisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIamPolicyAnalysisResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse): google.cloud.asset.v1.ExportIamPolicyAnalysisResponse; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @param message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @param message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIamPolicyAnalysisResponse + * @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.asset.v1.ExportIamPolicyAnalysisResponse; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIamPolicyAnalysisResponse + * @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.asset.v1.ExportIamPolicyAnalysisResponse; + + /** + * Verifies an ExportIamPolicyAnalysisResponse 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 ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIamPolicyAnalysisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportIamPolicyAnalysisResponse; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. + * @param message ExportIamPolicyAnalysisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ExportIamPolicyAnalysisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIamPolicyAnalysisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TemporalAsset { + + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } + + /** 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.asset.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.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + + /** Resource location */ + location?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** Resource location. */ + public location: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { + + /** ResourceSearchResult name */ + name?: (string|null); + + /** ResourceSearchResult assetType */ + assetType?: (string|null); + + /** ResourceSearchResult project */ + project?: (string|null); + + /** ResourceSearchResult displayName */ + displayName?: (string|null); + + /** ResourceSearchResult description */ + description?: (string|null); + + /** ResourceSearchResult location */ + location?: (string|null); + + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); + + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + } + + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { + + /** + * Constructs a new ResourceSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Verifies a ResourceSearchResult 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Explanation { + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of an IamPolicyAnalysisState. */ + interface IIamPolicyAnalysisState { + + /** IamPolicyAnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** IamPolicyAnalysisState cause */ + cause?: (string|null); + } + + /** Represents an IamPolicyAnalysisState. */ + class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + + /** + * Constructs a new IamPolicyAnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + + /** IamPolicyAnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** IamPolicyAnalysisState cause. */ + public cause: string; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisState + * @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.asset.v1.IamPolicyAnalysisState; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisState + * @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.asset.v1.IamPolicyAnalysisState; + + /** + * Verifies an IamPolicyAnalysisState 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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicyAnalysisResult. */ + interface IIamPolicyAnalysisResult { + + /** IamPolicyAnalysisResult attachedResourceFullName */ + attachedResourceFullName?: (string|null); + + /** IamPolicyAnalysisResult iamBinding */ + iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists */ + accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysisResult. */ + class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + + /** + * Constructs a new IamPolicyAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisResult + * @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.asset.v1.IamPolicyAnalysisResult; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisResult + * @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.asset.v1.IamPolicyAnalysisResult; + + /** + * Verifies an IamPolicyAnalysisResult 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Access. */ + interface IAccess { + + /** Access role */ + role?: (string|null); + + /** Access permission */ + permission?: (string|null); + + /** Access analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess); + + /** Access role. */ + public role: string; + + /** Access permission. */ + public permission: string; + + /** Access analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** Access oneofAccess. */ + public oneofAccess?: ("role"|"permission"); + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @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.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @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.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Verifies an Access 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 Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Identity. */ + interface IIdentity { + + /** Identity name */ + name?: (string|null); + + /** Identity analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents an Identity. */ + class Identity implements IIdentity { + + /** + * Constructs a new Identity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity); + + /** Identity name. */ + public name: string; + + /** Identity analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Identity instance using the specified properties. + * @param [properties] Properties to set + * @returns Identity instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Identity + * @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.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Identity + * @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.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Verifies an Identity 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 Identity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Identity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @param message Identity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Identity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Edge. */ + interface IEdge { + + /** Edge sourceNode */ + sourceNode?: (string|null); + + /** Edge targetNode */ + targetNode?: (string|null); + } + + /** Represents an Edge. */ + class Edge implements IEdge { + + /** + * Constructs a new Edge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge); + + /** Edge sourceNode. */ + public sourceNode: string; + + /** Edge targetNode. */ + public targetNode: string; - /** - * Creates a new IamPolicySearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicySearchResult instance - */ - public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + /** + * Creates a new Edge instance using the specified properties. + * @param [properties] Properties to set + * @returns Edge instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; - /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicySearchResult - * @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.asset.v1.IamPolicySearchResult; + /** + * Decodes an Edge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Edge + * @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.asset.v1.IamPolicyAnalysisResult.Edge; - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicySearchResult - * @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.asset.v1.IamPolicySearchResult; + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Edge + * @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.asset.v1.IamPolicyAnalysisResult.Edge; - /** - * Verifies an IamPolicySearchResult 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); + /** + * Verifies an Edge 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicySearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + /** + * Creates an Edge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Edge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @param message IamPolicySearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @param message Edge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Edge, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this IamPolicySearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Edge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - namespace IamPolicySearchResult { + /** Properties of an AccessControlList. */ + interface IAccessControlList { - /** Properties of an Explanation. */ - interface IExplanation { + /** AccessControlList resources */ + resources?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]|null); - /** Explanation matchedPermissions */ - matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + /** AccessControlList accesses */ + accesses?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]|null); + + /** AccessControlList resourceEdges */ + resourceEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); } - /** Represents an Explanation. */ - class Explanation implements IExplanation { + /** Represents an AccessControlList. */ + class AccessControlList implements IAccessControlList { /** - * Constructs a new Explanation. + * Constructs a new AccessControlList. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList); - /** Explanation matchedPermissions. */ - public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + /** AccessControlList resources. */ + public resources: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]; + + /** AccessControlList accesses. */ + public accesses: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]; + + /** AccessControlList resourceEdges. */ + public resourceEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; /** - * Creates a new Explanation instance using the specified properties. + * Creates a new AccessControlList instance using the specified properties. * @param [properties] Properties to set - * @returns Explanation instance + * @returns AccessControlList instance */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Explanation message from the specified reader or buffer. + * Decodes an AccessControlList message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Explanation + * @returns AccessControlList * @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.asset.v1.IamPolicySearchResult.Explanation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Explanation + * @returns AccessControlList * @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.asset.v1.IamPolicySearchResult.Explanation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Verifies an Explanation message. + * Verifies an AccessControlList 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 Explanation message from a plain object. Also converts values to their respective internal types. + * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Explanation + * @returns AccessControlList */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. - * @param message Explanation + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @param message AccessControlList * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Explanation to JSON. + * Converts this AccessControlList to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Explanation { + /** Properties of an IdentityList. */ + interface IIdentityList { - /** Properties of a Permissions. */ - interface IPermissions { + /** IdentityList identities */ + identities?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]|null); - /** Permissions permissions */ - permissions?: (string[]|null); - } + /** IdentityList groupEdges */ + groupEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); + } - /** Represents a Permissions. */ - class Permissions implements IPermissions { + /** Represents an IdentityList. */ + class IdentityList implements IIdentityList { - /** - * Constructs a new Permissions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + /** + * Constructs a new IdentityList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList); - /** Permissions permissions. */ - public permissions: string[]; + /** IdentityList identities. */ + public identities: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]; - /** - * Creates a new Permissions instance using the specified properties. - * @param [properties] Properties to set - * @returns Permissions instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** IdentityList groupEdges. */ + public groupEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new IdentityList instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityList instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Permissions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentityList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityList + * @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.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** + * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityList + * @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.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Verifies a Permissions 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); + /** + * Verifies an IdentityList 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 Permissions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Permissions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** + * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @param message Permissions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * @param message IdentityList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Permissions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this IdentityList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } } } @@ -14061,102 +16390,6 @@ export namespace google { 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 Struct. */ interface IStruct { @@ -14465,6 +16698,102 @@ export namespace google { 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 { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 75251f38f6e..5f099ebe4be 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -395,6 +395,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} [response] AnalyzeIamPolicyResponse + */ + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback} callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeIamPolicy = function analyzeIamPolicy(request, callback) { + return this.rpcCall(analyzeIamPolicy, $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest, $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse, request, callback); + }, "name", { value: "AnalyzeIamPolicy" }); + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportIamPolicyAnalysis}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ExportIamPolicyAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportIamPolicyAnalysis. + * @function exportIamPolicyAnalysis + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysisCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportIamPolicyAnalysis = function exportIamPolicyAnalysis(request, callback) { + return this.rpcCall(exportIamPolicyAnalysis, $root.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportIamPolicyAnalysis" }); + + /** + * Calls ExportIamPolicyAnalysis. + * @function exportIamPolicyAnalysis + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); @@ -5637,48 +5703,28 @@ return SearchAllIamPoliciesResponse; })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; - })(); - - v1.TemporalAsset = (function() { + v1.IamPolicyAnalysisQuery = (function() { /** - * Properties of a TemporalAsset. + * Properties of an IamPolicyAnalysisQuery. * @memberof google.cloud.asset.v1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset - * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState - * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset + * @interface IIamPolicyAnalysisQuery + * @property {string|null} [scope] IamPolicyAnalysisQuery scope + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null} [resourceSelector] IamPolicyAnalysisQuery resourceSelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null} [options] IamPolicyAnalysisQuery options */ /** - * Constructs a new TemporalAsset. + * Constructs a new IamPolicyAnalysisQuery. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents an IamPolicyAnalysisQuery. + * @implements IIamPolicyAnalysisQuery * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set */ - function TemporalAsset(properties) { + function IamPolicyAnalysisQuery(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5686,127 +5732,127 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.window = null; + IamPolicyAnalysisQuery.prototype.scope = ""; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery resourceSelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null|undefined} resourceSelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.deleted = false; + IamPolicyAnalysisQuery.prototype.resourceSelector = null; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery identitySelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null|undefined} identitySelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.asset = null; + IamPolicyAnalysisQuery.prototype.identitySelector = null; /** - * TemporalAsset priorAssetState. - * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery accessSelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null|undefined} accessSelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.priorAssetState = 0; + IamPolicyAnalysisQuery.prototype.accessSelector = null; /** - * TemporalAsset priorAsset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery options. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.priorAsset = null; + IamPolicyAnalysisQuery.prototype.options = null; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + IamPolicyAnalysisQuery.create = function create(properties) { + return new IamPolicyAnalysisQuery(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + IamPolicyAnalysisQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && Object.hasOwnProperty.call(message, "window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); - if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) - $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identitySelector != null && Object.hasOwnProperty.call(message, "identitySelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accessSelector != null && Object.hasOwnProperty.call(message, "accessSelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.encode(message.options, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + IamPolicyAnalysisQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + IamPolicyAnalysisQuery.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.asset.v1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + message.scope = reader.string(); break; case 2: - message.deleted = reader.bool(); + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); break; case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); break; case 4: - message.priorAssetState = reader.int32(); + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); break; case 5: - message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5817,647 +5863,1208 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + IamPolicyAnalysisQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies an IamPolicyAnalysisQuery message. * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + IamPolicyAnalysisQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify(message.resourceSelector); if (error) - return "window." + error; + return "resourceSelector." + error; } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify(message.identitySelector); if (error) - return "asset." + error; + return "identitySelector." + error; } - if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - switch (message.priorAssetState) { - default: - return "priorAssetState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify(message.accessSelector); if (error) - return "priorAsset." + error; + return "accessSelector." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify(message.options); + if (error) + return "options." + error; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + IamPolicyAnalysisQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery) return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.resourceSelector != null) { + if (typeof object.resourceSelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.resourceSelector: object expected"); + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.fromObject(object.resourceSelector); } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + if (object.identitySelector != null) { + if (typeof object.identitySelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.identitySelector: object expected"); + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.fromObject(object.identitySelector); } - switch (object.priorAssetState) { - case "PRIOR_ASSET_STATE_UNSPECIFIED": - case 0: - message.priorAssetState = 0; - break; - case "PRESENT": - case 1: - message.priorAssetState = 1; - break; - case "INVALID": - case 2: - message.priorAssetState = 2; - break; - case "DOES_NOT_EXIST": - case 3: - message.priorAssetState = 3; - break; - case "DELETED": - case 4: - message.priorAssetState = 4; - break; + if (object.accessSelector != null) { + if (typeof object.accessSelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.accessSelector: object expected"); + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.fromObject(object.accessSelector); } - if (object.priorAsset != null) { - if (typeof object.priorAsset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); - message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.options: object expected"); + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.fromObject(object.options); } return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} message IamPolicyAnalysisQuery * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + IamPolicyAnalysisQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; - object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; - object.priorAsset = null; + object.scope = ""; + object.resourceSelector = null; + object.identitySelector = null; + object.accessSelector = null; + object.options = null; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); - if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; - if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) - object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + object.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.toObject(message.resourceSelector, options); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + object.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.toObject(message.identitySelector, options); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + object.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.toObject(message.options, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this IamPolicyAnalysisQuery to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + IamPolicyAnalysisQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * PriorAssetState enum. - * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState - * @enum {number} - * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value - * @property {number} PRESENT=1 PRESENT value - * @property {number} INVALID=2 INVALID value - * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value - * @property {number} DELETED=4 DELETED value - */ - TemporalAsset.PriorAssetState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRESENT"] = 1; - values[valuesById[2] = "INVALID"] = 2; - values[valuesById[3] = "DOES_NOT_EXIST"] = 3; - values[valuesById[4] = "DELETED"] = 4; - return values; - })(); + IamPolicyAnalysisQuery.ResourceSelector = (function() { - return TemporalAsset; - })(); + /** + * Properties of a ResourceSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IResourceSelector + * @property {string|null} [fullResourceName] ResourceSelector fullResourceName + */ - v1.TimeWindow = (function() { + /** + * Constructs a new ResourceSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents a ResourceSelector. + * @implements IResourceSelector + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + */ + function ResourceSelector(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 TimeWindow. - * @memberof google.cloud.asset.v1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime - */ + /** + * ResourceSelector fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + */ + ResourceSelector.prototype.fullResourceName = ""; - /** - * Constructs a new TimeWindow. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow - * @constructor - * @param {google.cloud.asset.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]]; - } + /** + * Creates a new ResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector instance + */ + ResourceSelector.create = function create(properties) { + return new ResourceSelector(properties); + }; - /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow - * @instance - */ - TimeWindow.prototype.startTime = null; + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + return writer; + }; - /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow - * @instance - */ - TimeWindow.prototype.endTime = null; + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new TimeWindow instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance - */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); - }; + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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; - }; + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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(); - }; + /** + * Verifies a ResourceSelector message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + return null; + }; - /** - * Decodes a TimeWindow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.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.asset.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.asset.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; - }; + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + */ + ResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + return message; + }; - /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.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()); - }; + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} message ResourceSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + return object; + }; - /** - * Verifies a TimeWindow message. - * @function verify - * @memberof google.cloud.asset.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; - }; + /** + * Converts this ResourceSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + * @returns {Object.} JSON object + */ + ResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow - */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) - return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.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.asset.v1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; + return ResourceSelector; + })(); - /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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; + IamPolicyAnalysisQuery.IdentitySelector = (function() { + + /** + * Properties of an IdentitySelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IIdentitySelector + * @property {string|null} [identity] IdentitySelector identity + */ + + /** + * Constructs a new IdentitySelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an IdentitySelector. + * @implements IIdentitySelector + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + */ + function IdentitySelector(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]]; } - 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.asset.v1.TimeWindow - * @instance - * @returns {Object.} JSON object - */ - TimeWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * IdentitySelector identity. + * @member {string} identity + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + */ + IdentitySelector.prototype.identity = ""; - return TimeWindow; - })(); + /** + * Creates a new IdentitySelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector instance + */ + IdentitySelector.create = function create(properties) { + return new IdentitySelector(properties); + }; - v1.Asset = (function() { + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity); + return writer; + }; - /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1 - * @interface IAsset - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [orgPolicy] Asset orgPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel - * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter - * @property {Array.|null} [ancestors] Asset ancestors - */ + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - */ - function Asset(properties) { - this.orgPolicy = []; - this.ancestors = []; - 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 an IdentitySelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.updateTime = null; + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.name = ""; + /** + * Verifies an IdentitySelector message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitySelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + return null; + }; - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.assetType = ""; + /** + * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + */ + IdentitySelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector(); + if (object.identity != null) + message.identity = String(object.identity); + return message; + }; - /** - * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.resource = null; + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} message IdentitySelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitySelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.identity = ""; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + return object; + }; - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.iamPolicy = null; + /** + * Converts this IdentitySelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + * @returns {Object.} JSON object + */ + IdentitySelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Asset orgPolicy. - * @member {Array.} orgPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.orgPolicy = $util.emptyArray; + return IdentitySelector; + })(); - /** - * Asset accessPolicy. - * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessPolicy = null; + IamPolicyAnalysisQuery.AccessSelector = (function() { - /** - * Asset accessLevel. - * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessLevel = null; + /** + * Properties of an AccessSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IAccessSelector + * @property {Array.|null} [roles] AccessSelector roles + * @property {Array.|null} [permissions] AccessSelector permissions + */ - /** - * Asset servicePerimeter. - * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.servicePerimeter = null; + /** + * Constructs a new AccessSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an AccessSelector. + * @implements IAccessSelector + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + */ + function AccessSelector(properties) { + this.roles = []; + this.permissions = []; + 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]]; + } - /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.ancestors = $util.emptyArray; + /** + * AccessSelector roles. + * @member {Array.} roles + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.roles = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * AccessSelector permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.permissions = $util.emptyArray; - /** - * Asset accessContextPolicy. - * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Object.defineProperty(Asset.prototype, "accessContextPolicy", { - get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a new AccessSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector instance + */ + AccessSelector.create = function create(properties) { + return new AccessSelector(properties); + }; - /** - * Creates a new Asset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance - */ - Asset.create = function create(properties) { - return new Asset(properties); - }; + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.roles[i]); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.orgPolicy != null && message.orgPolicy.length) - for (var i = 0; i < message.orgPolicy.length; ++i) - $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) - $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) - $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) - $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.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.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + case 2: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSelector message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + if (!$util.isString(message.roles[i])) + return "roles: string[] expected"; + } + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + */ + AccessSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + message.roles[i] = String(object.roles[i]); + } + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} message AccessSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.roles = []; + object.permissions = []; + } + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = message.roles[j]; + } + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this AccessSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + * @returns {Object.} JSON object + */ + AccessSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessSelector; + })(); + + IamPolicyAnalysisQuery.Options = (function() { + + /** + * Properties of an Options. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IOptions + * @property {boolean|null} [expandGroups] Options expandGroups + * @property {boolean|null} [expandRoles] Options expandRoles + * @property {boolean|null} [expandResources] Options expandResources + * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges + * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges + * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation + * @property {number|null} [maxFanoutsPerGroup] Options maxFanoutsPerGroup + * @property {number|null} [maxFanoutsPerResource] Options maxFanoutsPerResource + */ + + /** + * Constructs a new Options. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set + */ + function Options(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]]; + } + + /** + * Options expandGroups. + * @member {boolean} expandGroups + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandGroups = false; + + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandRoles = false; + + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandResources = false; + + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; + + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; + + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; + + /** + * Options maxFanoutsPerGroup. + * @member {number} maxFanoutsPerGroup + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.maxFanoutsPerGroup = 0; + + /** + * Options maxFanoutsPerResource. + * @member {number} maxFanoutsPerResource + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.maxFanoutsPerResource = 0; + + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandGroups != null && Object.hasOwnProperty.call(message, "expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && Object.hasOwnProperty.call(message, "expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && Object.hasOwnProperty.call(message, "expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && Object.hasOwnProperty.call(message, "outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && Object.hasOwnProperty.call(message, "outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && Object.hasOwnProperty.call(message, "analyzeServiceAccountImpersonation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); + if (message.maxFanoutsPerGroup != null && Object.hasOwnProperty.call(message, "maxFanoutsPerGroup")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.maxFanoutsPerGroup); + if (message.maxFanoutsPerResource != null && Object.hasOwnProperty.call(message, "maxFanoutsPerResource")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.maxFanoutsPerResource); + return writer; + }; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Options message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.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.asset.v1.IamPolicyAnalysisQuery.Options(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandGroups = reader.bool(); + break; + case 2: + message.expandRoles = reader.bool(); + break; + case 3: + message.expandResources = reader.bool(); + break; + case 4: + message.outputResourceEdges = reader.bool(); + break; + case 5: + message.outputGroupEdges = reader.bool(); + break; + case 6: + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + case 7: + message.maxFanoutsPerGroup = reader.int32(); + break; + case 8: + message.maxFanoutsPerResource = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Options message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Options.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (typeof message.expandGroups !== "boolean") + return "expandGroups: boolean expected"; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (typeof message.expandRoles !== "boolean") + return "expandRoles: boolean expected"; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (typeof message.expandResources !== "boolean") + return "expandResources: boolean expected"; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (typeof message.outputResourceEdges !== "boolean") + return "outputResourceEdges: boolean expected"; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (typeof message.outputGroupEdges !== "boolean") + return "outputGroupEdges: boolean expected"; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (typeof message.analyzeServiceAccountImpersonation !== "boolean") + return "analyzeServiceAccountImpersonation: boolean expected"; + if (message.maxFanoutsPerGroup != null && message.hasOwnProperty("maxFanoutsPerGroup")) + if (!$util.isInteger(message.maxFanoutsPerGroup)) + return "maxFanoutsPerGroup: integer expected"; + if (message.maxFanoutsPerResource != null && message.hasOwnProperty("maxFanoutsPerResource")) + if (!$util.isInteger(message.maxFanoutsPerResource)) + return "maxFanoutsPerResource: integer expected"; + return null; + }; + + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options(); + if (object.expandGroups != null) + message.expandGroups = Boolean(object.expandGroups); + if (object.expandRoles != null) + message.expandRoles = Boolean(object.expandRoles); + if (object.expandResources != null) + message.expandResources = Boolean(object.expandResources); + if (object.outputResourceEdges != null) + message.outputResourceEdges = Boolean(object.outputResourceEdges); + if (object.outputGroupEdges != null) + message.outputGroupEdges = Boolean(object.outputGroupEdges); + if (object.analyzeServiceAccountImpersonation != null) + message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); + if (object.maxFanoutsPerGroup != null) + message.maxFanoutsPerGroup = object.maxFanoutsPerGroup | 0; + if (object.maxFanoutsPerResource != null) + message.maxFanoutsPerResource = object.maxFanoutsPerResource | 0; + return message; + }; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} message Options + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Options.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandGroups = false; + object.expandRoles = false; + object.expandResources = false; + object.outputResourceEdges = false; + object.outputGroupEdges = false; + object.analyzeServiceAccountImpersonation = false; + object.maxFanoutsPerGroup = 0; + object.maxFanoutsPerResource = 0; + } + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + object.expandGroups = message.expandGroups; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + object.expandRoles = message.expandRoles; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + object.expandResources = message.expandResources; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + object.outputResourceEdges = message.outputResourceEdges; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + object.outputGroupEdges = message.outputGroupEdges; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; + if (message.maxFanoutsPerGroup != null && message.hasOwnProperty("maxFanoutsPerGroup")) + object.maxFanoutsPerGroup = message.maxFanoutsPerGroup; + if (message.maxFanoutsPerResource != null && message.hasOwnProperty("maxFanoutsPerResource")) + object.maxFanoutsPerResource = message.maxFanoutsPerResource; + return object; + }; + + /** + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + return IamPolicyAnalysisQuery; + })(); + + v1.AnalyzeIamPolicyRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyRequest + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {google.protobuf.IDuration|null} [executionTimeout] AnalyzeIamPolicyRequest executionTimeout + */ + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyRequest. + * @implements IAnalyzeIamPolicyRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + */ + function AnalyzeIamPolicyRequest(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]]; + } + + /** + * AnalyzeIamPolicyRequest analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyRequest executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.executionTimeout = null; + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest instance + */ + AnalyzeIamPolicyRequest.create = function create(properties) { + return new AnalyzeIamPolicyRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + AnalyzeIamPolicyRequest.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.asset.v1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; case 1: - message.name = reader.string(); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); break; case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.orgPolicy && message.orgPolicy.length)) - message.orgPolicy = []; - message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); - break; - case 7: - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); - break; - case 8: - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); - break; - case 9: - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6468,267 +7075,129 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + AnalyzeIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies an AnalyzeIamPolicyRequest message. * @function verify - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + AnalyzeIamPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); if (error) - return "resource." + error; + return "analysisQuery." + error; } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); if (error) - return "iamPolicy." + error; - } - if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { - if (!Array.isArray(message.orgPolicy)) - return "orgPolicy: array expected"; - for (var i = 0; i < message.orgPolicy.length; ++i) { - var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); - if (error) - return "orgPolicy." + error; - } - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); - if (error) - return "accessPolicy." + error; - } - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); - if (error) - return "accessLevel." + error; - } - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); - if (error) - return "servicePerimeter." + error; - } - } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; + return "executionTimeout." + error; } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) + AnalyzeIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest) return object; - var message = new $root.google.cloud.asset.v1.Asset(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.orgPolicy) { - if (!Array.isArray(object.orgPolicy)) - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); - message.orgPolicy = []; - for (var i = 0; i < object.orgPolicy.length; ++i) { - if (typeof object.orgPolicy[i] !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); - message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); - } - } - if (object.accessPolicy != null) { - if (typeof object.accessPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); - } - if (object.accessLevel != null) { - if (typeof object.accessLevel !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); - } - if (object.servicePerimeter != null) { - if (typeof object.servicePerimeter !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); } return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static - * @param {google.cloud.asset.v1.Asset} message Asset + * @param {google.cloud.asset.v1.AnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + AnalyzeIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.orgPolicy = []; - object.ancestors = []; - } if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.orgPolicy && message.orgPolicy.length) { - object.orgPolicy = []; - for (var j = 0; j < message.orgPolicy.length; ++j) - object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); - if (options.oneofs) - object.accessContextPolicy = "accessPolicy"; - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); - if (options.oneofs) - object.accessContextPolicy = "accessLevel"; - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); - if (options.oneofs) - object.accessContextPolicy = "servicePerimeter"; - } - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; + object.analysisQuery = null; + object.executionTimeout = null; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); return object; }; /** - * Converts this Asset to JSON. + * Converts this AnalyzeIamPolicyRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + AnalyzeIamPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return AnalyzeIamPolicyRequest; })(); - v1.Resource = (function() { + v1.AnalyzeIamPolicyResponse = (function() { /** - * Properties of a Resource. + * Properties of an AnalyzeIamPolicyResponse. * @memberof google.cloud.asset.v1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - * @property {string|null} [location] Resource location + * @interface IAnalyzeIamPolicyResponse + * @property {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null} [mainAnalysis] AnalyzeIamPolicyResponse mainAnalysis + * @property {Array.|null} [serviceAccountImpersonationAnalysis] AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis + * @property {boolean|null} [fullyExplored] AnalyzeIamPolicyResponse fullyExplored */ /** - * Constructs a new Resource. + * Constructs a new AnalyzeIamPolicyResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents a Resource. - * @implements IResource + * @classdesc Represents an AnalyzeIamPolicyResponse. + * @implements IAnalyzeIamPolicyResponse * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set */ - function Resource(properties) { + function AnalyzeIamPolicyResponse(properties) { + this.serviceAccountImpersonationAnalysis = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6736,153 +7205,104 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; - - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.Resource + * AnalyzeIamPolicyResponse mainAnalysis. + * @member {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null|undefined} mainAnalysis + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance */ - Resource.prototype.parent = ""; + AnalyzeIamPolicyResponse.prototype.mainAnalysis = null; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource + * AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. + * @member {Array.} serviceAccountImpersonationAnalysis + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance */ - Resource.prototype.data = null; + AnalyzeIamPolicyResponse.prototype.serviceAccountImpersonationAnalysis = $util.emptyArray; /** - * Resource location. - * @member {string} location - * @memberof google.cloud.asset.v1.Resource + * AnalyzeIamPolicyResponse fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance */ - Resource.prototype.location = ""; + AnalyzeIamPolicyResponse.prototype.fullyExplored = false; /** - * Creates a new Resource instance using the specified properties. + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse instance */ - Resource.create = function create(properties) { - return new Resource(properties); + AnalyzeIamPolicyResponse.create = function create(properties) { + return new AnalyzeIamPolicyResponse(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + AnalyzeIamPolicyResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + if (message.mainAnalysis != null && Object.hasOwnProperty.call(message, "mainAnalysis")) + $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.mainAnalysis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.serviceAccountImpersonationAnalysis != null && message.serviceAccountImpersonationAnalysis.length) + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) + $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + AnalyzeIamPolicyResponse.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.asset.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); break; case 2: - message.discoveryDocumentUri = reader.string(); + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); break; case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 8: - message.location = reader.string(); + message.fullyExplored = reader.bool(); break; default: reader.skipType(tag & 7); @@ -6893,374 +7313,987 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + AnalyzeIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies an AnalyzeIamPolicyResponse message. * @function verify - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + AnalyzeIamPolicyResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) { + var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.mainAnalysis); if (error) - return "data." + error; + return "mainAnalysis." + error; } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; + if (message.serviceAccountImpersonationAnalysis != null && message.hasOwnProperty("serviceAccountImpersonationAnalysis")) { + if (!Array.isArray(message.serviceAccountImpersonationAnalysis)) + return "serviceAccountImpersonationAnalysis: array expected"; + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.serviceAccountImpersonationAnalysis[i]); + if (error) + return "serviceAccountImpersonationAnalysis." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) + AnalyzeIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse) return object; - var message = new $root.google.cloud.asset.v1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse(); + if (object.mainAnalysis != null) { + if (typeof object.mainAnalysis !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.mainAnalysis: object expected"); + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.mainAnalysis); } - if (object.location != null) - message.location = String(object.location); + if (object.serviceAccountImpersonationAnalysis) { + if (!Array.isArray(object.serviceAccountImpersonationAnalysis)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: array expected"); + message.serviceAccountImpersonationAnalysis = []; + for (var i = 0; i < object.serviceAccountImpersonationAnalysis.length; ++i) { + if (typeof object.serviceAccountImpersonationAnalysis[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: object expected"); + message.serviceAccountImpersonationAnalysis[i] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.serviceAccountImpersonationAnalysis[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.Resource} message Resource + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + AnalyzeIamPolicyResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.serviceAccountImpersonationAnalysis = []; if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - object.location = ""; + object.mainAnalysis = null; + object.fullyExplored = false; } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + object.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.mainAnalysis, options); + if (message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length) { + object.serviceAccountImpersonationAnalysis = []; + for (var j = 0; j < message.serviceAccountImpersonationAnalysis.length; ++j) + object.serviceAccountImpersonationAnalysis[j] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.serviceAccountImpersonationAnalysis[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; return object; }; /** - * Converts this Resource to JSON. + * Converts this AnalyzeIamPolicyResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + AnalyzeIamPolicyResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; - })(); - - v1.ResourceSearchResult = (function() { + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { - /** - * Properties of a ResourceSearchResult. - * @memberof google.cloud.asset.v1 - * @interface IResourceSearchResult - * @property {string|null} [name] ResourceSearchResult name - * @property {string|null} [assetType] ResourceSearchResult assetType - * @property {string|null} [project] ResourceSearchResult project - * @property {string|null} [displayName] ResourceSearchResult displayName - * @property {string|null} [description] ResourceSearchResult description - * @property {string|null} [location] ResourceSearchResult location - * @property {Object.|null} [labels] ResourceSearchResult labels - * @property {Array.|null} [networkTags] ResourceSearchResult networkTags - * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes - */ + /** + * Properties of an IamPolicyAnalysis. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @interface IIamPolicyAnalysis + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] IamPolicyAnalysis analysisQuery + * @property {Array.|null} [analysisResults] IamPolicyAnalysis analysisResults + * @property {boolean|null} [fullyExplored] IamPolicyAnalysis fullyExplored + * @property {Array.|null} [stats] IamPolicyAnalysis stats + * @property {Array.|null} [nonCriticalErrors] IamPolicyAnalysis nonCriticalErrors + */ - /** - * Constructs a new ResourceSearchResult. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a ResourceSearchResult. - * @implements IResourceSearchResult - * @constructor - * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set - */ - function ResourceSearchResult(properties) { - this.labels = {}; - this.networkTags = []; - 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]]; - } + /** + * Constructs a new IamPolicyAnalysis. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @classdesc Represents an IamPolicyAnalysis. + * @implements IIamPolicyAnalysis + * @constructor + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + */ + function IamPolicyAnalysis(properties) { + this.analysisResults = []; + this.stats = []; + this.nonCriticalErrors = []; + 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]]; + } - /** - * ResourceSearchResult name. - * @member {string} name - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.name = ""; + /** + * IamPolicyAnalysis analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisQuery = null; - /** - * ResourceSearchResult assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.assetType = ""; + /** + * IamPolicyAnalysis analysisResults. + * @member {Array.} analysisResults + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisResults = $util.emptyArray; - /** - * ResourceSearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.project = ""; + /** + * IamPolicyAnalysis fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.fullyExplored = false; - /** - * ResourceSearchResult displayName. - * @member {string} displayName - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.displayName = ""; + /** + * IamPolicyAnalysis stats. + * @member {Array.} stats + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.stats = $util.emptyArray; + + /** + * IamPolicyAnalysis nonCriticalErrors. + * @member {Array.} nonCriticalErrors + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.nonCriticalErrors = $util.emptyArray; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis instance + */ + IamPolicyAnalysis.create = function create(properties) { + return new IamPolicyAnalysis(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.analysisResults != null && message.analysisResults.length) + for (var i = 0; i < message.analysisResults.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + if (message.stats != null && message.stats.length) + for (var i = 0; i < message.stats.length; ++i) + $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.encode(message.stats[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nonCriticalErrors != null && message.nonCriticalErrors.length) + for (var i = 0; i < message.nonCriticalErrors.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.nonCriticalErrors[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + case 3: + message.fullyExplored = reader.bool(); + break; + case 4: + if (!(message.stats && message.stats.length)) + message.stats = []; + message.stats.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysis message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.analysisResults != null && message.hasOwnProperty("analysisResults")) { + if (!Array.isArray(message.analysisResults)) + return "analysisResults: array expected"; + for (var i = 0; i < message.analysisResults.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.verify(message.analysisResults[i]); + if (error) + return "analysisResults." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + if (message.stats != null && message.hasOwnProperty("stats")) { + if (!Array.isArray(message.stats)) + return "stats: array expected"; + for (var i = 0; i < message.stats.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify(message.stats[i]); + if (error) + return "stats." + error; + } + } + if (message.nonCriticalErrors != null && message.hasOwnProperty("nonCriticalErrors")) { + if (!Array.isArray(message.nonCriticalErrors)) + return "nonCriticalErrors: array expected"; + for (var i = 0; i < message.nonCriticalErrors.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.nonCriticalErrors[i]); + if (error) + return "nonCriticalErrors." + error; + } + } + return null; + }; + + /** + * Creates an IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + */ + IamPolicyAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.analysisResults) { + if (!Array.isArray(object.analysisResults)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: array expected"); + message.analysisResults = []; + for (var i = 0; i < object.analysisResults.length; ++i) { + if (typeof object.analysisResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: object expected"); + message.analysisResults[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.fromObject(object.analysisResults[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + if (object.stats) { + if (!Array.isArray(object.stats)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.stats: array expected"); + message.stats = []; + for (var i = 0; i < object.stats.length; ++i) { + if (typeof object.stats[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.stats: object expected"); + message.stats[i] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.fromObject(object.stats[i]); + } + } + if (object.nonCriticalErrors) { + if (!Array.isArray(object.nonCriticalErrors)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: array expected"); + message.nonCriticalErrors = []; + for (var i = 0; i < object.nonCriticalErrors.length; ++i) { + if (typeof object.nonCriticalErrors[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: object expected"); + message.nonCriticalErrors[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.nonCriticalErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} message IamPolicyAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.analysisResults = []; + object.stats = []; + object.nonCriticalErrors = []; + } + if (options.defaults) { + object.analysisQuery = null; + object.fullyExplored = false; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.analysisResults && message.analysisResults.length) { + object.analysisResults = []; + for (var j = 0; j < message.analysisResults.length; ++j) + object.analysisResults[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.toObject(message.analysisResults[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + if (message.stats && message.stats.length) { + object.stats = []; + for (var j = 0; j < message.stats.length; ++j) + object.stats[j] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.toObject(message.stats[j], options); + } + if (message.nonCriticalErrors && message.nonCriticalErrors.length) { + object.nonCriticalErrors = []; + for (var j = 0; j < message.nonCriticalErrors.length; ++j) + object.nonCriticalErrors[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.nonCriticalErrors[j], options); + } + return object; + }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysis.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @interface IStats + * @property {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|null} [nodeType] Stats nodeType + * @property {string|null} [nodeSubtype] Stats nodeSubtype + * @property {number|null} [discoveredNodeCount] Stats discoveredNodeCount + * @property {number|null} [matchedNodeCount] Stats matchedNodeCount + * @property {number|null} [exploredNodeCount] Stats exploredNodeCount + * @property {number|null} [cappedNodeCount] Stats cappedNodeCount + * @property {number|null} [permisionDeniedNodeCount] Stats permisionDeniedNodeCount + * @property {number|null} [executionTimeoutNodeCount] Stats executionTimeoutNodeCount + */ + + /** + * Constructs a new Stats. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats=} [properties] Properties to set + */ + function Stats(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]]; + } + + /** + * Stats nodeType. + * @member {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType} nodeType + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.nodeType = 0; + + /** + * Stats nodeSubtype. + * @member {string} nodeSubtype + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.nodeSubtype = ""; + + /** + * Stats discoveredNodeCount. + * @member {number} discoveredNodeCount + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.discoveredNodeCount = 0; + + /** + * Stats matchedNodeCount. + * @member {number} matchedNodeCount + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.matchedNodeCount = 0; + + /** + * Stats exploredNodeCount. + * @member {number} exploredNodeCount + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.exploredNodeCount = 0; + + /** + * Stats cappedNodeCount. + * @member {number} cappedNodeCount + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.cappedNodeCount = 0; + + /** + * Stats permisionDeniedNodeCount. + * @member {number} permisionDeniedNodeCount + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.permisionDeniedNodeCount = 0; + + /** + * Stats executionTimeoutNodeCount. + * @member {number} executionTimeoutNodeCount + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + */ + Stats.prototype.executionTimeoutNodeCount = 0; + + /** + * Creates a new Stats instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats instance + */ + Stats.create = function create(properties) { + return new Stats(properties); + }; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeType); + if (message.nodeSubtype != null && Object.hasOwnProperty.call(message, "nodeSubtype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeSubtype); + if (message.discoveredNodeCount != null && Object.hasOwnProperty.call(message, "discoveredNodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.discoveredNodeCount); + if (message.matchedNodeCount != null && Object.hasOwnProperty.call(message, "matchedNodeCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchedNodeCount); + if (message.exploredNodeCount != null && Object.hasOwnProperty.call(message, "exploredNodeCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.exploredNodeCount); + if (message.cappedNodeCount != null && Object.hasOwnProperty.call(message, "cappedNodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.cappedNodeCount); + if (message.permisionDeniedNodeCount != null && Object.hasOwnProperty.call(message, "permisionDeniedNodeCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.permisionDeniedNodeCount); + if (message.executionTimeoutNodeCount != null && Object.hasOwnProperty.call(message, "executionTimeoutNodeCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.executionTimeoutNodeCount); + return writer; + }; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeType = reader.int32(); + break; + case 2: + message.nodeSubtype = reader.string(); + break; + case 3: + message.discoveredNodeCount = reader.int32(); + break; + case 4: + message.matchedNodeCount = reader.int32(); + break; + case 5: + message.exploredNodeCount = reader.int32(); + break; + case 6: + message.cappedNodeCount = reader.int32(); + break; + case 7: + message.permisionDeniedNodeCount = reader.int32(); + break; + case 8: + message.executionTimeoutNodeCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stats message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + switch (message.nodeType) { + default: + return "nodeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.nodeSubtype != null && message.hasOwnProperty("nodeSubtype")) + if (!$util.isString(message.nodeSubtype)) + return "nodeSubtype: string expected"; + if (message.discoveredNodeCount != null && message.hasOwnProperty("discoveredNodeCount")) + if (!$util.isInteger(message.discoveredNodeCount)) + return "discoveredNodeCount: integer expected"; + if (message.matchedNodeCount != null && message.hasOwnProperty("matchedNodeCount")) + if (!$util.isInteger(message.matchedNodeCount)) + return "matchedNodeCount: integer expected"; + if (message.exploredNodeCount != null && message.hasOwnProperty("exploredNodeCount")) + if (!$util.isInteger(message.exploredNodeCount)) + return "exploredNodeCount: integer expected"; + if (message.cappedNodeCount != null && message.hasOwnProperty("cappedNodeCount")) + if (!$util.isInteger(message.cappedNodeCount)) + return "cappedNodeCount: integer expected"; + if (message.permisionDeniedNodeCount != null && message.hasOwnProperty("permisionDeniedNodeCount")) + if (!$util.isInteger(message.permisionDeniedNodeCount)) + return "permisionDeniedNodeCount: integer expected"; + if (message.executionTimeoutNodeCount != null && message.hasOwnProperty("executionTimeoutNodeCount")) + if (!$util.isInteger(message.executionTimeoutNodeCount)) + return "executionTimeoutNodeCount: integer expected"; + return null; + }; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats + */ + Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats(); + switch (object.nodeType) { + case "NODE_TYPE_UNSPECIFIED": + case 0: + message.nodeType = 0; + break; + case "BINDING": + case 1: + message.nodeType = 1; + break; + case "IDENTITY": + case 2: + message.nodeType = 2; + break; + case "RESOURCE": + case 3: + message.nodeType = 3; + break; + case "ACCESS": + case 4: + message.nodeType = 4; + break; + } + if (object.nodeSubtype != null) + message.nodeSubtype = String(object.nodeSubtype); + if (object.discoveredNodeCount != null) + message.discoveredNodeCount = object.discoveredNodeCount | 0; + if (object.matchedNodeCount != null) + message.matchedNodeCount = object.matchedNodeCount | 0; + if (object.exploredNodeCount != null) + message.exploredNodeCount = object.exploredNodeCount | 0; + if (object.cappedNodeCount != null) + message.cappedNodeCount = object.cappedNodeCount | 0; + if (object.permisionDeniedNodeCount != null) + message.permisionDeniedNodeCount = object.permisionDeniedNodeCount | 0; + if (object.executionTimeoutNodeCount != null) + message.executionTimeoutNodeCount = object.executionTimeoutNodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeType = options.enums === String ? "NODE_TYPE_UNSPECIFIED" : 0; + object.nodeSubtype = ""; + object.discoveredNodeCount = 0; + object.matchedNodeCount = 0; + object.exploredNodeCount = 0; + object.cappedNodeCount = 0; + object.permisionDeniedNodeCount = 0; + object.executionTimeoutNodeCount = 0; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + object.nodeType = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType[message.nodeType] : message.nodeType; + if (message.nodeSubtype != null && message.hasOwnProperty("nodeSubtype")) + object.nodeSubtype = message.nodeSubtype; + if (message.discoveredNodeCount != null && message.hasOwnProperty("discoveredNodeCount")) + object.discoveredNodeCount = message.discoveredNodeCount; + if (message.matchedNodeCount != null && message.hasOwnProperty("matchedNodeCount")) + object.matchedNodeCount = message.matchedNodeCount; + if (message.exploredNodeCount != null && message.hasOwnProperty("exploredNodeCount")) + object.exploredNodeCount = message.exploredNodeCount; + if (message.cappedNodeCount != null && message.hasOwnProperty("cappedNodeCount")) + object.cappedNodeCount = message.cappedNodeCount; + if (message.permisionDeniedNodeCount != null && message.hasOwnProperty("permisionDeniedNodeCount")) + object.permisionDeniedNodeCount = message.permisionDeniedNodeCount; + if (message.executionTimeoutNodeCount != null && message.hasOwnProperty("executionTimeoutNodeCount")) + object.executionTimeoutNodeCount = message.executionTimeoutNodeCount; + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NodeType enum. + * @name google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType + * @enum {number} + * @property {number} NODE_TYPE_UNSPECIFIED=0 NODE_TYPE_UNSPECIFIED value + * @property {number} BINDING=1 BINDING value + * @property {number} IDENTITY=2 IDENTITY value + * @property {number} RESOURCE=3 RESOURCE value + * @property {number} ACCESS=4 ACCESS value + */ + Stats.NodeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BINDING"] = 1; + values[valuesById[2] = "IDENTITY"] = 2; + values[valuesById[3] = "RESOURCE"] = 3; + values[valuesById[4] = "ACCESS"] = 4; + return values; + })(); + + return Stats; + })(); + + return IamPolicyAnalysis; + })(); + + return AnalyzeIamPolicyResponse; + })(); + + v1.IamPolicyAnalysisOutputConfig = (function() { /** - * ResourceSearchResult description. - * @member {string} description - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance + * Properties of an IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisOutputConfig + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null} [gcsDestination] IamPolicyAnalysisOutputConfig gcsDestination + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null} [bigqueryDestination] IamPolicyAnalysisOutputConfig bigqueryDestination */ - ResourceSearchResult.prototype.description = ""; /** - * ResourceSearchResult location. - * @member {string} location - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance + * Constructs a new IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisOutputConfig. + * @implements IIamPolicyAnalysisOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set */ - ResourceSearchResult.prototype.location = ""; + function IamPolicyAnalysisOutputConfig(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]]; + } /** - * ResourceSearchResult labels. - * @member {Object.} labels - * @memberof google.cloud.asset.v1.ResourceSearchResult + * IamPolicyAnalysisOutputConfig gcsDestination. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @instance */ - ResourceSearchResult.prototype.labels = $util.emptyObject; + IamPolicyAnalysisOutputConfig.prototype.gcsDestination = null; /** - * ResourceSearchResult networkTags. - * @member {Array.} networkTags - * @memberof google.cloud.asset.v1.ResourceSearchResult + * IamPolicyAnalysisOutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @instance */ - ResourceSearchResult.prototype.networkTags = $util.emptyArray; + IamPolicyAnalysisOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ResourceSearchResult additionalAttributes. - * @member {google.protobuf.IStruct|null|undefined} additionalAttributes - * @memberof google.cloud.asset.v1.ResourceSearchResult + * IamPolicyAnalysisOutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @instance */ - ResourceSearchResult.prototype.additionalAttributes = null; + Object.defineProperty(IamPolicyAnalysisOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ResourceSearchResult instance using the specified properties. + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static - * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig instance */ - ResourceSearchResult.create = function create(properties) { - return new ResourceSearchResult(properties); + IamPolicyAnalysisOutputConfig.create = function create(properties) { + return new IamPolicyAnalysisOutputConfig(properties); }; /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static - * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceSearchResult.encode = function encode(message, writer) { + IamPolicyAnalysisOutputConfig.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.networkTags != null && message.networkTags.length) - for (var i = 0; i < message.networkTags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); - if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) - $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static - * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + IamPolicyAnalysisOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceSearchResult.decode = function decode(reader, length) { + IamPolicyAnalysisOutputConfig.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.asset.v1.ResourceSearchResult(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); break; case 2: - message.assetType = reader.string(); - break; - case 3: - message.project = reader.string(); - break; - case 4: - message.displayName = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 6: - message.location = reader.string(); - break; - case 7: - 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 8: - if (!(message.networkTags && message.networkTags.length)) - message.networkTags = []; - message.networkTags.push(reader.string()); - break; - case 9: - message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7271,467 +8304,5332 @@ }; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { + IamPolicyAnalysisOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceSearchResult message. + * Verifies an IamPolicyAnalysisOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceSearchResult.verify = function verify(message) { + IamPolicyAnalysisOutputConfig.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { - if (!Array.isArray(message.networkTags)) - return "networkTags: array expected"; - for (var i = 0; i < message.networkTags.length; ++i) - if (!$util.isString(message.networkTags[i])) - return "networkTags: string[] expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } } - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { - var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); - if (error) - return "additionalAttributes." + error; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } } return null; }; /** - * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig */ - ResourceSearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) + IamPolicyAnalysisOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig) return object; - var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.project != null) - message.project = String(object.project); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.networkTags) { - if (!Array.isArray(object.networkTags)) - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); - message.networkTags = []; - for (var i = 0; i < object.networkTags.length; ++i) - message.networkTags[i] = String(object.networkTags[i]); + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.fromObject(object.gcsDestination); } - if (object.additionalAttributes != null) { - if (typeof object.additionalAttributes !== "object") - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); - message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.fromObject(object.bigqueryDestination); } return message; }; /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @static - * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceSearchResult.toObject = function toObject(message, options) { + IamPolicyAnalysisOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.networkTags = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.project = ""; - object.displayName = ""; - object.description = ""; - object.location = ""; - object.additionalAttributes = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - 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.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.networkTags && message.networkTags.length) { - object.networkTags = []; - for (var j = 0; j < message.networkTags.length; ++j) - object.networkTags[j] = message.networkTags[j]; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; } - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) - object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); return object; }; /** - * Converts this ResourceSearchResult to JSON. + * Converts this IamPolicyAnalysisOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig * @instance * @returns {Object.} JSON object */ - ResourceSearchResult.prototype.toJSON = function toJSON() { + IamPolicyAnalysisOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceSearchResult; - })(); - - v1.IamPolicySearchResult = (function() { + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { - /** - * Properties of an IamPolicySearchResult. - * @memberof google.cloud.asset.v1 - * @interface IIamPolicySearchResult - * @property {string|null} [resource] IamPolicySearchResult resource - * @property {string|null} [project] IamPolicySearchResult project - * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy - * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation - */ + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ - /** - * Constructs a new IamPolicySearchResult. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicySearchResult. - * @implements IIamPolicySearchResult - * @constructor - * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set - */ - function IamPolicySearchResult(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]]; - } + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } - /** - * IamPolicySearchResult resource. - * @member {string} resource - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.resource = ""; + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; - /** - * IamPolicySearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.project = ""; + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; - /** - * IamPolicySearchResult policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.policy = null; + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; - /** - * IamPolicySearchResult explanation. - * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.explanation = null; + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new IamPolicySearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance - */ - IamPolicySearchResult.create = function create(properties) { - return new IamPolicySearchResult(properties); - }; + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicySearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.project = reader.string(); - break; - case 3: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 4: - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + IamPolicyAnalysisOutputConfig.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [tablePrefix] BigQueryDestination tablePrefix + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null} [partitionKey] BigQueryDestination partitionKey + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|null} [writeMode] BigQueryDestination writeMode + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination tablePrefix. + * @member {string} tablePrefix + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.tablePrefix = ""; + + /** + * BigQueryDestination partitionKey. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey} partitionKey + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.partitionKey = 0; + + /** + * BigQueryDestination writeMode. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode} writeMode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.writeMode = 0; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.tablePrefix != null && Object.hasOwnProperty.call(message, "tablePrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tablePrefix); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.partitionKey); + if (message.writeMode != null && Object.hasOwnProperty.call(message, "writeMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.writeMode); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataset = reader.string(); + break; + case 2: + message.tablePrefix = reader.string(); + break; + case 3: + message.partitionKey = reader.int32(); + break; + case 4: + message.writeMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) + if (!$util.isString(message.tablePrefix)) + return "tablePrefix: string expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + switch (message.partitionKey) { + default: + return "partitionKey: enum value expected"; + case 0: + case 1: + break; + } + if (message.writeMode != null && message.hasOwnProperty("writeMode")) + switch (message.writeMode) { + default: + return "writeMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.tablePrefix != null) + message.tablePrefix = String(object.tablePrefix); + switch (object.partitionKey) { + case "PARTITION_KEY_UNSPECIFIED": + case 0: + message.partitionKey = 0; + break; + case "REQUEST_TIME": + case 1: + message.partitionKey = 1; + break; + } + switch (object.writeMode) { + case "WRITE_MODE_UNSPECIFIED": + case 0: + message.writeMode = 0; + break; + case "ABORT": + case 1: + message.writeMode = 1; + break; + case "OVERWRITE": + case 2: + message.writeMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.tablePrefix = ""; + object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; + object.writeMode = options.enums === String ? "WRITE_MODE_UNSPECIFIED" : 0; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) + object.tablePrefix = message.tablePrefix; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] : message.partitionKey; + if (message.writeMode != null && message.hasOwnProperty("writeMode")) + object.writeMode = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode[message.writeMode] : message.writeMode; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PartitionKey enum. + * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey + * @enum {number} + * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value + * @property {number} REQUEST_TIME=1 REQUEST_TIME value + */ + BigQueryDestination.PartitionKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_TIME"] = 1; + return values; + })(); + + /** + * WriteMode enum. + * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode + * @enum {number} + * @property {number} WRITE_MODE_UNSPECIFIED=0 WRITE_MODE_UNSPECIFIED value + * @property {number} ABORT=1 ABORT value + * @property {number} OVERWRITE=2 OVERWRITE value + */ + BigQueryDestination.WriteMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WRITE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ABORT"] = 1; + values[valuesById[2] = "OVERWRITE"] = 2; + return values; + })(); + + return BigQueryDestination; + })(); + + return IamPolicyAnalysisOutputConfig; + })(); + + v1.ExportIamPolicyAnalysisRequest = (function() { /** - * Verifies an IamPolicySearchResult message. + * Properties of an ExportIamPolicyAnalysisRequest. + * @memberof google.cloud.asset.v1 + * @interface IExportIamPolicyAnalysisRequest + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] ExportIamPolicyAnalysisRequest analysisQuery + * @property {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] ExportIamPolicyAnalysisRequest outputConfig + */ + + /** + * Constructs a new ExportIamPolicyAnalysisRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an ExportIamPolicyAnalysisRequest. + * @implements IExportIamPolicyAnalysisRequest + * @constructor + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set + */ + function ExportIamPolicyAnalysisRequest(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]]; + } + + /** + * ExportIamPolicyAnalysisRequest analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.analysisQuery = null; + + /** + * ExportIamPolicyAnalysisRequest outputConfig. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest instance + */ + ExportIamPolicyAnalysisRequest.create = function create(properties) { + return new ExportIamPolicyAnalysisRequest(properties); + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisRequest.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.asset.v1.ExportIamPolicyAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIamPolicyAnalysisRequest message. * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IamPolicySearchResult.verify = function verify(message) { + ExportIamPolicyAnalysisRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); if (error) - return "policy." + error; + return "analysisQuery." + error; } - if (message.explanation != null && message.hasOwnProperty("explanation")) { - var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); if (error) - return "explanation." + error; + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + */ + ExportIamPolicyAnalysisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest) + return object; + var message = new $root.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIamPolicyAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.outputConfig = null; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportIamPolicyAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + ExportIamPolicyAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportIamPolicyAnalysisRequest; + })(); + + v1.ExportIamPolicyAnalysisResponse = (function() { + + /** + * Properties of an ExportIamPolicyAnalysisResponse. + * @memberof google.cloud.asset.v1 + * @interface IExportIamPolicyAnalysisResponse + */ + + /** + * Constructs a new ExportIamPolicyAnalysisResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an ExportIamPolicyAnalysisResponse. + * @implements IExportIamPolicyAnalysisResponse + * @constructor + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set + */ + function ExportIamPolicyAnalysisResponse(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 ExportIamPolicyAnalysisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse instance + */ + ExportIamPolicyAnalysisResponse.create = function create(properties) { + return new ExportIamPolicyAnalysisResponse(properties); + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisResponse.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.asset.v1.ExportIamPolicyAnalysisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIamPolicyAnalysisResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIamPolicyAnalysisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; return null; }; - /** - * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - */ - IamPolicySearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) + /** + * Creates an ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + */ + ExportIamPolicyAnalysisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse) + return object; + return new $root.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse(); + }; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIamPolicyAnalysisResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportIamPolicyAnalysisResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @instance + * @returns {Object.} JSON object + */ + ExportIamPolicyAnalysisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportIamPolicyAnalysisResponse; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState + * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * TemporalAsset priorAssetState. + * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAssetState = 0; + + /** + * TemporalAsset priorAsset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAsset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); + if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) + $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + case 4: + message.priorAssetState = reader.int32(); + break; + case 5: + message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + switch (message.priorAssetState) { + default: + return "priorAssetState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); + if (error) + return "priorAsset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + switch (object.priorAssetState) { + case "PRIOR_ASSET_STATE_UNSPECIFIED": + case 0: + message.priorAssetState = 0; + break; + case "PRESENT": + case 1: + message.priorAssetState = 1; + break; + case "INVALID": + case 2: + message.priorAssetState = 2; + break; + case "DOES_NOT_EXIST": + case 3: + message.priorAssetState = 3; + break; + case "DELETED": + case 4: + message.priorAssetState = 4; + break; + } + if (object.priorAsset != null) { + if (typeof object.priorAsset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); + message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; + object.priorAsset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) + object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PriorAssetState enum. + * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState + * @enum {number} + * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} INVALID=2 INVALID value + * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value + * @property {number} DELETED=4 DELETED value + */ + TemporalAsset.PriorAssetState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "DOES_NOT_EXIST"] = 3; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.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.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + 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]]; + } + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + case 7: + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + case 8: + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + case 9: + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {string|null} [location] Resource location + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 8: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.location = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + v1.ResourceSearchResult = (function() { + + /** + * Properties of a ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @interface IResourceSearchResult + * @property {string|null} [name] ResourceSearchResult name + * @property {string|null} [assetType] ResourceSearchResult assetType + * @property {string|null} [project] ResourceSearchResult project + * @property {string|null} [displayName] ResourceSearchResult displayName + * @property {string|null} [description] ResourceSearchResult description + * @property {string|null} [location] ResourceSearchResult location + * @property {Object.|null} [labels] ResourceSearchResult labels + * @property {Array.|null} [networkTags] ResourceSearchResult networkTags + * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes + */ + + /** + * Constructs a new ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ResourceSearchResult. + * @implements IResourceSearchResult + * @constructor + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + */ + function ResourceSearchResult(properties) { + this.labels = {}; + this.networkTags = []; + 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]]; + } + + /** + * ResourceSearchResult name. + * @member {string} name + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.name = ""; + + /** + * ResourceSearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.assetType = ""; + + /** + * ResourceSearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.project = ""; + + /** + * ResourceSearchResult displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.displayName = ""; + + /** + * ResourceSearchResult description. + * @member {string} description + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.description = ""; + + /** + * ResourceSearchResult location. + * @member {string} location + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.location = ""; + + /** + * ResourceSearchResult labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.labels = $util.emptyObject; + + /** + * ResourceSearchResult networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.networkTags = $util.emptyArray; + + /** + * ResourceSearchResult additionalAttributes. + * @member {google.protobuf.IStruct|null|undefined} additionalAttributes + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.additionalAttributes = null; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance + */ + ResourceSearchResult.create = function create(properties) { + return new ResourceSearchResult(properties); + }; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); + if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) + $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.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.asset.v1.ResourceSearchResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.project = reader.string(); + break; + case 4: + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.location = reader.string(); + break; + case 7: + 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 8: + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + case 9: + message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSearchResult.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); + if (error) + return "additionalAttributes." + error; + } + return null; + }; + + /** + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + */ + ResourceSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) + return object; + var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.additionalAttributes != null) { + if (typeof object.additionalAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); + message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); + } + return message; + }; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkTags = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + object.location = ""; + object.additionalAttributes = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) + object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); + return object; + }; + + /** + * Converts this ResourceSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + * @returns {Object.} JSON object + */ + ResourceSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSearchResult; + })(); + + v1.IamPolicySearchResult = (function() { + + /** + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation + */ + + /** + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + */ + function IamPolicySearchResult(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]]; + } + + /** + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.resource = ""; + + /** + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.project = ""; + + /** + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance + */ + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); + }; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.project = reader.string(); + break; + case 3: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 4: + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicySearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicySearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } + return null; + }; + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicySearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; + object.explanation = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + return object; + }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicySearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicySearchResult.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + this.matchedPermissions = {}; + 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]]; + } + + /** + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + */ + Explanation.prototype.matchedPermissions = $util.emptyObject; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.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.asset.v1.IamPolicySearchResult.Explanation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); + if (error) + return "matchedPermissions." + error; + } + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Explanation.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + this.permissions = []; + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Permissions; + })(); + + return Explanation; + })(); + + return IamPolicySearchResult; + })(); + + v1.IamPolicyAnalysisState = (function() { + + /** + * Properties of an IamPolicyAnalysisState. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisState + * @property {google.rpc.Code|null} [code] IamPolicyAnalysisState code + * @property {string|null} [cause] IamPolicyAnalysisState cause + */ + + /** + * Constructs a new IamPolicyAnalysisState. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisState. + * @implements IIamPolicyAnalysisState + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set + */ + function IamPolicyAnalysisState(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]]; + } + + /** + * IamPolicyAnalysisState code. + * @member {google.rpc.Code} code + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + */ + IamPolicyAnalysisState.prototype.code = 0; + + /** + * IamPolicyAnalysisState cause. + * @member {string} cause + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + */ + IamPolicyAnalysisState.prototype.cause = ""; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState instance + */ + IamPolicyAnalysisState.create = function create(properties) { + return new IamPolicyAnalysisState(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisState.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.cause != null && Object.hasOwnProperty.call(message, "cause")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisState.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.asset.v1.IamPolicyAnalysisState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.cause = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisState message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.cause != null && message.hasOwnProperty("cause")) + if (!$util.isString(message.cause)) + return "cause: string expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + */ + IamPolicyAnalysisState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisState) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisState(); + switch (object.code) { + case "OK": + case 0: + message.code = 0; + break; + case "CANCELLED": + case 1: + message.code = 1; + break; + case "UNKNOWN": + case 2: + message.code = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.code = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.code = 4; + break; + case "NOT_FOUND": + case 5: + message.code = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.code = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.code = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.code = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.code = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.code = 9; + break; + case "ABORTED": + case 10: + message.code = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.code = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.code = 12; + break; + case "INTERNAL": + case 13: + message.code = 13; + break; + case "UNAVAILABLE": + case 14: + message.code = 14; + break; + case "DATA_LOSS": + case 15: + message.code = 15; + break; + } + if (object.cause != null) + message.cause = String(object.cause); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisState} message IamPolicyAnalysisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "OK" : 0; + object.cause = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; + if (message.cause != null && message.hasOwnProperty("cause")) + object.cause = message.cause; + return object; + }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicyAnalysisState; + })(); + + v1.IamPolicyAnalysisResult = (function() { + + /** + * Properties of an IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisResult + * @property {string|null} [attachedResourceFullName] IamPolicyAnalysisResult attachedResourceFullName + * @property {google.iam.v1.IBinding|null} [iamBinding] IamPolicyAnalysisResult iamBinding + * @property {Array.|null} [accessControlLists] IamPolicyAnalysisResult accessControlLists + * @property {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null} [identityList] IamPolicyAnalysisResult identityList + * @property {boolean|null} [fullyExplored] IamPolicyAnalysisResult fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisResult. + * @implements IIamPolicyAnalysisResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set + */ + function IamPolicyAnalysisResult(properties) { + this.accessControlLists = []; + 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]]; + } + + /** + * IamPolicyAnalysisResult attachedResourceFullName. + * @member {string} attachedResourceFullName + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.attachedResourceFullName = ""; + + /** + * IamPolicyAnalysisResult iamBinding. + * @member {google.iam.v1.IBinding|null|undefined} iamBinding + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.iamBinding = null; + + /** + * IamPolicyAnalysisResult accessControlLists. + * @member {Array.} accessControlLists + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.accessControlLists = $util.emptyArray; + + /** + * IamPolicyAnalysisResult identityList. + * @member {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null|undefined} identityList + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.identityList = null; + + /** + * IamPolicyAnalysisResult fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult instance + */ + IamPolicyAnalysisResult.create = function create(properties) { + return new IamPolicyAnalysisResult(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResourceFullName != null && Object.hasOwnProperty.call(message, "attachedResourceFullName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); + if (message.iamBinding != null && Object.hasOwnProperty.call(message, "iamBinding")) + $root.google.iam.v1.Binding.encode(message.iamBinding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessControlLists != null && message.accessControlLists.length) + for (var i = 0; i < message.accessControlLists.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.identityList != null && Object.hasOwnProperty.call(message, "identityList")) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.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.asset.v1.IamPolicyAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attachedResourceFullName = reader.string(); + break; + case 2: + message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.accessControlLists && message.accessControlLists.length)) + message.accessControlLists = []; + message.accessControlLists.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + case 4: + message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); + break; + case 5: + message.fullyExplored = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + if (!$util.isString(message.attachedResourceFullName)) + return "attachedResourceFullName: string expected"; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) { + var error = $root.google.iam.v1.Binding.verify(message.iamBinding); + if (error) + return "iamBinding." + error; + } + if (message.accessControlLists != null && message.hasOwnProperty("accessControlLists")) { + if (!Array.isArray(message.accessControlLists)) + return "accessControlLists: array expected"; + for (var i = 0; i < message.accessControlLists.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify(message.accessControlLists[i]); + if (error) + return "accessControlLists." + error; + } + } + if (message.identityList != null && message.hasOwnProperty("identityList")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify(message.identityList); + if (error) + return "identityList." + error; + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + */ + IamPolicyAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult(); + if (object.attachedResourceFullName != null) + message.attachedResourceFullName = String(object.attachedResourceFullName); + if (object.iamBinding != null) { + if (typeof object.iamBinding !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.iamBinding: object expected"); + message.iamBinding = $root.google.iam.v1.Binding.fromObject(object.iamBinding); + } + if (object.accessControlLists) { + if (!Array.isArray(object.accessControlLists)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.accessControlLists: array expected"); + message.accessControlLists = []; + for (var i = 0; i < object.accessControlLists.length; ++i) { + if (typeof object.accessControlLists[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.accessControlLists: object expected"); + message.accessControlLists[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.fromObject(object.accessControlLists[i]); + } + } + if (object.identityList != null) { + if (typeof object.identityList !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.identityList: object expected"); + message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.fromObject(object.identityList); + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult} message IamPolicyAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accessControlLists = []; + if (options.defaults) { + object.attachedResourceFullName = ""; + object.iamBinding = null; + object.identityList = null; + object.fullyExplored = false; + } + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + object.attachedResourceFullName = message.attachedResourceFullName; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + object.iamBinding = $root.google.iam.v1.Binding.toObject(message.iamBinding, options); + if (message.accessControlLists && message.accessControlLists.length) { + object.accessControlLists = []; + for (var j = 0; j < message.accessControlLists.length; ++j) + object.accessControlLists[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.toObject(message.accessControlLists[j], options); + } + if (message.identityList != null && message.hasOwnProperty("identityList")) + object.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.toObject(message.identityList, options); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IResource + * @property {string|null} [fullResourceName] Resource fullResourceName + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Resource analysisState + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.fullResourceName = ""; + + /** + * Resource analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.analysisState = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.IamPolicyAnalysisResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fullResourceName = ""; + object.analysisState = null; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + IamPolicyAnalysisResult.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IAccess + * @property {string|null} [role] Access role + * @property {string|null} [permission] Access permission + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Access analysisState + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + */ + function Access(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]]; + } + + /** + * Access role. + * @member {string} role + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.role = ""; + + /** + * Access permission. + * @member {string} permission + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.permission = ""; + + /** + * Access analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.analysisState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Access oneofAccess. + * @member {"role"|"permission"|undefined} oneofAccess + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Object.defineProperty(Access.prototype, "oneofAccess", { + get: $util.oneOfGetter($oneOfFields = ["role", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.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.asset.v1.IamPolicyAnalysisResult.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.permission = reader.string(); + break; + case 3: + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.role != null && message.hasOwnProperty("role")) { + properties.oneofAccess = 1; + if (!$util.isString(message.role)) + return "role: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.oneofAccess === 1) + return "oneofAccess: multiple values"; + properties.oneofAccess = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access(); + if (object.role != null) + message.role = String(object.role); + if (object.permission != null) + message.permission = String(object.permission); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Access.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analysisState = null; + if (message.role != null && message.hasOwnProperty("role")) { + object.role = message.role; + if (options.oneofs) + object.oneofAccess = "role"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.oneofAccess = "permission"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Access; + })(); + + IamPolicyAnalysisResult.Identity = (function() { + + /** + * Properties of an Identity. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IIdentity + * @property {string|null} [name] Identity name + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Identity analysisState + */ + + /** + * Constructs a new Identity. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Identity. + * @implements IIdentity + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + */ + function Identity(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]]; + } + + /** + * Identity name. + * @member {string} name + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.name = ""; + + /** + * Identity analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.analysisState = null; + + /** + * Creates a new Identity instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity instance + */ + Identity.create = function create(properties) { + return new Identity(properties); + }; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.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.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.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.asset.v1.IamPolicyAnalysisResult.Identity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Identity message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Identity.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.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + */ + Identity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity(); + if (object.name != null) + message.name = String(object.name); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} message Identity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Identity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.analysisState = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Identity to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + * @returns {Object.} JSON object + */ + Identity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Identity; + })(); + + IamPolicyAnalysisResult.Edge = (function() { + + /** + * Properties of an Edge. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IEdge + * @property {string|null} [sourceNode] Edge sourceNode + * @property {string|null} [targetNode] Edge targetNode + */ + + /** + * Constructs a new Edge. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Edge. + * @implements IEdge + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + */ + function Edge(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]]; + } + + /** + * Edge sourceNode. + * @member {string} sourceNode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.sourceNode = ""; + + /** + * Edge targetNode. + * @member {string} targetNode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.targetNode = ""; + + /** + * Creates a new Edge instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge instance + */ + Edge.create = function create(properties) { + return new Edge(properties); + }; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceNode != null && Object.hasOwnProperty.call(message, "sourceNode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); + if (message.targetNode != null && Object.hasOwnProperty.call(message, "targetNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetNode); + return writer; + }; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.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.asset.v1.IamPolicyAnalysisResult.Edge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceNode = reader.string(); + break; + case 2: + message.targetNode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Edge message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Edge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + if (!$util.isString(message.sourceNode)) + return "sourceNode: string expected"; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + if (!$util.isString(message.targetNode)) + return "targetNode: string expected"; + return null; + }; + + /** + * Creates an Edge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + */ + Edge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge(); + if (object.sourceNode != null) + message.sourceNode = String(object.sourceNode); + if (object.targetNode != null) + message.targetNode = String(object.targetNode); + return message; + }; + + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} message Edge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Edge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceNode = ""; + object.targetNode = ""; + } + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + object.sourceNode = message.sourceNode; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + object.targetNode = message.targetNode; + return object; + }; + + /** + * Converts this Edge to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + * @returns {Object.} JSON object + */ + Edge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Edge; + })(); + + IamPolicyAnalysisResult.AccessControlList = (function() { + + /** + * Properties of an AccessControlList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IAccessControlList + * @property {Array.|null} [resources] AccessControlList resources + * @property {Array.|null} [accesses] AccessControlList accesses + * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges + */ + + /** + * Constructs a new AccessControlList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an AccessControlList. + * @implements IAccessControlList + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + */ + function AccessControlList(properties) { + this.resources = []; + this.accesses = []; + this.resourceEdges = []; + 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]]; + } + + /** + * AccessControlList resources. + * @member {Array.} resources + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resources = $util.emptyArray; + + /** + * AccessControlList accesses. + * @member {Array.} accesses + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.accesses = $util.emptyArray; + + /** + * AccessControlList resourceEdges. + * @member {Array.} resourceEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resourceEdges = $util.emptyArray; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList instance + */ + AccessControlList.create = function create(properties) { + return new AccessControlList(properties); + }; + + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.accesses != null && message.accesses.length) + for (var i = 0; i < message.accesses.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.encode(message.accesses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceEdges != null && message.resourceEdges.length) + for (var i = 0; i < message.resourceEdges.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessControlList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.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.asset.v1.IamPolicyAnalysisResult.AccessControlList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessControlList message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessControlList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.asset.v1.IamPolicyAnalysisResult.Resource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.accesses != null && message.hasOwnProperty("accesses")) { + if (!Array.isArray(message.accesses)) + return "accesses: array expected"; + for (var i = 0; i < message.accesses.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify(message.accesses[i]); + if (error) + return "accesses." + error; + } + } + if (message.resourceEdges != null && message.hasOwnProperty("resourceEdges")) { + if (!Array.isArray(message.resourceEdges)) + return "resourceEdges: array expected"; + for (var i = 0; i < message.resourceEdges.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify(message.resourceEdges[i]); + if (error) + return "resourceEdges." + error; + } + } + return null; + }; + + /** + * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + */ + AccessControlList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resources: object expected"); + message.resources[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.fromObject(object.resources[i]); + } + } + if (object.accesses) { + if (!Array.isArray(object.accesses)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.accesses: array expected"); + message.accesses = []; + for (var i = 0; i < object.accesses.length; ++i) { + if (typeof object.accesses[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.accesses: object expected"); + message.accesses[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.fromObject(object.accesses[i]); + } + } + if (object.resourceEdges) { + if (!Array.isArray(object.resourceEdges)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: array expected"); + message.resourceEdges = []; + for (var i = 0; i < object.resourceEdges.length; ++i) { + if (typeof object.resourceEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: object expected"); + message.resourceEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} message AccessControlList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessControlList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accesses = []; + object.resourceEdges = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.toObject(message.resources[j], options); + } + if (message.accesses && message.accesses.length) { + object.accesses = []; + for (var j = 0; j < message.accesses.length; ++j) + object.accesses[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.toObject(message.accesses[j], options); + } + if (message.resourceEdges && message.resourceEdges.length) { + object.resourceEdges = []; + for (var j = 0; j < message.resourceEdges.length; ++j) + object.resourceEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); + } return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.project != null) - message.project = String(object.project); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.explanation != null) { - if (typeof object.explanation !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); - } - return message; - }; + }; - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicySearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.project = ""; - object.policy = null; - object.explanation = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); - return object; - }; + /** + * Converts this AccessControlList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + * @returns {Object.} JSON object + */ + AccessControlList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this IamPolicySearchResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - * @returns {Object.} JSON object - */ - IamPolicySearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return AccessControlList; + })(); - IamPolicySearchResult.Explanation = (function() { + IamPolicyAnalysisResult.IdentityList = (function() { /** - * Properties of an Explanation. - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @interface IExplanation - * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + * Properties of an IdentityList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IIdentityList + * @property {Array.|null} [identities] IdentityList identities + * @property {Array.|null} [groupEdges] IdentityList groupEdges */ /** - * Constructs a new Explanation. - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @classdesc Represents an Explanation. - * @implements IExplanation + * Constructs a new IdentityList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an IdentityList. + * @implements IIdentityList * @constructor - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set */ - function Explanation(properties) { - this.matchedPermissions = {}; + function IdentityList(properties) { + this.identities = []; + this.groupEdges = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7739,97 +13637,94 @@ } /** - * Explanation matchedPermissions. - * @member {Object.} matchedPermissions - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * IdentityList identities. + * @member {Array.} identities + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @instance */ - Explanation.prototype.matchedPermissions = $util.emptyObject; + IdentityList.prototype.identities = $util.emptyArray; /** - * Creates a new Explanation instance using the specified properties. + * IdentityList groupEdges. + * @member {Array.} groupEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.groupEdges = $util.emptyArray; + + /** + * Creates a new IdentityList instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList instance */ - Explanation.create = function create(properties) { - return new Explanation(properties); + IdentityList.create = function create(properties) { + return new IdentityList(properties); }; /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Explanation.encode = function encode(message, writer) { + IdentityList.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) - for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.encode(message.identities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupEdges != null && message.groupEdges.length) + for (var i = 0; i < message.groupEdges.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.groupEdges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Explanation.encodeDelimited = function encodeDelimited(message, writer) { + IdentityList.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Explanation message from the specified reader or buffer. + * Decodes an IdentityList message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Explanation.decode = function decode(reader, length) { + IdentityList.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.asset.v1.IamPolicySearchResult.Explanation(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (message.matchedPermissions === $util.emptyObject) - message.matchedPermissions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchedPermissions[key] = value; + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -7840,312 +13735,133 @@ }; /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. + * Decodes an IdentityList message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Explanation.decodeDelimited = function decodeDelimited(reader) { + IdentityList.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Explanation message. + * Verifies an IdentityList message. * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Explanation.verify = function verify(message) { + IdentityList.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { - if (!$util.isObject(message.matchedPermissions)) - return "matchedPermissions: object expected"; - var key = Object.keys(message.matchedPermissions); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); + if (message.identities != null && message.hasOwnProperty("identities")) { + if (!Array.isArray(message.identities)) + return "identities: array expected"; + for (var i = 0; i < message.identities.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify(message.identities[i]); if (error) - return "matchedPermissions." + error; + return "identities." + error; + } + } + if (message.groupEdges != null && message.hasOwnProperty("groupEdges")) { + if (!Array.isArray(message.groupEdges)) + return "groupEdges: array expected"; + for (var i = 0; i < message.groupEdges.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify(message.groupEdges[i]); + if (error) + return "groupEdges." + error; } } return null; }; /** - * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList */ - Explanation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) + IdentityList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList) return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); - if (object.matchedPermissions) { - if (typeof object.matchedPermissions !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); - message.matchedPermissions = {}; - for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { - if (typeof object.matchedPermissions[keys[i]] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); - message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) { + if (typeof object.identities[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities: object expected"); + message.identities[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.fromObject(object.identities[i]); + } + } + if (object.groupEdges) { + if (!Array.isArray(object.groupEdges)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: array expected"); + message.groupEdges = []; + for (var i = 0; i < object.groupEdges.length; ++i) { + if (typeof object.groupEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: object expected"); + message.groupEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.groupEdges[i]); } } return message; }; /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} message IdentityList * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Explanation.toObject = function toObject(message, options) { + IdentityList.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.matchedPermissions = {}; - var keys2; - if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { - object.matchedPermissions = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + if (options.arrays || options.defaults) { + object.identities = []; + object.groupEdges = []; + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.toObject(message.identities[j], options); + } + if (message.groupEdges && message.groupEdges.length) { + object.groupEdges = []; + for (var j = 0; j < message.groupEdges.length; ++j) + object.groupEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.groupEdges[j], options); } return object; }; /** - * Converts this Explanation to JSON. + * Converts this IdentityList to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @instance * @returns {Object.} JSON object */ - Explanation.prototype.toJSON = function toJSON() { + IdentityList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Explanation.Permissions = (function() { - - /** - * Properties of a Permissions. - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @interface IPermissions - * @property {Array.|null} [permissions] Permissions permissions - */ - - /** - * Constructs a new Permissions. - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @classdesc Represents a Permissions. - * @implements IPermissions - * @constructor - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set - */ - function Permissions(properties) { - this.permissions = []; - 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]]; - } - - /** - * Permissions permissions. - * @member {Array.} permissions - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @instance - */ - Permissions.prototype.permissions = $util.emptyArray; - - /** - * Creates a new Permissions instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance - */ - Permissions.create = function create(properties) { - return new Permissions(properties); - }; - - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Permissions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Permissions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Permissions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Permissions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Permissions message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Permissions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a Permissions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - */ - Permissions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Permissions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this Permissions to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @instance - * @returns {Object.} JSON object - */ - Permissions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Permissions; - })(); - - return Explanation; + return IdentityList; })(); - return IamPolicySearchResult; + return IamPolicyAnalysisResult; })(); return v1; @@ -35201,225 +40917,6 @@ return Timestamp; })(); - 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.Struct = (function() { /** @@ -36234,6 +41731,225 @@ return ListValue; })(); + 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() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index e4d819f310f..258879fcb1a 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -97,6 +97,23 @@ "(google.api.http).get": "/v1/{scope=*/*}:searchAllIamPolicies", "(google.api.method_signature)": "scope,query" } + }, + "AnalyzeIamPolicy": { + "requestType": "AnalyzeIamPolicyRequest", + "responseType": "AnalyzeIamPolicyResponse", + "options": { + "(google.api.http).get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + } + }, + "ExportIamPolicyAnalysis": { + "requestType": "ExportIamPolicyAnalysisRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{analysis_query.scope=*/*}:exportIamPolicyAnalysis", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.ExportIamPolicyAnalysisResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.ExportIamPolicyAnalysisRequest" + } } } }, @@ -530,6 +547,357 @@ } } }, + "IamPolicyAnalysisQuery": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceSelector": { + "type": "ResourceSelector", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identitySelector": { + "type": "IdentitySelector", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessSelector": { + "type": "AccessSelector", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "options": { + "type": "Options", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ResourceSelector": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IdentitySelector": { + "fields": { + "identity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AccessSelector": { + "fields": { + "roles": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Options": { + "fields": { + "expandGroups": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandRoles": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputResourceEdges": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputGroupEdges": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "analyzeServiceAccountImpersonation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxFanoutsPerGroup": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxFanoutsPerResource": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AnalyzeIamPolicyRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AnalyzeIamPolicyResponse": { + "fields": { + "mainAnalysis": { + "type": "IamPolicyAnalysis", + "id": 1 + }, + "serviceAccountImpersonationAnalysis": { + "rule": "repeated", + "type": "IamPolicyAnalysis", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "IamPolicyAnalysis": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + }, + "analysisResults": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + }, + "stats": { + "rule": "repeated", + "type": "Stats", + "id": 4 + }, + "nonCriticalErrors": { + "rule": "repeated", + "type": "IamPolicyAnalysisState", + "id": 5 + } + }, + "nested": { + "Stats": { + "fields": { + "nodeType": { + "type": "NodeType", + "id": 1 + }, + "nodeSubtype": { + "type": "string", + "id": 2 + }, + "discoveredNodeCount": { + "type": "int32", + "id": 3 + }, + "matchedNodeCount": { + "type": "int32", + "id": 4 + }, + "exploredNodeCount": { + "type": "int32", + "id": 5 + }, + "cappedNodeCount": { + "type": "int32", + "id": 6 + }, + "permisionDeniedNodeCount": { + "type": "int32", + "id": 7 + }, + "executionTimeoutNodeCount": { + "type": "int32", + "id": 8 + } + }, + "nested": { + "NodeType": { + "values": { + "NODE_TYPE_UNSPECIFIED": 0, + "BINDING": 1, + "IDENTITY": 2, + "RESOURCE": 3, + "ACCESS": 4 + } + } + } + } + } + } + } + }, + "IamPolicyAnalysisOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + }, + "nested": { + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tablePrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partitionKey": { + "type": "PartitionKey", + "id": 3 + }, + "writeMode": { + "type": "WriteMode", + "id": 4 + } + }, + "nested": { + "PartitionKey": { + "values": { + "PARTITION_KEY_UNSPECIFIED": 0, + "REQUEST_TIME": 1 + } + }, + "WriteMode": { + "values": { + "WRITE_MODE_UNSPECIFIED": 0, + "ABORT": 1, + "OVERWRITE": 2 + } + } + } + } + } + }, + "ExportIamPolicyAnalysisRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportIamPolicyAnalysisResponse": { + "fields": {} + }, "ContentType": { "values": { "CONTENT_TYPE_UNSPECIFIED": 0, @@ -760,6 +1128,138 @@ } } } + }, + "IamPolicyAnalysisState": { + "fields": { + "code": { + "type": "google.rpc.Code", + "id": 1 + }, + "cause": { + "type": "string", + "id": 2 + } + } + }, + "IamPolicyAnalysisResult": { + "fields": { + "attachedResourceFullName": { + "type": "string", + "id": 1 + }, + "iamBinding": { + "type": "google.iam.v1.Binding", + "id": 2 + }, + "accessControlLists": { + "rule": "repeated", + "type": "AccessControlList", + "id": 3 + }, + "identityList": { + "type": "IdentityList", + "id": 4 + }, + "fullyExplored": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "Resource": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 2 + } + } + }, + "Access": { + "oneofs": { + "oneofAccess": { + "oneof": [ + "role", + "permission" + ] + } + }, + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 3 + } + } + }, + "Identity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 2 + } + } + }, + "Edge": { + "fields": { + "sourceNode": { + "type": "string", + "id": 1 + }, + "targetNode": { + "type": "string", + "id": 2 + } + } + }, + "AccessControlList": { + "fields": { + "resources": { + "rule": "repeated", + "type": "Resource", + "id": 1 + }, + "accesses": { + "rule": "repeated", + "type": "Access", + "id": 2 + }, + "resourceEdges": { + "rule": "repeated", + "type": "Edge", + "id": 3 + } + } + }, + "IdentityList": { + "fields": { + "identities": { + "rule": "repeated", + "type": "Identity", + "id": 1 + }, + "groupEdges": { + "rule": "repeated", + "type": "Edge", + "id": 2 + } + } + } + } } } }, @@ -3418,18 +3918,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Struct": { "fields": { "fields": { @@ -3493,6 +3981,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index c6827482b5d..c66c325187e 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -211,6 +211,12 @@ export class AssetServiceClient { const exportAssetsMetadata = protoFilesRoot.lookup( '.google.cloud.asset.v1.ExportAssetsRequest' ) as gax.protobuf.Type; + const exportIamPolicyAnalysisResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse' + ) as gax.protobuf.Type; + const exportIamPolicyAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest' + ) as gax.protobuf.Type; this.descriptors.longrunning = { exportAssets: new this._gaxModule.LongrunningDescriptor( @@ -218,6 +224,15 @@ export class AssetServiceClient { exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) ), + exportIamPolicyAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportIamPolicyAnalysisResponse.decode.bind( + exportIamPolicyAnalysisResponse + ), + exportIamPolicyAnalysisMetadata.decode.bind( + exportIamPolicyAnalysisMetadata + ) + ), }; // Put together the default options sent with requests. @@ -275,6 +290,8 @@ export class AssetServiceClient { 'deleteFeed', 'searchAllResources', 'searchAllIamPolicies', + 'analyzeIamPolicy', + 'exportIamPolicyAnalysis', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -900,6 +917,115 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.deleteFeed(request, options, callback); } + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, + {} | undefined + ] + >; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Analyzes IAM policies to answer which identities have what accesses on + * which resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * The request query. + * @param {google.protobuf.Duration} [request.executionTimeout] + * Amount of time executable has to complete. See JSON representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * + * Default is empty. + * + * (-- We had discussion of whether we should have this field in the --) + * (-- request or use the RPC deadline instead. We finally choose this --) + * (-- approach for the following reasons (detailed in --) + * (-- go/analyze-iam-policy-deadlines): --) + * (-- * HTTP clients have very limited support of the RPC deadline. --) + * (-- There is an X-Server-Timeout header introduced in 2019/09, but --) + * (-- only implemented in the C++ HTTP server library. --) + * (-- * The purpose of the RPC deadline is for RPC clients to --) + * (-- communicate its max waiting time to the server. This deadline --) + * (-- could be further propagated to the downstream servers. It is --) + * (-- mainly used for servers to cancel the request processing --) + * (-- to avoid resource wasting. Overloading the RPC deadline for --) + * (-- other purposes could make our backend system harder to reason --) + * (-- about. --) + * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1.AnalyzeIamPolicyResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | 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({ + 'analysis_query.scope': request.analysisQuery!.scope || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeIamPolicy(request, options, callback); + } exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, @@ -1077,6 +1203,154 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest >; } + exportIamPolicyAnalysis( + request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportIamPolicyAnalysis( + request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportIamPolicyAnalysis( + request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Exports the answers of which identities have what accesses on which + * resources to a Google Cloud Storage or a BigQuery destination. For Cloud + * Storage destination, the output format is the JSON format that represents a + * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|google.cloud.asset.v1.AnalyzeIamPolicyResponse}. + * This method implements the + * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows + * you to track the export status. We recommend intervals of at least 2 + * seconds with exponential retry to poll the export operation result. The + * metadata contains the request to help callers to map responses to requests. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * The request query. + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig + * Output configuration indicating where the results will be output to. + * @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. + */ + exportIamPolicyAnalysis( + request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >, + 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({ + 'analysis_query.scope': request.analysisQuery!.scope || '', + }); + this.initialize(); + return this.innerApiCalls.exportIamPolicyAnalysis( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the exportIamPolicyAnalysis() 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 checkExportIamPolicyAnalysisProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkExportIamPolicyAnalysisProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.exportIamPolicyAnalysis, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest + >; + } searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index ac06aea1e81..897d6d7a2f5 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -64,6 +67,16 @@ "timeout_millis": 15000, "retry_codes_name": "idempotent", "retry_params_name": "default" + }, + "AnalyzeIamPolicy": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportIamPolicyAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index ac8732ec609..53b9ccdc95c 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "daa9de568ed01ba84ae64bce0ad09d82172cf707" + "sha": "a18de29d791a595df546e0024ee19530d8a84e85" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "sha": "72eb54c45231d84266ca059473bc1793c394fcb2", + "internalRef": "328059685" } }, { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 40976e91e77..924643d9483 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -900,6 +900,121 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('analyzeIamPolicy', () => { + it('invokes analyzeIamPolicy without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicy without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeIamPolicy with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('exportAssets', () => { it('invokes exportAssets without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ @@ -1091,6 +1206,209 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('exportIamPolicyAnalysis', () => { + it('invokes exportIamPolicyAnalysis without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.exportIamPolicyAnalysis(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportIamPolicyAnalysis without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.exportIamPolicyAnalysis( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, + protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportIamPolicyAnalysis with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.exportIamPolicyAnalysis(request), + expectedError + ); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportIamPolicyAnalysis with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportIamPolicyAnalysis(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkExportIamPolicyAnalysisProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkExportIamPolicyAnalysisProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportIamPolicyAnalysisProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkExportIamPolicyAnalysisProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('searchAllResources', () => { it('invokes searchAllResources without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ From 5874b23f2c884f3bacf54f4da06c0e41a78918cd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2020 10:22:21 -0700 Subject: [PATCH 262/429] chore: release 3.7.0 (#387) * chore: updated samples/package.json [ci skip] * chore: updated CHANGELOG.md [ci skip] * chore: updated package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index e08b44f84bd..00a874abb0b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.7.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.6.0...v3.7.0) (2020-08-24) + + +### Features + +* add AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs ([#386](https://www.github.com/googleapis/nodejs-asset/issues/386)) ([fa0981d](https://www.github.com/googleapis/nodejs-asset/commit/fa0981d949705814b790b2943d725ff4c118edc4)) + ## [3.6.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.5.1...v3.6.0) (2020-08-14) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 795ac027afe..1ed6be6eed5 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.6.0", + "version": "3.7.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index dd9ed2a0f80..c1ee3ca7708 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.6.0", + "@google-cloud/asset": "^3.7.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From e931c94228fecf2eb02cf16d8009b2965b7ade8f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Aug 2020 10:02:17 -0700 Subject: [PATCH 263/429] build: track flaky tests for "nightly", add new secrets for tagging (#388) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b7d32568-34e5-4528-b241-aff7ca0159c2/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-asset/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 53b9ccdc95c..f05995894f5 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "a18de29d791a595df546e0024ee19530d8a84e85" + "sha": "6a6e22d61fa2700c42961df03eb6b78c134e83bd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -87,7 +87,6 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/publish.yml", ".github/release-please.yml", ".github/workflows/ci.yaml", ".gitignore", From a6b19e5899d0052e8567334832f2a2b939ea722c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Sep 2020 19:04:02 +0200 Subject: [PATCH 264/429] fix(deps): update dependency yargs to v16 (#391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [yargs](https://yargs.js.org/) ([source](https://togithub.com/yargs/yargs)) | dependencies | major | [`^15.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/yargs/15.4.1/16.0.1) | --- ### Release Notes
yargs/yargs ### [`v16.0.1`](https://togithub.com/yargs/yargs/blob/master/CHANGELOG.md#​1601-httpswwwgithubcomyargsyargscomparev1600v1601-2020-09-09) [Compare Source](https://togithub.com/yargs/yargs/compare/v16.0.0...v16.0.1) ### [`v16.0.0`](https://togithub.com/yargs/yargs/blob/master/CHANGELOG.md#​1600-httpswwwgithubcomyargsyargscomparev1542v1600-2020-09-09) [Compare Source](https://togithub.com/yargs/yargs/compare/v15.4.1...v16.0.0) ##### ⚠ BREAKING CHANGES - tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hideBin; types now exported for Deno. - find-up replaced with escalade; export map added (limits importable files in Node >= 12); yarser-parser@19.x.x (new decamelize/camelcase implementation). - **usage:** single character aliases are now shown first in help output - rebase helper is no longer provided on yargs instance. - drop support for EOL Node 8 ([#​1686](https://togithub.com/yargs/yargs/issues/1686)) ##### Features - adds strictOptions() ([#​1738](https://www.github.com/yargs/yargs/issues/1738)) ([b215fba](https://www.github.com/yargs/yargs/commit/b215fba0ed6e124e5aad6cf22c8d5875661c63a3)) - **helpers:** rebase, Parser, applyExtends now blessed helpers ([#​1733](https://www.github.com/yargs/yargs/issues/1733)) ([c7debe8](https://www.github.com/yargs/yargs/commit/c7debe8eb1e5bc6ea20b5ed68026c56e5ebec9e1)) - adds support for ESM and Deno ([#​1708](https://www.github.com/yargs/yargs/issues/1708)) ([ac6d5d1](https://www.github.com/yargs/yargs/commit/ac6d5d105a75711fe703f6a39dad5181b383d6c6)) - drop support for EOL Node 8 ([#​1686](https://www.github.com/yargs/yargs/issues/1686)) ([863937f](https://www.github.com/yargs/yargs/commit/863937f23c3102f804cdea78ee3097e28c7c289f)) - i18n for ESM and Deno ([#​1735](https://www.github.com/yargs/yargs/issues/1735)) ([c71783a](https://www.github.com/yargs/yargs/commit/c71783a5a898a0c0e92ac501c939a3ec411ac0c1)) - tweaks to API surface based on user feedback ([#​1726](https://www.github.com/yargs/yargs/issues/1726)) ([4151fee](https://www.github.com/yargs/yargs/commit/4151fee4c33a97d26bc40de7e623e5b0eb87e9bb)) - **usage:** single char aliases first in help ([#​1574](https://www.github.com/yargs/yargs/issues/1574)) ([a552990](https://www.github.com/yargs/yargs/commit/a552990c120646c2d85a5c9b628e1ce92a68e797)) ##### Bug Fixes - **yargs:** add missing command(module) signature ([#​1707](https://www.github.com/yargs/yargs/issues/1707)) ([0f81024](https://www.github.com/yargs/yargs/commit/0f810245494ccf13a35b7786d021b30fc95ecad5)), closes [#​1704](https://www.github.com/yargs/yargs/issues/1704)
--- ### 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-asset). --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index c1ee3ca7708..f7415c4794f 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -19,7 +19,7 @@ "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", - "yargs": "^15.0.0" + "yargs": "^16.0.0" }, "devDependencies": { "chai": "^4.2.0", From debfb6de21094730459ff659316c7fef92192732 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 10 Sep 2020 10:13:46 -0700 Subject: [PATCH 265/429] fix!: remove unused AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs (#393) These RPCs do not currently work on the backend, so they should not be added to the client libraries. PiperOrigin-RevId: 330786980 Source-Author: Google APIs Source-Date: Wed Sep 9 13:35:02 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: ef03f63f2f2d3b2dd936e46595c0f746cb10c43c Source-Link: https://github.com/googleapis/googleapis/commit/ef03f63f2f2d3b2dd936e46595c0f746cb10c43c --- .../google/cloud/asset/v1/asset_service.proto | 425 - .../protos/google/cloud/asset/v1/assets.proto | 160 +- .../google-cloud-asset/protos/protos.d.ts | 3749 ++----- packages/google-cloud-asset/protos/protos.js | 9742 ++++------------- .../google-cloud-asset/protos/protos.json | 524 +- .../src/v1/asset_service_client.ts | 274 - .../src/v1/asset_service_client_config.json | 13 - packages/google-cloud-asset/synth.metadata | 6 +- .../test/gapic_asset_service_v1.ts | 318 - 9 files changed, 2741 insertions(+), 12470 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index fce88c71c5c..4aa3ee74ee2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -138,36 +138,6 @@ service AssetService { }; option (google.api.method_signature) = "scope,query"; } - - // Analyzes IAM policies to answer which identities have what accesses on - // which resources. - rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) - returns (AnalyzeIamPolicyResponse) { - option (google.api.http) = { - get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" - }; - } - - // Exports the answers of which identities have what accesses on which - // resources to a Google Cloud Storage or a BigQuery destination. For Cloud - // Storage destination, the output format is the JSON format that represents a - // [google.cloud.asset.v1.AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. - // This method implements the - // [google.longrunning.Operation][google.longrunning.Operation], which allows - // you to track the export status. We recommend intervals of at least 2 - // seconds with exponential retry to poll the export operation result. The - // metadata contains the request to help callers to map responses to requests. - rpc ExportIamPolicyAnalysis(ExportIamPolicyAnalysisRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{analysis_query.scope=*/*}:exportIamPolicyAnalysis" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.asset.v1.ExportIamPolicyAnalysisResponse" - metadata_type: "google.cloud.asset.v1.ExportIamPolicyAnalysisRequest" - }; - } } // Export asset request. @@ -668,401 +638,6 @@ message SearchAllIamPoliciesResponse { string next_page_token = 2; } -// IAM policy analysis query message. -message IamPolicyAnalysisQuery { - // The relative name of the root asset. Only resources and IAM policies within - // the scope will be analyzed. - // - // This can only be an organization number (such as "organizations/123"), a - // folder number (such as "folders/123"), a project ID (such as - // "projects/my-project-id"), or a project number (such as "projects/12345"). - // - // To know how to get organization id, visit [here - // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - // - // To know how to get folder or project id, visit [here - // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). - string scope = 1 [ - (google.api.field_behavior) = REQUIRED - ]; - - // Specifies the resource to analyze for access policies, which may be set - // directly on the resource, or on ancestors such as organizations, folders or - // projects. - message ResourceSelector { - // The [full resource name] - // (https://cloud.google.com/asset-inventory/docs/resource-name-format) - // of a resource of [supported resource - // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). - string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Specifies a resource for analysis. - ResourceSelector resource_selector = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Specifies an identity for which to determine resource access, based on - // roles assigned either directly to them or to the groups they belong to, - // directly or indirectly. - message IdentitySelector { - // The identity appear in the form of members in - // [IAM policy - // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). - // - // The examples of supported forms are: - // "user:mike@example.com", - // "group:admins@example.com", - // "domain:google.com", - // "serviceAccount:my-project-id@appspot.gserviceaccount.com". - // - // Notice that wildcard characters (such as * and ?) are not supported. - // You must give a specific identity. - string identity = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Specifies an identity for analysis. - IdentitySelector identity_selector = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Specifies roles and/or permissions to analyze, to determine both the - // identities possessing them and the resources they control. If multiple - // values are specified, results will include roles or permissions matching - // any of them. - message AccessSelector { - // The roles to appear in result. - repeated string roles = 1 [(google.api.field_behavior) = OPTIONAL]; - - // The permissions to appear in result. - repeated string permissions = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Specifies roles or permissions for analysis. This is optional. - AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Contains query options. - message Options { - // If true, the identities section of the result will expand any - // Google groups appearing in an IAM policy binding. - // - // If - // [google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] - // is specified, the identity in the result will be determined by the - // selector, and this flag is not allowed to set. - // - // Default is false. - bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; - - // If true, the access section of result will expand any roles - // appearing in IAM policy bindings to include their permissions. - // - // If - // [google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] - // is specified, the access section of the result will be determined by the - // selector, and this flag is not allowed to set. - // - // Default is false. - bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If true and - // [google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] - // is not specified, the resource section of the result will expand any - // resource attached to an IAM policy to include resources lower in the - // resource hierarchy. - // - // For example, if the request analyzes for which resources user A has - // permission P, and the results include an IAM policy with P on a GCP - // folder, the results will also include resources in that folder with - // permission P. - // - // If true and - // [google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] - // is specified, the resource section of the result will expand the - // specified resource to include resources lower in the resource hierarchy. - // - // For example, if the request analyzes for which users have permission P on - // a GCP folder with this option enabled, the results will include all users - // who have permission P on that folder or any lower resource(ex. project). - // - // Default is false. - bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; - - // If true, the result will output resource edges, starting - // from the policy attached resource, to any expanded resources. - // Default is false. - bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; - - // If true, the result will output group identity edges, starting - // from the binding's group members, to any expanded identities. - // Default is false. - bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; - - // If true, the response will include access analysis from identities to - // resources via service account impersonation. This is a very expensive - // operation, because many derived queries will be executed. We highly - // recommend you use - // [google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysis][google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysis] - // rpc instead. - // - // For example, if the request analyzes for which resources user A has - // permission P, and there's an IAM policy states user A has - // iam.serviceAccounts.getAccessToken permission to a service account SA, - // and there's another IAM policy states service account SA has permission P - // to a GCP folder F, then user A potentially has access to the GCP folder - // F. And those advanced analysis results will be included in - // [google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. - // - // Another example, if the request analyzes for who has - // permission P to a GCP folder F, and there's an IAM policy states user A - // has iam.serviceAccounts.actAs permission to a service account SA, and - // there's another IAM policy states service account SA has permission P to - // the GCP folder F, then user A potentially has access to the GCP folder - // F. And those advanced analysis results will be included in - // [google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. - // - // Default is false. - bool analyze_service_account_impersonation = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // The maximum number of fanouts per group when [expand_groups][expand_groups] - // is enabled. This internal field is to help load testing and determine a - // proper value, and won't be public in the future. - int32 max_fanouts_per_group = 7 [ - (google.api.field_behavior) = OPTIONAL - ]; - - // The maximum number of fanouts per parent resource, such as - // GCP Project etc., when [expand_resources][] is enabled. This internal - // field is to help load testing and determine a proper value, and won't be - // public in the future. - int32 max_fanouts_per_resource = 8 [ - (google.api.field_behavior) = OPTIONAL - ]; - } - - // The query options. - Options options = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request message for -// [google.cloud.asset.v1.AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. -message AnalyzeIamPolicyRequest { - // The request query. - IamPolicyAnalysisQuery analysis_query = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Amount of time executable has to complete. See JSON representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). - // - // If this field is set with a value less than the RPC deadline, and the - // execution of your query hasn't finished in the specified - // execution timeout, you will get a response with partial result. - // Otherwise, your query's execution will continue until the RPC deadline. - // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. - // - // Default is empty. - // - // (-- We had discussion of whether we should have this field in the --) - // (-- request or use the RPC deadline instead. We finally choose this --) - // (-- approach for the following reasons (detailed in --) - // (-- go/analyze-iam-policy-deadlines): --) - // (-- * HTTP clients have very limited support of the RPC deadline. --) - // (-- There is an X-Server-Timeout header introduced in 2019/09, but --) - // (-- only implemented in the C++ HTTP server library. --) - // (-- * The purpose of the RPC deadline is for RPC clients to --) - // (-- communicate its max waiting time to the server. This deadline --) - // (-- could be further propagated to the downstream servers. It is --) - // (-- mainly used for servers to cancel the request processing --) - // (-- to avoid resource wasting. Overloading the RPC deadline for --) - // (-- other purposes could make our backend system harder to reason --) - // (-- about. --) - google.protobuf.Duration execution_timeout = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A response message for -// [google.cloud.asset.v1.AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. -message AnalyzeIamPolicyResponse { - // An analysis message to group the query and results. - message IamPolicyAnalysis { - // The analysis query. - IamPolicyAnalysisQuery analysis_query = 1; - - // A list of [google.cloud.asset.v1.IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] - // that matches the analysis query, or empty if no result is found. - repeated IamPolicyAnalysisResult analysis_results = 2; - - // Represents whether all entries in the - // [analysis_results][analysis_results] have been fully explored to answer - // the query. - bool fully_explored = 3; - - // A stats message that contains a set of analysis metrics. - // - // Here are some equations to show relationships of the explicitly specified - // metrics with other implicit metrics: - // * node_count = discovered_node_count + undiscovered_node_count(implicit) - // * discovered_node_count = explored_node_count + - // unexplored_node_count(implicit) - // * explored_node_count = capped_node_count + uncapped_node_count(implicit) - // * unexplored_node_count(implicit) = permission_denied_node_count + - // execution_timeout_node_count + other_unexplored_node_count(implicit) - // * discovered_node_count = matched_node_count + - // unmatched_node_count(implicit) - message Stats { - // Type of the node. - enum NodeType { - // Unspecified node type. - NODE_TYPE_UNSPECIFIED = 0; - // IAM Policy Binding node type. - BINDING = 1; - // Identity node type. - IDENTITY = 2; - // Resource node type. - RESOURCE = 3; - // Access node type. - ACCESS = 4; - } - - // Node type. - NodeType node_type = 1; - - // The subtype of a node, such as: - // * For Identity: Group, User, ServiceAccount etc. - // * For Resource: resource type name, such as - // cloudresourcemanager.googleapis.com/Organization, etc. - // * For Access: Role or Permission - string node_subtype = 2; - - // The count of discovered nodes. - int32 discovered_node_count = 3; - - // The count of nodes that match the query. These nodes form a sub-graph - // of discovered nodes. - int32 matched_node_count = 4; - - // The count of explored nodes. - int32 explored_node_count = 5; - - // The count of nodes that get explored, but are capped by max fanout - // setting. - int32 capped_node_count = 6; - - // The count of unexplored nodes caused by permission denied error. - int32 permision_denied_node_count = 7; - - // The count of unexplored nodes caused by execution timeout. - int32 execution_timeout_node_count = 8; - } - - // The stats of how the analysis has been explored. - repeated Stats stats = 4; - - // A list of non-critical errors happened during the query handling. - repeated IamPolicyAnalysisState non_critical_errors = 5; - } - - // The main analysis that matches the original request. - IamPolicyAnalysis main_analysis = 1; - - // The service account impersonation analysis if - // [google.cloud.asset.v1.AnalyzeIamPolicyRequest.analyze_service_account_impersonation][google.cloud.asset.v1.AnalyzeIamPolicyRequest.analyze_service_account_impersonation] - // is enabled. - repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; - - // Represents whether all entries in the [main_analysis][main_analysis] and - // [service_account_impersonation_analysis][] have been fully explored to - // answer the query in the request. - bool fully_explored = 3; -} - -// Output configuration for export IAM policy analysis destination. -message IamPolicyAnalysisOutputConfig { - // A Cloud Storage location. - message GcsDestination { - // The uri of the Cloud Storage object. It's the same uri that is used by - // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - // Editing Object - // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - // for more information. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // A BigQuery destination. - message BigQueryDestination { - // The BigQuery dataset in format "projects/projectId/datasets/datasetId", - // to which the analysis results should be exported. If this dataset does - // not exist, the export call will return an INVALID_ARGUMENT error. - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED - ]; - - // The prefix of the BigQuery tables to which the analysis results will be - // written. Tables will be created based on this table_prefix if not exist: - // * _analysis table will contain export operation's metadata. - // * _analysis_result will contain all the - // [IamPolicyAnalysisResult][]. - // When [partition_key] is specified, both tables will be partitioned based - // on the [partition_key]. - string table_prefix = 2 [ - (google.api.field_behavior) = REQUIRED - ]; - - // This enum determines the partition key column for the bigquery tables. - // Partitioning can improve query performance and reduce query cost by - // filtering partitions. Refer to - // https://cloud.google.com/bigquery/docs/partitioned-tables for details. - enum PartitionKey { - // Unspecified partition key. Tables won't be partitioned using this - // option. - PARTITION_KEY_UNSPECIFIED = 0; - // The time when the request is received. If specified as partition key, - // the result table(s) is partitoned by the RequestTime column, an - // additional timestamp column representing when the request was received. - REQUEST_TIME = 1; - } - // The partition key for BigQuery partitioned table. - PartitionKey partition_key = 3; - - // Write mode types if table exists. - enum WriteMode { - // Unspecified write mode. We expect one of the following valid modes must - // be specified when table or partition exists. - WRITE_MODE_UNSPECIFIED = 0; - // Abort the export when table or partition exists. - ABORT = 1; - // Overwrite the table when table exists. When partitioned, overwrite - // the existing partition. - OVERWRITE = 2; - } - // The write mode when table exists. WriteMode is ignored when no existing - // tables, or no existing partitions are found. - WriteMode write_mode = 4; - } - - // IAM policy analysis export destination. - oneof destination { - // Destination on Cloud Storage. - GcsDestination gcs_destination = 1; - - // Destination on BigQuery. - BigQueryDestination bigquery_destination = 2; - } -} - -// A request message for [AssetService.ExportIamPolicyAnalysis][]. -message ExportIamPolicyAnalysisRequest { - // The request query. - IamPolicyAnalysisQuery analysis_query = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Output configuration indicating where the results will be output to. - IamPolicyAnalysisOutputConfig output_config = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The export IAM policy analysis response. -message ExportIamPolicyAnalysisResponse {} - // Asset content type. enum ContentType { // Unspecified content type. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 01c768532b1..b9d56744e16 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -22,9 +22,11 @@ import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -148,8 +150,7 @@ message Asset { // Please also refer to the [service perimeter user // guide](https://cloud.google.com/vpc-service-controls/docs/overview). - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = - 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } // The ancestry path of an asset in Google Cloud [resource @@ -377,158 +378,3 @@ message IamPolicySearchResult { // information to explain why the search result matches the query. Explanation explanation = 4; } - -// Represents the detailed state of an entity under analysis, such as a -// resource, an identity or an access. -message IamPolicyAnalysisState { - // The Google standard error code that best describes the state. - // For example: - // - OK means the analysis on this entity has been successfully finished; - // - PERMISSION_DENIED means an access denied error is encountered; - // - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started - // in time; - google.rpc.Code code = 1; - - // The human-readable description of the cause of failure. - string cause = 2; -} - -// IAM Policy analysis result, consisting of one IAM policy binding and derived -// access control lists. -message IamPolicyAnalysisResult { - // The [full resource - // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) - // of the resource to which the [iam_binding][iam_binding] policy attaches. - // (-- api-linter: core::0122::name-suffix=disabled - // aip.dev/not-precedent: full_resource_name is a public notion in GCP. - // --) - string attached_resource_full_name = 1; - - // The Cloud IAM policy binding under analysis. - google.iam.v1.Binding iam_binding = 2; - - // A Google Cloud resource under analysis. - message Resource { - // The [full resource - // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) - // (-- api-linter: core::0122::name-suffix=disabled - // aip.dev/not-precedent: full_resource_name is a public notion in GCP. - // --) - string full_resource_name = 1; - - // The analysis state of this resource. - IamPolicyAnalysisState analysis_state = 2; - } - - // An IAM role or permission under analysis. - message Access { - oneof oneof_access { - // The role. - string role = 1; - - // The permission. - string permission = 2; - } - - // The analysis state of this access. - IamPolicyAnalysisState analysis_state = 3; - } - - // An identity under analysis. - // (-- api-linter: core::0123::resource-annotation=disabled - // aip.dev/not-precedent: Identity name is not a resource. --) - message Identity { - // The identity name in any form of members appear in - // [IAM policy - // binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such - // as: - // - user:foo@google.com - // - group:group1@google.com - // - serviceAccount:s1@prj1.iam.gserviceaccount.com - // - projectOwner:some_project_id - // - domain:google.com - // - allUsers - // - etc. - // - string name = 1; - - // The analysis state of this identity. - IamPolicyAnalysisState analysis_state = 2; - } - - // A directional edge. - message Edge { - // The source node of the edge. For example, it could be a full resource - // name for a resource node or an email of an identity. - string source_node = 1; - - // The target node of the edge. For example, it could be a full resource - // name for a resource node or an email of an identity. - string target_node = 2; - } - - // An access control list, derived from the above IAM policy binding, which - // contains a set of resources and accesses. May include one - // item from each set to compose an access control entry. - // - // NOTICE that there could be multiple access control lists for one IAM policy - // binding. The access control lists are created based on resource and access - // combinations. - // - // For example, assume we have the following cases in one IAM policy binding: - // - Permission P1 and P2 apply to resource R1 and R2; - // - Permission P3 applies to resource R2 and R3; - // - // This will result in the following access control lists: - // - AccessControlList 1: [R1, R2], [P1, P2] - // - AccessControlList 2: [R2, R3], [P3] - message AccessControlList { - // The resources that match one of the following conditions: - // - The resource_selector, if it is specified in request; - // - Otherwise, resources reachable from the policy attached resource. - repeated Resource resources = 1; - - // The accesses that match one of the following conditions: - // - The access_selector, if it is specified in request; - // - Otherwise, access specifiers reachable from the policy binding's role. - repeated Access accesses = 2; - - // Resource edges of the graph starting from the policy attached - // resource to any descendant resources. The [Edge.source_node][] contains - // the full resource name of a parent resource and [Edge.target_node][] - // contains the full resource name of a child resource. This field is - // present only if the output_resource_edges option is enabled in request. - repeated Edge resource_edges = 3; - } - - // The access control lists derived from the [iam_binding][iam_binding] that - // match or potentially match resource and access selectors specified in the - // request. - repeated AccessControlList access_control_lists = 3; - - // The identities and group edges. - message IdentityList { - // Only the identities that match one of the following conditions will be - // presented: - // - The identity_selector, if it is specified in request; - // - Otherwise, identities reachable from the policy binding's members. - repeated Identity identities = 1; - - // Group identity edges of the graph starting from the binding's - // group members to any node of the [identities][]. The [Edge.source_node][] - // contains a group, such as `group:parent@google.com`. The - // [Edge.target_node][] contains a member of the group, - // such as `group:child@google.com` or `user:foo@google.com`. - // This field is present only if the output_group_edges option is enabled in - // request. - repeated Edge group_edges = 2; - } - - // The identity list derived from members of the [iam_binding][iam_binding] - // that match or potentially match identity selector specified in the request. - IdentityList identity_list = 4; - - // Represents whether all analyses on the [iam_binding][iam_binding] have - // successfully finished. - bool fully_explored = 5; -} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 8ed56fff2cb..5e5c844f96b 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -171,34 +171,6 @@ export namespace google { * @returns Promise */ public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): Promise; - - /** - * Calls AnalyzeIamPolicy. - * @param request AnalyzeIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse - */ - public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback): void; - - /** - * Calls AnalyzeIamPolicy. - * @param request AnalyzeIamPolicyRequest message or plain object - * @returns Promise - */ - public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): Promise; - - /** - * Calls ExportIamPolicyAnalysis. - * @param request ExportIamPolicyAnalysisRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportIamPolicyAnalysis(request: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, callback: google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysisCallback): void; - - /** - * Calls ExportIamPolicyAnalysis. - * @param request ExportIamPolicyAnalysisRequest message or plain object - * @returns Promise - */ - public exportIamPolicyAnalysis(request: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest): Promise; } namespace AssetService { @@ -265,20 +237,6 @@ export namespace google { * @param [response] SearchAllIamPoliciesResponse */ type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllIamPoliciesResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. - * @param error Error, if any - * @param [response] AnalyzeIamPolicyResponse - */ - type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeIamPolicyResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportIamPolicyAnalysis}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportIamPolicyAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of an ExportAssetsRequest. */ @@ -2459,3226 +2417,939 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an IamPolicyAnalysisQuery. */ - interface IIamPolicyAnalysisQuery { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } - /** IamPolicyAnalysisQuery scope */ - scope?: (string|null); + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** IamPolicyAnalysisQuery resourceSelector */ - resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); - /** IamPolicyAnalysisQuery identitySelector */ - identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); + /** TemporalAsset deleted */ + deleted?: (boolean|null); - /** IamPolicyAnalysisQuery accessSelector */ - accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); - /** IamPolicyAnalysisQuery options */ - options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); } - /** Represents an IamPolicyAnalysisQuery. */ - class IamPolicyAnalysisQuery implements IIamPolicyAnalysisQuery { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new IamPolicyAnalysisQuery. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery); + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - /** IamPolicyAnalysisQuery scope. */ - public scope: string; + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); - /** IamPolicyAnalysisQuery resourceSelector. */ - public resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); + /** TemporalAsset deleted. */ + public deleted: boolean; - /** IamPolicyAnalysisQuery identitySelector. */ - public identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); - /** IamPolicyAnalysisQuery accessSelector. */ - public accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); - /** IamPolicyAnalysisQuery options. */ - public options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); /** - * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicyAnalysisQuery instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery): google.cloud.asset.v1.IamPolicyAnalysisQuery; + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; /** - * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. - * @param message IamPolicyAnalysisQuery message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. - * @param message IamPolicyAnalysisQuery message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisQuery + * @returns TemporalAsset * @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.asset.v1.IamPolicyAnalysisQuery; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; /** - * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisQuery + * @returns TemporalAsset * @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.asset.v1.IamPolicyAnalysisQuery; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; /** - * Verifies an IamPolicyAnalysisQuery message. + * Verifies a TemporalAsset 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 IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicyAnalysisQuery + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; /** - * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisQuery + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicyAnalysisQuery to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace IamPolicyAnalysisQuery { - - /** Properties of a ResourceSelector. */ - interface IResourceSelector { + namespace TemporalAsset { - /** ResourceSelector fullResourceName */ - fullResourceName?: (string|null); + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 } + } - /** Represents a ResourceSelector. */ - class ResourceSelector implements IResourceSelector { - - /** - * Constructs a new ResourceSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector); + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** ResourceSelector fullResourceName. */ - public fullResourceName: string; + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new ResourceSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceSelector instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } - /** - * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. - * @param message ResourceSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { - /** - * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. - * @param message ResourceSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITimeWindow); - /** - * Decodes a ResourceSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceSelector - * @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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceSelector - * @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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a ResourceSelector 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 new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; - /** - * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. - * @param message ResourceSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ResourceSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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.asset.v1.TimeWindow; - /** Properties of an IdentitySelector. */ - interface IIdentitySelector { + /** + * 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.asset.v1.TimeWindow; - /** IdentitySelector identity */ - identity?: (string|null); - } + /** + * 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); - /** Represents an IdentitySelector. */ - class IdentitySelector implements IIdentitySelector { + /** + * 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.asset.v1.TimeWindow; - /** - * Constructs a new IdentitySelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector); + /** + * 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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** IdentitySelector identity. */ - public identity: string; + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new IdentitySelector instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentitySelector instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; + /** Properties of an Asset. */ + interface IAsset { - /** - * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. - * @param message IdentitySelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. - * @param message IdentitySelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + /** Asset name */ + name?: (string|null); - /** - * Decodes an IdentitySelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentitySelector - * @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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; + /** Asset assetType */ + assetType?: (string|null); - /** - * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentitySelector - * @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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); - /** - * Verifies an IdentitySelector 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); + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); - /** - * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentitySelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); - /** - * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. - * @param message IdentitySelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - /** - * Converts this IdentitySelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - /** Properties of an AccessSelector. */ - interface IAccessSelector { + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - /** AccessSelector roles */ - roles?: (string[]|null); + /** Asset ancestors */ + ancestors?: (string[]|null); + } - /** AccessSelector permissions */ - permissions?: (string[]|null); - } + /** Represents an Asset. */ + class Asset implements IAsset { - /** Represents an AccessSelector. */ - class AccessSelector implements IAccessSelector { + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); - /** - * Constructs a new AccessSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector); + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** AccessSelector roles. */ - public roles: string[]; + /** Asset name. */ + public name: string; - /** AccessSelector permissions. */ - public permissions: string[]; + /** Asset assetType. */ + public assetType: string; - /** - * Creates a new AccessSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns AccessSelector instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); - /** - * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. - * @param message AccessSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); - /** - * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. - * @param message AccessSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; - /** - * Decodes an AccessSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccessSelector - * @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.asset.v1.IamPolicyAnalysisQuery.AccessSelector; + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - /** - * Decodes an AccessSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccessSelector - * @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.asset.v1.IamPolicyAnalysisQuery.AccessSelector; + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - /** - * Verifies an AccessSelector 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); + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - /** - * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccessSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; + /** Asset ancestors. */ + public ancestors: string[]; - /** - * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. - * @param message AccessSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); - /** - * Converts this AccessSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; - /** Properties of an Options. */ - interface IOptions { + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** Options expandGroups */ - expandGroups?: (boolean|null); + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** Options expandRoles */ - expandRoles?: (boolean|null); + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1.Asset; - /** Options expandResources */ - expandResources?: (boolean|null); + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1.Asset; - /** Options outputResourceEdges */ - outputResourceEdges?: (boolean|null); - - /** Options outputGroupEdges */ - outputGroupEdges?: (boolean|null); - - /** Options analyzeServiceAccountImpersonation */ - analyzeServiceAccountImpersonation?: (boolean|null); - - /** Options maxFanoutsPerGroup */ - maxFanoutsPerGroup?: (number|null); - - /** Options maxFanoutsPerResource */ - maxFanoutsPerResource?: (number|null); - } - - /** Represents an Options. */ - class Options implements IOptions { - - /** - * Constructs a new Options. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions); - - /** Options expandGroups. */ - public expandGroups: boolean; - - /** Options expandRoles. */ - public expandRoles: boolean; - - /** Options expandResources. */ - public expandResources: boolean; - - /** Options outputResourceEdges. */ - public outputResourceEdges: boolean; + /** + * Verifies an Asset 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); - /** Options outputGroupEdges. */ - public outputGroupEdges: boolean; + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; - /** Options analyzeServiceAccountImpersonation. */ - public analyzeServiceAccountImpersonation: boolean; + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Options maxFanoutsPerGroup. */ - public maxFanoutsPerGroup: number; + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Options maxFanoutsPerResource. */ - public maxFanoutsPerResource: number; + /** Properties of a Resource. */ + interface IResource { - /** - * Creates a new Options instance using the specified properties. - * @param [properties] Properties to set - * @returns Options instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; + /** Resource version */ + version?: (string|null); - /** - * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. - * @param message Options message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** - * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. - * @param message Options message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** Resource discoveryName */ + discoveryName?: (string|null); - /** - * Decodes an Options message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Options - * @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.asset.v1.IamPolicyAnalysisQuery.Options; + /** Resource resourceUrl */ + resourceUrl?: (string|null); - /** - * Decodes an Options message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Options - * @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.asset.v1.IamPolicyAnalysisQuery.Options; + /** Resource parent */ + parent?: (string|null); - /** - * Verifies an Options 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); + /** Resource data */ + data?: (google.protobuf.IStruct|null); - /** - * Creates an Options message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Options - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; + /** Resource location */ + location?: (string|null); + } - /** - * Creates a plain object from an Options message. Also converts values to other types if specified. - * @param message Options - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a Resource. */ + class Resource implements IResource { - /** - * Converts this Options to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); - /** Properties of an AnalyzeIamPolicyRequest. */ - interface IAnalyzeIamPolicyRequest { + /** Resource version. */ + public version: string; - /** AnalyzeIamPolicyRequest analysisQuery */ - analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** AnalyzeIamPolicyRequest executionTimeout */ - executionTimeout?: (google.protobuf.IDuration|null); - } + /** Resource discoveryName. */ + public discoveryName: string; - /** Represents an AnalyzeIamPolicyRequest. */ - class AnalyzeIamPolicyRequest implements IAnalyzeIamPolicyRequest { + /** Resource resourceUrl. */ + public resourceUrl: string; - /** - * Constructs a new AnalyzeIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest); + /** Resource parent. */ + public parent: string; - /** AnalyzeIamPolicyRequest analysisQuery. */ - public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); - /** AnalyzeIamPolicyRequest executionTimeout. */ - public executionTimeout?: (google.protobuf.IDuration|null); + /** Resource location. */ + public location: string; /** - * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns AnalyzeIamPolicyRequest instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): google.cloud.asset.v1.AnalyzeIamPolicyRequest; + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; /** - * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. - * @param message AnalyzeIamPolicyRequest message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. - * @param message AnalyzeIamPolicyRequest message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnalyzeIamPolicyRequest + * @returns Resource * @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.asset.v1.AnalyzeIamPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; /** - * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnalyzeIamPolicyRequest + * @returns Resource * @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.asset.v1.AnalyzeIamPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; /** - * Verifies an AnalyzeIamPolicyRequest message. + * Verifies a Resource 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 AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnalyzeIamPolicyRequest + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; /** - * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. - * @param message AnalyzeIamPolicyRequest + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnalyzeIamPolicyRequest to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AnalyzeIamPolicyResponse. */ - interface IAnalyzeIamPolicyResponse { + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { - /** AnalyzeIamPolicyResponse mainAnalysis */ - mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + /** ResourceSearchResult name */ + name?: (string|null); - /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis */ - serviceAccountImpersonationAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]|null); + /** ResourceSearchResult assetType */ + assetType?: (string|null); - /** AnalyzeIamPolicyResponse fullyExplored */ - fullyExplored?: (boolean|null); - } + /** ResourceSearchResult project */ + project?: (string|null); - /** Represents an AnalyzeIamPolicyResponse. */ - class AnalyzeIamPolicyResponse implements IAnalyzeIamPolicyResponse { + /** ResourceSearchResult displayName */ + displayName?: (string|null); - /** - * Constructs a new AnalyzeIamPolicyResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse); + /** ResourceSearchResult description */ + description?: (string|null); - /** AnalyzeIamPolicyResponse mainAnalysis. */ - public mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + /** ResourceSearchResult location */ + location?: (string|null); - /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. */ - public serviceAccountImpersonationAnalysis: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]; + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); - /** AnalyzeIamPolicyResponse fullyExplored. */ - public fullyExplored: boolean; + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); - /** - * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AnalyzeIamPolicyResponse instance - */ - public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse): google.cloud.asset.v1.AnalyzeIamPolicyResponse; + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + } - /** - * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. - * @param message AnalyzeIamPolicyResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { /** - * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. - * @param message AnalyzeIamPolicyResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Constructs a new ResourceSearchResult. + * @param [properties] Properties to set */ - public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); - /** - * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnalyzeIamPolicyResponse + * @returns ResourceSearchResult * @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.asset.v1.AnalyzeIamPolicyResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ResourceSearchResult; /** - * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnalyzeIamPolicyResponse + * @returns ResourceSearchResult * @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.asset.v1.AnalyzeIamPolicyResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ResourceSearchResult; /** - * Verifies an AnalyzeIamPolicyResponse message. + * Verifies a ResourceSearchResult 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 AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnalyzeIamPolicyResponse + * @returns ResourceSearchResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; /** - * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. - * @param message AnalyzeIamPolicyResponse + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnalyzeIamPolicyResponse to JSON. + * Converts this ResourceSearchResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AnalyzeIamPolicyResponse { - - /** Properties of an IamPolicyAnalysis. */ - interface IIamPolicyAnalysis { - - /** IamPolicyAnalysis analysisQuery */ - analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); - - /** IamPolicyAnalysis analysisResults */ - analysisResults?: (google.cloud.asset.v1.IIamPolicyAnalysisResult[]|null); - - /** IamPolicyAnalysis fullyExplored */ - fullyExplored?: (boolean|null); - - /** IamPolicyAnalysis stats */ - stats?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats[]|null); - - /** IamPolicyAnalysis nonCriticalErrors */ - nonCriticalErrors?: (google.cloud.asset.v1.IIamPolicyAnalysisState[]|null); - } - - /** Represents an IamPolicyAnalysis. */ - class IamPolicyAnalysis implements IIamPolicyAnalysis { - - /** - * Constructs a new IamPolicyAnalysis. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis); - - /** IamPolicyAnalysis analysisQuery. */ - public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); - - /** IamPolicyAnalysis analysisResults. */ - public analysisResults: google.cloud.asset.v1.IIamPolicyAnalysisResult[]; - - /** IamPolicyAnalysis fullyExplored. */ - public fullyExplored: boolean; - - /** IamPolicyAnalysis stats. */ - public stats: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats[]; - - /** IamPolicyAnalysis nonCriticalErrors. */ - public nonCriticalErrors: google.cloud.asset.v1.IIamPolicyAnalysisState[]; - - /** - * Creates a new IamPolicyAnalysis instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicyAnalysis instance - */ - public static create(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; - - /** - * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. - * @param message IamPolicyAnalysis message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. - * @param message IamPolicyAnalysis message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IamPolicyAnalysis message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysis - * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; - - /** - * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysis - * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; - - /** - * Verifies an IamPolicyAnalysis 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 IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicyAnalysis - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; - - /** - * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. - * @param message IamPolicyAnalysis - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamPolicyAnalysis to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace IamPolicyAnalysis { - - /** Properties of a Stats. */ - interface IStats { - - /** Stats nodeType */ - nodeType?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|keyof typeof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|null); - - /** Stats nodeSubtype */ - nodeSubtype?: (string|null); - - /** Stats discoveredNodeCount */ - discoveredNodeCount?: (number|null); - - /** Stats matchedNodeCount */ - matchedNodeCount?: (number|null); - - /** Stats exploredNodeCount */ - exploredNodeCount?: (number|null); - - /** Stats cappedNodeCount */ - cappedNodeCount?: (number|null); - - /** Stats permisionDeniedNodeCount */ - permisionDeniedNodeCount?: (number|null); - - /** Stats executionTimeoutNodeCount */ - executionTimeoutNodeCount?: (number|null); - } - - /** Represents a Stats. */ - class Stats implements IStats { - - /** - * Constructs a new Stats. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats); - - /** Stats nodeType. */ - public nodeType: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|keyof typeof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType); - - /** Stats nodeSubtype. */ - public nodeSubtype: string; - - /** Stats discoveredNodeCount. */ - public discoveredNodeCount: number; - - /** Stats matchedNodeCount. */ - public matchedNodeCount: number; - - /** Stats exploredNodeCount. */ - public exploredNodeCount: number; - - /** Stats cappedNodeCount. */ - public cappedNodeCount: number; - - /** Stats permisionDeniedNodeCount. */ - public permisionDeniedNodeCount: number; - - /** Stats executionTimeoutNodeCount. */ - public executionTimeoutNodeCount: number; - - /** - * Creates a new Stats instance using the specified properties. - * @param [properties] Properties to set - * @returns Stats instance - */ - public static create(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { - /** - * Decodes a Stats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Stats - * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + /** IamPolicySearchResult resource */ + resource?: (string|null); - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Stats - * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + /** IamPolicySearchResult project */ + project?: (string|null); - /** - * Verifies a Stats 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); + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Stats - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats; + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + } - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @param message Stats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { - /** - * Converts this Stats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); - namespace Stats { + /** IamPolicySearchResult resource. */ + public resource: string; - /** NodeType enum. */ - enum NodeType { - NODE_TYPE_UNSPECIFIED = 0, - BINDING = 1, - IDENTITY = 2, - RESOURCE = 3, - ACCESS = 4 - } - } - } - } - - /** Properties of an IamPolicyAnalysisOutputConfig. */ - interface IIamPolicyAnalysisOutputConfig { - - /** IamPolicyAnalysisOutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); - - /** IamPolicyAnalysisOutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); - } - - /** Represents an IamPolicyAnalysisOutputConfig. */ - class IamPolicyAnalysisOutputConfig implements IIamPolicyAnalysisOutputConfig { - - /** - * Constructs a new IamPolicyAnalysisOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig); - - /** IamPolicyAnalysisOutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); - - /** IamPolicyAnalysisOutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); - - /** IamPolicyAnalysisOutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); - - /** - * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicyAnalysisOutputConfig instance - */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; - - /** - * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. - * @param message IamPolicyAnalysisOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. - * @param message IamPolicyAnalysisOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisOutputConfig - * @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.asset.v1.IamPolicyAnalysisOutputConfig; - - /** - * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisOutputConfig - * @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.asset.v1.IamPolicyAnalysisOutputConfig; - - /** - * Verifies an IamPolicyAnalysisOutputConfig 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 IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicyAnalysisOutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; - - /** - * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisOutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamPolicyAnalysisOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace IamPolicyAnalysisOutputConfig { - - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); - } - - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { - - /** - * Constructs a new GcsDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDestination instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDestination - * @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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDestination - * @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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; - - /** - * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { - - /** BigQueryDestination dataset */ - dataset?: (string|null); - - /** BigQueryDestination tablePrefix */ - tablePrefix?: (string|null); - - /** BigQueryDestination partitionKey */ - partitionKey?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null); - - /** BigQueryDestination writeMode */ - writeMode?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|null); - } - - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { - - /** - * Constructs a new BigQueryDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; - - /** BigQueryDestination tablePrefix. */ - public tablePrefix: string; - - /** BigQueryDestination partitionKey. */ - public partitionKey: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey); - - /** BigQueryDestination writeMode. */ - public writeMode: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode); - - /** - * Creates a new BigQueryDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryDestination instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; - - /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryDestination - * @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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryDestination - * @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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; - - /** - * Verifies a BigQueryDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; - - /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BigQueryDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace BigQueryDestination { - - /** PartitionKey enum. */ - enum PartitionKey { - PARTITION_KEY_UNSPECIFIED = 0, - REQUEST_TIME = 1 - } - - /** WriteMode enum. */ - enum WriteMode { - WRITE_MODE_UNSPECIFIED = 0, - ABORT = 1, - OVERWRITE = 2 - } - } - } - - /** Properties of an ExportIamPolicyAnalysisRequest. */ - interface IExportIamPolicyAnalysisRequest { - - /** ExportIamPolicyAnalysisRequest analysisQuery */ - analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); - - /** ExportIamPolicyAnalysisRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); - } - - /** Represents an ExportIamPolicyAnalysisRequest. */ - class ExportIamPolicyAnalysisRequest implements IExportIamPolicyAnalysisRequest { - - /** - * Constructs a new ExportIamPolicyAnalysisRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest); - - /** ExportIamPolicyAnalysisRequest analysisQuery. */ - public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); - - /** ExportIamPolicyAnalysisRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); - - /** - * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportIamPolicyAnalysisRequest instance - */ - public static create(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest): google.cloud.asset.v1.ExportIamPolicyAnalysisRequest; - - /** - * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. - * @param message ExportIamPolicyAnalysisRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. - * @param message ExportIamPolicyAnalysisRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportIamPolicyAnalysisRequest - * @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.asset.v1.ExportIamPolicyAnalysisRequest; - - /** - * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportIamPolicyAnalysisRequest - * @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.asset.v1.ExportIamPolicyAnalysisRequest; - - /** - * Verifies an ExportIamPolicyAnalysisRequest 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 ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportIamPolicyAnalysisRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportIamPolicyAnalysisRequest; - - /** - * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. - * @param message ExportIamPolicyAnalysisRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.ExportIamPolicyAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportIamPolicyAnalysisRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportIamPolicyAnalysisResponse. */ - interface IExportIamPolicyAnalysisResponse { - } - - /** Represents an ExportIamPolicyAnalysisResponse. */ - class ExportIamPolicyAnalysisResponse implements IExportIamPolicyAnalysisResponse { - - /** - * Constructs a new ExportIamPolicyAnalysisResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse); - - /** - * Creates a new ExportIamPolicyAnalysisResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportIamPolicyAnalysisResponse instance - */ - public static create(properties?: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse): google.cloud.asset.v1.ExportIamPolicyAnalysisResponse; - - /** - * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. - * @param message ExportIamPolicyAnalysisResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. - * @param message ExportIamPolicyAnalysisResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportIamPolicyAnalysisResponse - * @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.asset.v1.ExportIamPolicyAnalysisResponse; - - /** - * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportIamPolicyAnalysisResponse - * @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.asset.v1.ExportIamPolicyAnalysisResponse; - - /** - * Verifies an ExportIamPolicyAnalysisResponse 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 ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportIamPolicyAnalysisResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportIamPolicyAnalysisResponse; - - /** - * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. - * @param message ExportIamPolicyAnalysisResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.ExportIamPolicyAnalysisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportIamPolicyAnalysisResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); - - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); - - /** TemporalAsset priorAssetState */ - priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); - - /** TemporalAsset priorAsset */ - priorAsset?: (google.cloud.asset.v1.IAsset|null); - } - - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { - - /** - * Constructs a new TemporalAsset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); - - /** TemporalAsset priorAssetState. */ - public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); - - /** TemporalAsset priorAsset. */ - public priorAsset?: (google.cloud.asset.v1.IAsset|null); - - /** - * Creates a new TemporalAsset instance using the specified properties. - * @param [properties] Properties to set - * @returns TemporalAsset instance - */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; - - /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TemporalAsset - * @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.asset.v1.TemporalAsset; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TemporalAsset - * @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.asset.v1.TemporalAsset; - - /** - * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TemporalAsset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; - - /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TemporalAsset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace TemporalAsset { - - /** PriorAssetState enum. */ - enum PriorAssetState { - PRIOR_ASSET_STATE_UNSPECIFIED = 0, - PRESENT = 1, - INVALID = 2, - DOES_NOT_EXIST = 3, - DELETED = 4 - } - } - - /** 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.asset.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.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; - - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Asset. */ - interface IAsset { - - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); - - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - - /** Asset ancestors */ - ancestors?: (string[]|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { - - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAsset); - - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Asset name. */ - public name: string; - - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset orgPolicy. */ - public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; - - /** Asset accessPolicy. */ - public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - - /** Asset accessLevel. */ - public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - - /** Asset servicePerimeter. */ - public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - - /** Asset ancestors. */ - public ancestors: string[]; - - /** Asset accessContextPolicy. */ - public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); - - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @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.asset.v1.Asset; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @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.asset.v1.Asset; - - /** - * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Asset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); - - /** Resource discoveryName */ - discoveryName?: (string|null); - - /** Resource resourceUrl */ - resourceUrl?: (string|null); - - /** Resource parent */ - parent?: (string|null); - - /** Resource data */ - data?: (google.protobuf.IStruct|null); - - /** Resource location */ - location?: (string|null); - } - - /** Represents a Resource. */ - class Resource implements IResource { - - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; - - /** Resource discoveryName. */ - public discoveryName: string; - - /** Resource resourceUrl. */ - public resourceUrl: string; - - /** Resource parent. */ - public parent: string; - - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); - - /** Resource location. */ - public location: string; - - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Resource - * @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.asset.v1.Resource; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Resource - * @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.asset.v1.Resource; - - /** - * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Resource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResourceSearchResult. */ - interface IResourceSearchResult { - - /** ResourceSearchResult name */ - name?: (string|null); - - /** ResourceSearchResult assetType */ - assetType?: (string|null); - - /** ResourceSearchResult project */ - project?: (string|null); - - /** ResourceSearchResult displayName */ - displayName?: (string|null); - - /** ResourceSearchResult description */ - description?: (string|null); - - /** ResourceSearchResult location */ - location?: (string|null); - - /** ResourceSearchResult labels */ - labels?: ({ [k: string]: string }|null); - - /** ResourceSearchResult networkTags */ - networkTags?: (string[]|null); - - /** ResourceSearchResult additionalAttributes */ - additionalAttributes?: (google.protobuf.IStruct|null); - } - - /** Represents a ResourceSearchResult. */ - class ResourceSearchResult implements IResourceSearchResult { - - /** - * Constructs a new ResourceSearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); - - /** ResourceSearchResult name. */ - public name: string; - - /** ResourceSearchResult assetType. */ - public assetType: string; - - /** ResourceSearchResult project. */ - public project: string; - - /** ResourceSearchResult displayName. */ - public displayName: string; - - /** ResourceSearchResult description. */ - public description: string; - - /** ResourceSearchResult location. */ - public location: string; - - /** ResourceSearchResult labels. */ - public labels: { [k: string]: string }; - - /** ResourceSearchResult networkTags. */ - public networkTags: string[]; - - /** ResourceSearchResult additionalAttributes. */ - public additionalAttributes?: (google.protobuf.IStruct|null); - - /** - * Creates a new ResourceSearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceSearchResult instance - */ - public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; - - /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceSearchResult - * @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.asset.v1.ResourceSearchResult; - - /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceSearchResult - * @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.asset.v1.ResourceSearchResult; - - /** - * Verifies a ResourceSearchResult 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceSearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; - - /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @param message ResourceSearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceSearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IamPolicySearchResult. */ - interface IIamPolicySearchResult { - - /** IamPolicySearchResult resource */ - resource?: (string|null); - - /** IamPolicySearchResult project */ - project?: (string|null); - - /** IamPolicySearchResult policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** IamPolicySearchResult explanation */ - explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); - } - - /** Represents an IamPolicySearchResult. */ - class IamPolicySearchResult implements IIamPolicySearchResult { - - /** - * Constructs a new IamPolicySearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); - - /** IamPolicySearchResult resource. */ - public resource: string; - - /** IamPolicySearchResult project. */ - public project: string; - - /** IamPolicySearchResult policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** IamPolicySearchResult explanation. */ - public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); - - /** - * Creates a new IamPolicySearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicySearchResult instance - */ - public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; - - /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicySearchResult - * @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.asset.v1.IamPolicySearchResult; - - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicySearchResult - * @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.asset.v1.IamPolicySearchResult; - - /** - * Verifies an IamPolicySearchResult 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicySearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; - - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @param message IamPolicySearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamPolicySearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace IamPolicySearchResult { - - /** Properties of an Explanation. */ - interface IExplanation { - - /** Explanation matchedPermissions */ - matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); - } - - /** Represents an Explanation. */ - class Explanation implements IExplanation { - - /** - * Constructs a new Explanation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); - - /** Explanation matchedPermissions. */ - public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; - - /** - * Creates a new Explanation instance using the specified properties. - * @param [properties] Properties to set - * @returns Explanation instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; - - /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Explanation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Explanation - * @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.asset.v1.IamPolicySearchResult.Explanation; - - /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Explanation - * @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.asset.v1.IamPolicySearchResult.Explanation; - - /** - * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Explanation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; - - /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. - * @param message Explanation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Explanation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Explanation { - - /** Properties of a Permissions. */ - interface IPermissions { - - /** Permissions permissions */ - permissions?: (string[]|null); - } - - /** Represents a Permissions. */ - class Permissions implements IPermissions { - - /** - * Constructs a new Permissions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); - - /** Permissions permissions. */ - public permissions: string[]; - - /** - * Creates a new Permissions instance using the specified properties. - * @param [properties] Properties to set - * @returns Permissions instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Permissions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Permissions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @param message Permissions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Permissions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Properties of an IamPolicyAnalysisState. */ - interface IIamPolicyAnalysisState { - - /** IamPolicyAnalysisState code */ - code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); - - /** IamPolicyAnalysisState cause */ - cause?: (string|null); - } - - /** Represents an IamPolicyAnalysisState. */ - class IamPolicyAnalysisState implements IIamPolicyAnalysisState { - - /** - * Constructs a new IamPolicyAnalysisState. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); - - /** IamPolicyAnalysisState code. */ - public code: (google.rpc.Code|keyof typeof google.rpc.Code); - - /** IamPolicyAnalysisState cause. */ - public cause: string; - - /** - * Creates a new IamPolicyAnalysisState instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicyAnalysisState instance - */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; - - /** - * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @param message IamPolicyAnalysisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @param message IamPolicyAnalysisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisState - * @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.asset.v1.IamPolicyAnalysisState; - - /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisState - * @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.asset.v1.IamPolicyAnalysisState; - - /** - * Verifies an IamPolicyAnalysisState 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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicyAnalysisState - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; - - /** - * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamPolicyAnalysisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IamPolicyAnalysisResult. */ - interface IIamPolicyAnalysisResult { - - /** IamPolicyAnalysisResult attachedResourceFullName */ - attachedResourceFullName?: (string|null); - - /** IamPolicyAnalysisResult iamBinding */ - iamBinding?: (google.iam.v1.IBinding|null); - - /** IamPolicyAnalysisResult accessControlLists */ - accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); - - /** IamPolicyAnalysisResult identityList */ - identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); - - /** IamPolicyAnalysisResult fullyExplored */ - fullyExplored?: (boolean|null); - } - - /** Represents an IamPolicyAnalysisResult. */ - class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { - - /** - * Constructs a new IamPolicyAnalysisResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); - - /** IamPolicyAnalysisResult attachedResourceFullName. */ - public attachedResourceFullName: string; - - /** IamPolicyAnalysisResult iamBinding. */ - public iamBinding?: (google.iam.v1.IBinding|null); - - /** IamPolicyAnalysisResult accessControlLists. */ - public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; - - /** IamPolicyAnalysisResult identityList. */ - public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); - - /** IamPolicyAnalysisResult fullyExplored. */ - public fullyExplored: boolean; - - /** - * Creates a new IamPolicyAnalysisResult instance using the specified properties. - * @param [properties] Properties to set - * @returns IamPolicyAnalysisResult instance - */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; - - /** - * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @param message IamPolicyAnalysisResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @param message IamPolicyAnalysisResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisResult - * @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.asset.v1.IamPolicyAnalysisResult; - - /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisResult - * @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.asset.v1.IamPolicyAnalysisResult; - - /** - * Verifies an IamPolicyAnalysisResult 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicyAnalysisResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; - - /** - * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IamPolicyAnalysisResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace IamPolicyAnalysisResult { - - /** Properties of a Resource. */ - interface IResource { - - /** Resource fullResourceName */ - fullResourceName?: (string|null); - - /** Resource analysisState */ - analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - } - - /** Represents a Resource. */ - class Resource implements IResource { - - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); - - /** Resource fullResourceName. */ - public fullResourceName: string; - - /** Resource analysisState. */ - public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Resource - * @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.asset.v1.IamPolicyAnalysisResult.Resource; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Resource - * @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.asset.v1.IamPolicyAnalysisResult.Resource; - - /** - * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Resource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Access. */ - interface IAccess { - - /** Access role */ - role?: (string|null); - - /** Access permission */ - permission?: (string|null); - - /** Access analysisState */ - analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - } - - /** Represents an Access. */ - class Access implements IAccess { - - /** - * Constructs a new Access. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess); - - /** Access role. */ - public role: string; - - /** Access permission. */ - public permission: string; - - /** Access analysisState. */ - public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - - /** Access oneofAccess. */ - public oneofAccess?: ("role"|"permission"); - - /** - * Creates a new Access instance using the specified properties. - * @param [properties] Properties to set - * @returns Access instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; - - /** - * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. - * @param message Access message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. - * @param message Access message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Access message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Access - * @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.asset.v1.IamPolicyAnalysisResult.Access; - - /** - * Decodes an Access message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Access - * @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.asset.v1.IamPolicyAnalysisResult.Access; - - /** - * Verifies an Access 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 Access message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Access - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; - - /** - * Creates a plain object from an Access message. Also converts values to other types if specified. - * @param message Access - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Access to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Identity. */ - interface IIdentity { - - /** Identity name */ - name?: (string|null); - - /** Identity analysisState */ - analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - } - - /** Represents an Identity. */ - class Identity implements IIdentity { - - /** - * Constructs a new Identity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity); - - /** Identity name. */ - public name: string; - - /** Identity analysisState. */ - public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - - /** - * Creates a new Identity instance using the specified properties. - * @param [properties] Properties to set - * @returns Identity instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; - - /** - * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. - * @param message Identity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. - * @param message Identity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Identity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Identity - * @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.asset.v1.IamPolicyAnalysisResult.Identity; - - /** - * Decodes an Identity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Identity - * @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.asset.v1.IamPolicyAnalysisResult.Identity; - - /** - * Verifies an Identity 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 Identity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Identity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; - - /** - * Creates a plain object from an Identity message. Also converts values to other types if specified. - * @param message Identity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Identity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Edge. */ - interface IEdge { - - /** Edge sourceNode */ - sourceNode?: (string|null); - - /** Edge targetNode */ - targetNode?: (string|null); - } - - /** Represents an Edge. */ - class Edge implements IEdge { - - /** - * Constructs a new Edge. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge); - - /** Edge sourceNode. */ - public sourceNode: string; - - /** Edge targetNode. */ - public targetNode: string; - - /** - * Creates a new Edge instance using the specified properties. - * @param [properties] Properties to set - * @returns Edge instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; + /** IamPolicySearchResult project. */ + public project: string; - /** - * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. - * @param message Edge message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); - /** - * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. - * @param message Edge message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); - /** - * Decodes an Edge message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Edge - * @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.asset.v1.IamPolicyAnalysisResult.Edge; + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; - /** - * Decodes an Edge message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Edge - * @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.asset.v1.IamPolicyAnalysisResult.Edge; + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an Edge 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); + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an Edge message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Edge - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; - /** - * Creates a plain object from an Edge message. Also converts values to other types if specified. - * @param message Edge - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Edge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; - /** - * Converts this Edge to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies an IamPolicySearchResult 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); - /** Properties of an AccessControlList. */ - interface IAccessControlList { + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; - /** AccessControlList resources */ - resources?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]|null); + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AccessControlList accesses */ - accesses?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]|null); + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** AccessControlList resourceEdges */ - resourceEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); } - /** Represents an AccessControlList. */ - class AccessControlList implements IAccessControlList { + /** Represents an Explanation. */ + class Explanation implements IExplanation { /** - * Constructs a new AccessControlList. + * Constructs a new Explanation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList); - - /** AccessControlList resources. */ - public resources: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]; - - /** AccessControlList accesses. */ - public accesses: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]; + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); - /** AccessControlList resourceEdges. */ - public resourceEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; /** - * Creates a new AccessControlList instance using the specified properties. + * Creates a new Explanation instance using the specified properties. * @param [properties] Properties to set - * @returns AccessControlList instance + * @returns Explanation instance */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; /** - * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. - * @param message AccessControlList message or plain object to encode + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. - * @param message AccessControlList message or plain object to encode + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AccessControlList message from the specified reader or buffer. + * Decodes an Explanation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AccessControlList + * @returns Explanation * @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.asset.v1.IamPolicyAnalysisResult.AccessControlList; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult.Explanation; /** - * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * Decodes an Explanation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AccessControlList + * @returns Explanation * @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.asset.v1.IamPolicyAnalysisResult.AccessControlList; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult.Explanation; /** - * Verifies an AccessControlList message. + * Verifies an Explanation 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 AccessControlList message from a plain object. Also converts values to their respective internal types. + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AccessControlList + * @returns Explanation */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; /** - * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. - * @param message AccessControlList + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AccessControlList to JSON. + * Converts this Explanation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an IdentityList. */ - interface IIdentityList { - - /** IdentityList identities */ - identities?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]|null); + namespace Explanation { - /** IdentityList groupEdges */ - groupEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); - } + /** Properties of a Permissions. */ + interface IPermissions { - /** Represents an IdentityList. */ - class IdentityList implements IIdentityList { + /** Permissions permissions */ + permissions?: (string[]|null); + } - /** - * Constructs a new IdentityList. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList); + /** Represents a Permissions. */ + class Permissions implements IPermissions { - /** IdentityList identities. */ - public identities: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]; + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); - /** IdentityList groupEdges. */ - public groupEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; + /** Permissions permissions. */ + public permissions: string[]; - /** - * Creates a new IdentityList instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentityList instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - /** - * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. - * @param message IdentityList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. - * @param message IdentityList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an IdentityList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentityList - * @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.asset.v1.IamPolicyAnalysisResult.IdentityList; + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; - /** - * Decodes an IdentityList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentityList - * @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.asset.v1.IamPolicyAnalysisResult.IdentityList; + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; - /** - * Verifies an IdentityList 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); + /** + * Verifies a Permissions 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 IdentityList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentityList - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - /** - * Creates a plain object from an IdentityList message. Also converts values to other types if specified. - * @param message IdentityList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this IdentityList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } @@ -16390,6 +14061,102 @@ export namespace google { 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 Struct. */ interface IStruct { @@ -16698,102 +14465,6 @@ export namespace google { 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 { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 5f099ebe4be..75251f38f6e 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -395,72 +395,6 @@ * @variation 2 */ - /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef AnalyzeIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} [response] AnalyzeIamPolicyResponse - */ - - /** - * Calls AnalyzeIamPolicy. - * @function analyzeIamPolicy - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback} callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.analyzeIamPolicy = function analyzeIamPolicy(request, callback) { - return this.rpcCall(analyzeIamPolicy, $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest, $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse, request, callback); - }, "name", { value: "AnalyzeIamPolicy" }); - - /** - * Calls AnalyzeIamPolicy. - * @function analyzeIamPolicy - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportIamPolicyAnalysis}. - * @memberof google.cloud.asset.v1.AssetService - * @typedef ExportIamPolicyAnalysisCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportIamPolicyAnalysis. - * @function exportIamPolicyAnalysis - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object - * @param {google.cloud.asset.v1.AssetService.ExportIamPolicyAnalysisCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.exportIamPolicyAnalysis = function exportIamPolicyAnalysis(request, callback) { - return this.rpcCall(exportIamPolicyAnalysis, $root.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportIamPolicyAnalysis" }); - - /** - * Calls ExportIamPolicyAnalysis. - * @function exportIamPolicyAnalysis - * @memberof google.cloud.asset.v1.AssetService - * @instance - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return AssetService; })(); @@ -5703,28 +5637,48 @@ return SearchAllIamPoliciesResponse; })(); - v1.IamPolicyAnalysisQuery = (function() { + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.TemporalAsset = (function() { /** - * Properties of an IamPolicyAnalysisQuery. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1 - * @interface IIamPolicyAnalysisQuery - * @property {string|null} [scope] IamPolicyAnalysisQuery scope - * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null} [resourceSelector] IamPolicyAnalysisQuery resourceSelector - * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector - * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector - * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null} [options] IamPolicyAnalysisQuery options + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState + * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset */ /** - * Constructs a new IamPolicyAnalysisQuery. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicyAnalysisQuery. - * @implements IIamPolicyAnalysisQuery + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set */ - function IamPolicyAnalysisQuery(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5732,127 +5686,127 @@ } /** - * IamPolicyAnalysisQuery scope. - * @member {string} scope - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - IamPolicyAnalysisQuery.prototype.scope = ""; + TemporalAsset.prototype.window = null; /** - * IamPolicyAnalysisQuery resourceSelector. - * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null|undefined} resourceSelector - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - IamPolicyAnalysisQuery.prototype.resourceSelector = null; + TemporalAsset.prototype.deleted = false; /** - * IamPolicyAnalysisQuery identitySelector. - * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null|undefined} identitySelector - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - IamPolicyAnalysisQuery.prototype.identitySelector = null; + TemporalAsset.prototype.asset = null; /** - * IamPolicyAnalysisQuery accessSelector. - * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null|undefined} accessSelector - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * TemporalAsset priorAssetState. + * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - IamPolicyAnalysisQuery.prototype.accessSelector = null; + TemporalAsset.prototype.priorAssetState = 0; /** - * IamPolicyAnalysisQuery options. - * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null|undefined} options - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * TemporalAsset priorAsset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset + * @memberof google.cloud.asset.v1.TemporalAsset * @instance */ - IamPolicyAnalysisQuery.prototype.options = null; + TemporalAsset.prototype.priorAsset = null; /** - * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery instance + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance */ - IamPolicyAnalysisQuery.create = function create(properties) { - return new IamPolicyAnalysisQuery(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicyAnalysisQuery.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identitySelector != null && Object.hasOwnProperty.call(message, "identitySelector")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.accessSelector != null && Object.hasOwnProperty.call(message, "accessSelector")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.encode(message.options, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); + if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) + $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicyAnalysisQuery.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicyAnalysisQuery.decode = function decode(reader, length) { + TemporalAsset.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.asset.v1.IamPolicyAnalysisQuery(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.scope = reader.string(); + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); break; case 2: - message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); + message.deleted = reader.bool(); break; case 3: - message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); break; case 4: - message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); + message.priorAssetState = reader.int32(); break; case 5: - message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); + message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5863,1341 +5817,918 @@ }; /** - * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicyAnalysisQuery.decodeDelimited = function decodeDelimited(reader) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IamPolicyAnalysisQuery message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IamPolicyAnalysisQuery.verify = function verify(message) { + TemporalAsset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify(message.resourceSelector); - if (error) - return "resourceSelector." + error; - } - if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify(message.identitySelector); + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); if (error) - return "identitySelector." + error; + return "window." + error; } - if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify(message.accessSelector); + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); if (error) - return "accessSelector." + error; + return "asset." + error; } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify(message.options); + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + switch (message.priorAssetState) { + default: + return "priorAssetState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); if (error) - return "options." + error; + return "priorAsset." + error; } return null; }; /** - * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset */ - IamPolicyAnalysisQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.resourceSelector != null) { - if (typeof object.resourceSelector !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.resourceSelector: object expected"); - message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.fromObject(object.resourceSelector); + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); } - if (object.identitySelector != null) { - if (typeof object.identitySelector !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.identitySelector: object expected"); - message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.fromObject(object.identitySelector); + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); } - if (object.accessSelector != null) { - if (typeof object.accessSelector !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.accessSelector: object expected"); - message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.fromObject(object.accessSelector); + switch (object.priorAssetState) { + case "PRIOR_ASSET_STATE_UNSPECIFIED": + case 0: + message.priorAssetState = 0; + break; + case "PRESENT": + case 1: + message.priorAssetState = 1; + break; + case "INVALID": + case 2: + message.priorAssetState = 2; + break; + case "DOES_NOT_EXIST": + case 3: + message.priorAssetState = 3; + break; + case "DELETED": + case 4: + message.priorAssetState = 4; + break; } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.options: object expected"); - message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.fromObject(object.options); + if (object.priorAsset != null) { + if (typeof object.priorAsset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); + message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); } return message; }; /** - * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} message IamPolicyAnalysisQuery + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IamPolicyAnalysisQuery.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.scope = ""; - object.resourceSelector = null; - object.identitySelector = null; - object.accessSelector = null; - object.options = null; + object.window = null; + object.deleted = false; + object.asset = null; + object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; + object.priorAsset = null; } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) - object.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.toObject(message.resourceSelector, options); - if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) - object.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.toObject(message.identitySelector, options); - if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) - object.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.toObject(message.options, options); + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) + object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); return object; }; /** - * Converts this IamPolicyAnalysisQuery to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.TemporalAsset * @instance * @returns {Object.} JSON object */ - IamPolicyAnalysisQuery.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - IamPolicyAnalysisQuery.ResourceSelector = (function() { + /** + * PriorAssetState enum. + * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState + * @enum {number} + * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} INVALID=2 INVALID value + * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value + * @property {number} DELETED=4 DELETED value + */ + TemporalAsset.PriorAssetState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "DOES_NOT_EXIST"] = 3; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); - /** - * Properties of a ResourceSelector. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @interface IResourceSelector - * @property {string|null} [fullResourceName] ResourceSelector fullResourceName - */ + return TemporalAsset; + })(); - /** - * Constructs a new ResourceSelector. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @classdesc Represents a ResourceSelector. - * @implements IResourceSelector - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set - */ - function ResourceSelector(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]]; - } + v1.TimeWindow = (function() { - /** - * ResourceSelector fullResourceName. - * @member {string} fullResourceName - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @instance - */ - ResourceSelector.prototype.fullResourceName = ""; + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.v1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + */ - /** - * Creates a new ResourceSelector instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector instance - */ - ResourceSelector.create = function create(properties) { - return new ResourceSelector(properties); - }; + /** + * Constructs a new TimeWindow. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.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]]; + } - /** - * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); - return writer; - }; + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; - /** - * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; - /** - * Decodes a ResourceSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSelector.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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; - /** - * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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; + }; - /** - * Verifies a ResourceSelector message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) - if (!$util.isString(message.fullResourceName)) - return "fullResourceName: string expected"; - return null; - }; + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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(); + }; - /** - * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector - */ - ResourceSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector(); - if (object.fullResourceName != null) - message.fullResourceName = String(object.fullResourceName); - return message; - }; - - /** - * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} message ResourceSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fullResourceName = ""; - if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) - object.fullResourceName = message.fullResourceName; - return object; - }; - - /** - * Converts this ResourceSelector to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector - * @instance - * @returns {Object.} JSON object - */ - ResourceSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResourceSelector; - })(); + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.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.asset.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.asset.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; + }; - IamPolicyAnalysisQuery.IdentitySelector = (function() { + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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()); + }; - /** - * Properties of an IdentitySelector. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @interface IIdentitySelector - * @property {string|null} [identity] IdentitySelector identity - */ + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.cloud.asset.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; + }; - /** - * Constructs a new IdentitySelector. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @classdesc Represents an IdentitySelector. - * @implements IIdentitySelector - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set - */ - function IdentitySelector(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 TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } + return message; + }; - /** - * IdentitySelector identity. - * @member {string} identity - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @instance - */ - IdentitySelector.prototype.identity = ""; + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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; + }; - /** - * Creates a new IdentitySelector instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector instance - */ - IdentitySelector.create = function create(properties) { - return new IdentitySelector(properties); - }; + /** + * Converts this TimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitySelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity); - return writer; - }; + return TimeWindow; + })(); - /** - * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitySelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v1.Asset = (function() { - /** - * Decodes an IdentitySelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitySelector.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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identity = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [ancestors] Asset ancestors + */ - /** - * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitySelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + 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]]; + } - /** - * Verifies an IdentitySelector message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentitySelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identity != null && message.hasOwnProperty("identity")) - if (!$util.isString(message.identity)) - return "identity: string expected"; - return null; - }; + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; - /** - * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector - */ - IdentitySelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector(); - if (object.identity != null) - message.identity = String(object.identity); - return message; - }; + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; - /** - * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} message IdentitySelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentitySelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.identity = ""; - if (message.identity != null && message.hasOwnProperty("identity")) - object.identity = message.identity; - return object; - }; + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; - /** - * Converts this IdentitySelector to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector - * @instance - * @returns {Object.} JSON object - */ - IdentitySelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; - return IdentitySelector; - })(); + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; - IamPolicyAnalysisQuery.AccessSelector = (function() { + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; - /** - * Properties of an AccessSelector. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @interface IAccessSelector - * @property {Array.|null} [roles] AccessSelector roles - * @property {Array.|null} [permissions] AccessSelector permissions - */ + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; - /** - * Constructs a new AccessSelector. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @classdesc Represents an AccessSelector. - * @implements IAccessSelector - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set - */ - function AccessSelector(properties) { - this.roles = []; - this.permissions = []; - 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]]; - } + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; - /** - * AccessSelector roles. - * @member {Array.} roles - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @instance - */ - AccessSelector.prototype.roles = $util.emptyArray; + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; - /** - * AccessSelector permissions. - * @member {Array.} permissions - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @instance - */ - AccessSelector.prototype.permissions = $util.emptyArray; + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; - /** - * Creates a new AccessSelector instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector instance - */ - AccessSelector.create = function create(properties) { - return new AccessSelector(properties); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.roles != null && message.roles.length) - for (var i = 0; i < message.roles.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.roles[i]); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessSelector.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.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.roles && message.roles.length)) - message.roles = []; - message.roles.push(reader.string()); - break; - case 2: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessSelector message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.roles != null && message.hasOwnProperty("roles")) { - if (!Array.isArray(message.roles)) - return "roles: array expected"; - for (var i = 0; i < message.roles.length; ++i) - if (!$util.isString(message.roles[i])) - return "roles: string[] expected"; - } - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector - */ - AccessSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); - if (object.roles) { - if (!Array.isArray(object.roles)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.roles: array expected"); - message.roles = []; - for (var i = 0; i < object.roles.length; ++i) - message.roles[i] = String(object.roles[i]); - } - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} message AccessSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.roles = []; - object.permissions = []; - } - if (message.roles && message.roles.length) { - object.roles = []; - for (var j = 0; j < message.roles.length; ++j) - object.roles[j] = message.roles[j]; - } - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this AccessSelector to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector - * @instance - * @returns {Object.} JSON object - */ - AccessSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AccessSelector; - })(); - - IamPolicyAnalysisQuery.Options = (function() { - - /** - * Properties of an Options. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @interface IOptions - * @property {boolean|null} [expandGroups] Options expandGroups - * @property {boolean|null} [expandRoles] Options expandRoles - * @property {boolean|null} [expandResources] Options expandResources - * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges - * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges - * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation - * @property {number|null} [maxFanoutsPerGroup] Options maxFanoutsPerGroup - * @property {number|null} [maxFanoutsPerResource] Options maxFanoutsPerResource - */ - - /** - * Constructs a new Options. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery - * @classdesc Represents an Options. - * @implements IOptions - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set - */ - function Options(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]]; - } - - /** - * Options expandGroups. - * @member {boolean} expandGroups - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.expandGroups = false; - - /** - * Options expandRoles. - * @member {boolean} expandRoles - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.expandRoles = false; - - /** - * Options expandResources. - * @member {boolean} expandResources - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.expandResources = false; - - /** - * Options outputResourceEdges. - * @member {boolean} outputResourceEdges - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.outputResourceEdges = false; - - /** - * Options outputGroupEdges. - * @member {boolean} outputGroupEdges - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.outputGroupEdges = false; - - /** - * Options analyzeServiceAccountImpersonation. - * @member {boolean} analyzeServiceAccountImpersonation - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.analyzeServiceAccountImpersonation = false; - - /** - * Options maxFanoutsPerGroup. - * @member {number} maxFanoutsPerGroup - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.maxFanoutsPerGroup = 0; - - /** - * Options maxFanoutsPerResource. - * @member {number} maxFanoutsPerResource - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - */ - Options.prototype.maxFanoutsPerResource = 0; - - /** - * Creates a new Options instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options instance - */ - Options.create = function create(properties) { - return new Options(properties); - }; - - /** - * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions} message Options message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Options.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expandGroups != null && Object.hasOwnProperty.call(message, "expandGroups")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); - if (message.expandRoles != null && Object.hasOwnProperty.call(message, "expandRoles")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); - if (message.expandResources != null && Object.hasOwnProperty.call(message, "expandResources")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); - if (message.outputResourceEdges != null && Object.hasOwnProperty.call(message, "outputResourceEdges")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); - if (message.outputGroupEdges != null && Object.hasOwnProperty.call(message, "outputGroupEdges")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); - if (message.analyzeServiceAccountImpersonation != null && Object.hasOwnProperty.call(message, "analyzeServiceAccountImpersonation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); - if (message.maxFanoutsPerGroup != null && Object.hasOwnProperty.call(message, "maxFanoutsPerGroup")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.maxFanoutsPerGroup); - if (message.maxFanoutsPerResource != null && Object.hasOwnProperty.call(message, "maxFanoutsPerResource")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.maxFanoutsPerResource); - return writer; - }; - - /** - * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions} message Options message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Options.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Options message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Options.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.asset.v1.IamPolicyAnalysisQuery.Options(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expandGroups = reader.bool(); - break; - case 2: - message.expandRoles = reader.bool(); - break; - case 3: - message.expandResources = reader.bool(); - break; - case 4: - message.outputResourceEdges = reader.bool(); - break; - case 5: - message.outputGroupEdges = reader.bool(); - break; - case 6: - message.analyzeServiceAccountImpersonation = reader.bool(); - break; - case 7: - message.maxFanoutsPerGroup = reader.int32(); - break; - case 8: - message.maxFanoutsPerResource = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Options message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Options.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Options message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Options.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) - if (typeof message.expandGroups !== "boolean") - return "expandGroups: boolean expected"; - if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) - if (typeof message.expandRoles !== "boolean") - return "expandRoles: boolean expected"; - if (message.expandResources != null && message.hasOwnProperty("expandResources")) - if (typeof message.expandResources !== "boolean") - return "expandResources: boolean expected"; - if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) - if (typeof message.outputResourceEdges !== "boolean") - return "outputResourceEdges: boolean expected"; - if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) - if (typeof message.outputGroupEdges !== "boolean") - return "outputGroupEdges: boolean expected"; - if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) - if (typeof message.analyzeServiceAccountImpersonation !== "boolean") - return "analyzeServiceAccountImpersonation: boolean expected"; - if (message.maxFanoutsPerGroup != null && message.hasOwnProperty("maxFanoutsPerGroup")) - if (!$util.isInteger(message.maxFanoutsPerGroup)) - return "maxFanoutsPerGroup: integer expected"; - if (message.maxFanoutsPerResource != null && message.hasOwnProperty("maxFanoutsPerResource")) - if (!$util.isInteger(message.maxFanoutsPerResource)) - return "maxFanoutsPerResource: integer expected"; - return null; - }; - - /** - * Creates an Options message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options - */ - Options.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options(); - if (object.expandGroups != null) - message.expandGroups = Boolean(object.expandGroups); - if (object.expandRoles != null) - message.expandRoles = Boolean(object.expandRoles); - if (object.expandResources != null) - message.expandResources = Boolean(object.expandResources); - if (object.outputResourceEdges != null) - message.outputResourceEdges = Boolean(object.outputResourceEdges); - if (object.outputGroupEdges != null) - message.outputGroupEdges = Boolean(object.outputGroupEdges); - if (object.analyzeServiceAccountImpersonation != null) - message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); - if (object.maxFanoutsPerGroup != null) - message.maxFanoutsPerGroup = object.maxFanoutsPerGroup | 0; - if (object.maxFanoutsPerResource != null) - message.maxFanoutsPerResource = object.maxFanoutsPerResource | 0; - return message; - }; - - /** - * Creates a plain object from an Options message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} message Options - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Options.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expandGroups = false; - object.expandRoles = false; - object.expandResources = false; - object.outputResourceEdges = false; - object.outputGroupEdges = false; - object.analyzeServiceAccountImpersonation = false; - object.maxFanoutsPerGroup = 0; - object.maxFanoutsPerResource = 0; - } - if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) - object.expandGroups = message.expandGroups; - if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) - object.expandRoles = message.expandRoles; - if (message.expandResources != null && message.hasOwnProperty("expandResources")) - object.expandResources = message.expandResources; - if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) - object.outputResourceEdges = message.outputResourceEdges; - if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) - object.outputGroupEdges = message.outputGroupEdges; - if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) - object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; - if (message.maxFanoutsPerGroup != null && message.hasOwnProperty("maxFanoutsPerGroup")) - object.maxFanoutsPerGroup = message.maxFanoutsPerGroup; - if (message.maxFanoutsPerResource != null && message.hasOwnProperty("maxFanoutsPerResource")) - object.maxFanoutsPerResource = message.maxFanoutsPerResource; - return object; - }; - - /** - * Converts this Options to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options - * @instance - * @returns {Object.} JSON object - */ - Options.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Options; - })(); - - return IamPolicyAnalysisQuery; - })(); - - v1.AnalyzeIamPolicyRequest = (function() { - - /** - * Properties of an AnalyzeIamPolicyRequest. - * @memberof google.cloud.asset.v1 - * @interface IAnalyzeIamPolicyRequest - * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery - * @property {google.protobuf.IDuration|null} [executionTimeout] AnalyzeIamPolicyRequest executionTimeout - */ - - /** - * Constructs a new AnalyzeIamPolicyRequest. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an AnalyzeIamPolicyRequest. - * @implements IAnalyzeIamPolicyRequest - * @constructor - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set - */ - function AnalyzeIamPolicyRequest(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]]; - } - - /** - * AnalyzeIamPolicyRequest analysisQuery. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest - * @instance - */ - AnalyzeIamPolicyRequest.prototype.analysisQuery = null; - - /** - * AnalyzeIamPolicyRequest executionTimeout. - * @member {google.protobuf.IDuration|null|undefined} executionTimeout - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest - * @instance - */ - AnalyzeIamPolicyRequest.prototype.executionTimeout = null; - - /** - * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest - * @static - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest instance - */ - AnalyzeIamPolicyRequest.create = function create(properties) { - return new AnalyzeIamPolicyRequest(properties); - }; + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; /** - * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeIamPolicyRequest.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) - $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @returns {google.cloud.asset.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeIamPolicyRequest.decode = function decode(reader, length) { + Asset.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.asset.v1.AnalyzeIamPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 1: - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.assetType = reader.string(); break; - default: - reader.skipType(tag & 7); + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); break; - } - } - return message; - }; - - /** - * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + case 7: + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + case 8: + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + case 9: + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeIamPolicyRequest message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeIamPolicyRequest.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + var properties = {}; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) - return "analysisQuery." + error; + return "updateTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; } - if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); if (error) - return "executionTimeout." + error; + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; } return null; }; /** - * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @returns {google.cloud.asset.v1.Asset} Asset */ - AnalyzeIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) return object; - var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest(); - if (object.analysisQuery != null) { - if (typeof object.analysisQuery !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); } - if (object.executionTimeout != null) { - if (typeof object.executionTimeout !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.executionTimeout: object expected"); - message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); } return message; }; /** - * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest + * @param {google.cloud.asset.v1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeIamPolicyRequest.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } if (options.defaults) { - object.analysisQuery = null; - object.executionTimeout = null; + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + object.updateTime = null; } - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) - object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); - if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) - object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this AnalyzeIamPolicyRequest to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @memberof google.cloud.asset.v1.Asset * @instance * @returns {Object.} JSON object */ - AnalyzeIamPolicyRequest.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AnalyzeIamPolicyRequest; + return Asset; })(); - v1.AnalyzeIamPolicyResponse = (function() { + v1.Resource = (function() { /** - * Properties of an AnalyzeIamPolicyResponse. + * Properties of a Resource. * @memberof google.cloud.asset.v1 - * @interface IAnalyzeIamPolicyResponse - * @property {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null} [mainAnalysis] AnalyzeIamPolicyResponse mainAnalysis - * @property {Array.|null} [serviceAccountImpersonationAnalysis] AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis - * @property {boolean|null} [fullyExplored] AnalyzeIamPolicyResponse fullyExplored + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {string|null} [location] Resource location */ /** - * Constructs a new AnalyzeIamPolicyResponse. + * Constructs a new Resource. * @memberof google.cloud.asset.v1 - * @classdesc Represents an AnalyzeIamPolicyResponse. - * @implements IAnalyzeIamPolicyResponse + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set */ - function AnalyzeIamPolicyResponse(properties) { - this.serviceAccountImpersonationAnalysis = []; + function Resource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7205,104 +6736,153 @@ } /** - * AnalyzeIamPolicyResponse mainAnalysis. - * @member {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null|undefined} mainAnalysis - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource * @instance */ - AnalyzeIamPolicyResponse.prototype.mainAnalysis = null; + Resource.prototype.version = ""; /** - * AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. - * @member {Array.} serviceAccountImpersonationAnalysis - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource * @instance */ - AnalyzeIamPolicyResponse.prototype.serviceAccountImpersonationAnalysis = $util.emptyArray; + Resource.prototype.discoveryDocumentUri = ""; /** - * AnalyzeIamPolicyResponse fullyExplored. - * @member {boolean} fullyExplored - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource * @instance */ - AnalyzeIamPolicyResponse.prototype.fullyExplored = false; + Resource.prototype.discoveryName = ""; /** - * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse instance + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance */ - AnalyzeIamPolicyResponse.create = function create(properties) { - return new AnalyzeIamPolicyResponse(properties); + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeIamPolicyResponse.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mainAnalysis != null && Object.hasOwnProperty.call(message, "mainAnalysis")) - $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.mainAnalysis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.serviceAccountImpersonationAnalysis != null && message.serviceAccountImpersonationAnalysis.length) - for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) - $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); return writer; }; /** - * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @returns {google.cloud.asset.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeIamPolicyResponse.decode = function decode(reader, length) { + Resource.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.asset.v1.AnalyzeIamPolicyResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); + message.version = reader.string(); break; case 2: - if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) - message.serviceAccountImpersonationAnalysis = []; - message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); + message.discoveryDocumentUri = reader.string(); break; case 3: - message.fullyExplored = reader.bool(); + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 8: + message.location = reader.string(); break; default: reader.skipType(tag & 7); @@ -7313,884 +6893,171 @@ }; /** - * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @returns {google.cloud.asset.v1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeIamPolicyResponse message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeIamPolicyResponse.verify = function verify(message) { + Resource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) { - var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.mainAnalysis); + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); if (error) - return "mainAnalysis." + error; - } - if (message.serviceAccountImpersonationAnalysis != null && message.hasOwnProperty("serviceAccountImpersonationAnalysis")) { - if (!Array.isArray(message.serviceAccountImpersonationAnalysis)) - return "serviceAccountImpersonationAnalysis: array expected"; - for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) { - var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.serviceAccountImpersonationAnalysis[i]); - if (error) - return "serviceAccountImpersonationAnalysis." + error; - } + return "data." + error; } - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) - if (typeof message.fullyExplored !== "boolean") - return "fullyExplored: boolean expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; return null; }; /** - * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @returns {google.cloud.asset.v1.Resource} Resource */ - AnalyzeIamPolicyResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) return object; - var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse(); - if (object.mainAnalysis != null) { - if (typeof object.mainAnalysis !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.mainAnalysis: object expected"); - message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.mainAnalysis); - } - if (object.serviceAccountImpersonationAnalysis) { - if (!Array.isArray(object.serviceAccountImpersonationAnalysis)) - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: array expected"); - message.serviceAccountImpersonationAnalysis = []; - for (var i = 0; i < object.serviceAccountImpersonationAnalysis.length; ++i) { - if (typeof object.serviceAccountImpersonationAnalysis[i] !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: object expected"); - message.serviceAccountImpersonationAnalysis[i] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.serviceAccountImpersonationAnalysis[i]); - } + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); } - if (object.fullyExplored != null) - message.fullyExplored = Boolean(object.fullyExplored); + if (object.location != null) + message.location = String(object.location); return message; }; /** - * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse + * @param {google.cloud.asset.v1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeIamPolicyResponse.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.serviceAccountImpersonationAnalysis = []; if (options.defaults) { - object.mainAnalysis = null; - object.fullyExplored = false; - } - if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) - object.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.mainAnalysis, options); - if (message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length) { - object.serviceAccountImpersonationAnalysis = []; - for (var j = 0; j < message.serviceAccountImpersonationAnalysis.length; ++j) - object.serviceAccountImpersonationAnalysis[j] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.serviceAccountImpersonationAnalysis[j], options); + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.location = ""; } - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) - object.fullyExplored = message.fullyExplored; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; return object; }; /** - * Converts this AnalyzeIamPolicyResponse to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @memberof google.cloud.asset.v1.Resource * @instance * @returns {Object.} JSON object */ - AnalyzeIamPolicyResponse.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { - - /** - * Properties of an IamPolicyAnalysis. - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse - * @interface IIamPolicyAnalysis - * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] IamPolicyAnalysis analysisQuery - * @property {Array.|null} [analysisResults] IamPolicyAnalysis analysisResults - * @property {boolean|null} [fullyExplored] IamPolicyAnalysis fullyExplored - * @property {Array.|null} [stats] IamPolicyAnalysis stats - * @property {Array.|null} [nonCriticalErrors] IamPolicyAnalysis nonCriticalErrors - */ + return Resource; + })(); - /** - * Constructs a new IamPolicyAnalysis. - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse - * @classdesc Represents an IamPolicyAnalysis. - * @implements IIamPolicyAnalysis - * @constructor - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set - */ - function IamPolicyAnalysis(properties) { - this.analysisResults = []; - this.stats = []; - this.nonCriticalErrors = []; - 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]]; - } - - /** - * IamPolicyAnalysis analysisQuery. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @instance - */ - IamPolicyAnalysis.prototype.analysisQuery = null; - - /** - * IamPolicyAnalysis analysisResults. - * @member {Array.} analysisResults - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @instance - */ - IamPolicyAnalysis.prototype.analysisResults = $util.emptyArray; - - /** - * IamPolicyAnalysis fullyExplored. - * @member {boolean} fullyExplored - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @instance - */ - IamPolicyAnalysis.prototype.fullyExplored = false; - - /** - * IamPolicyAnalysis stats. - * @member {Array.} stats - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @instance - */ - IamPolicyAnalysis.prototype.stats = $util.emptyArray; - - /** - * IamPolicyAnalysis nonCriticalErrors. - * @member {Array.} nonCriticalErrors - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @instance - */ - IamPolicyAnalysis.prototype.nonCriticalErrors = $util.emptyArray; - - /** - * Creates a new IamPolicyAnalysis instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis instance - */ - IamPolicyAnalysis.create = function create(properties) { - return new IamPolicyAnalysis(properties); - }; - - /** - * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysis.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.analysisResults != null && message.analysisResults.length) - for (var i = 0; i < message.analysisResults.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); - if (message.stats != null && message.stats.length) - for (var i = 0; i < message.stats.length; ++i) - $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.encode(message.stats[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.nonCriticalErrors != null && message.nonCriticalErrors.length) - for (var i = 0; i < message.nonCriticalErrors.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.nonCriticalErrors[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysis.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IamPolicyAnalysis message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicyAnalysis.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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.analysisResults && message.analysisResults.length)) - message.analysisResults = []; - message.analysisResults.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); - break; - case 3: - message.fullyExplored = reader.bool(); - break; - case 4: - if (!(message.stats && message.stats.length)) - message.stats = []; - message.stats.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) - message.nonCriticalErrors = []; - message.nonCriticalErrors.push($root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicyAnalysis.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IamPolicyAnalysis message. - * @function verify - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IamPolicyAnalysis.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); - if (error) - return "analysisQuery." + error; - } - if (message.analysisResults != null && message.hasOwnProperty("analysisResults")) { - if (!Array.isArray(message.analysisResults)) - return "analysisResults: array expected"; - for (var i = 0; i < message.analysisResults.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.verify(message.analysisResults[i]); - if (error) - return "analysisResults." + error; - } - } - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) - if (typeof message.fullyExplored !== "boolean") - return "fullyExplored: boolean expected"; - if (message.stats != null && message.hasOwnProperty("stats")) { - if (!Array.isArray(message.stats)) - return "stats: array expected"; - for (var i = 0; i < message.stats.length; ++i) { - var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify(message.stats[i]); - if (error) - return "stats." + error; - } - } - if (message.nonCriticalErrors != null && message.hasOwnProperty("nonCriticalErrors")) { - if (!Array.isArray(message.nonCriticalErrors)) - return "nonCriticalErrors: array expected"; - for (var i = 0; i < message.nonCriticalErrors.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.nonCriticalErrors[i]); - if (error) - return "nonCriticalErrors." + error; - } - } - return null; - }; - - /** - * Creates an IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis - */ - IamPolicyAnalysis.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) - return object; - var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); - if (object.analysisQuery != null) { - if (typeof object.analysisQuery !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisQuery: object expected"); - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); - } - if (object.analysisResults) { - if (!Array.isArray(object.analysisResults)) - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: array expected"); - message.analysisResults = []; - for (var i = 0; i < object.analysisResults.length; ++i) { - if (typeof object.analysisResults[i] !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: object expected"); - message.analysisResults[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.fromObject(object.analysisResults[i]); - } - } - if (object.fullyExplored != null) - message.fullyExplored = Boolean(object.fullyExplored); - if (object.stats) { - if (!Array.isArray(object.stats)) - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.stats: array expected"); - message.stats = []; - for (var i = 0; i < object.stats.length; ++i) { - if (typeof object.stats[i] !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.stats: object expected"); - message.stats[i] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.fromObject(object.stats[i]); - } - } - if (object.nonCriticalErrors) { - if (!Array.isArray(object.nonCriticalErrors)) - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: array expected"); - message.nonCriticalErrors = []; - for (var i = 0; i < object.nonCriticalErrors.length; ++i) { - if (typeof object.nonCriticalErrors[i] !== "object") - throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: object expected"); - message.nonCriticalErrors[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.nonCriticalErrors[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} message IamPolicyAnalysis - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicyAnalysis.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.analysisResults = []; - object.stats = []; - object.nonCriticalErrors = []; - } - if (options.defaults) { - object.analysisQuery = null; - object.fullyExplored = false; - } - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) - object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); - if (message.analysisResults && message.analysisResults.length) { - object.analysisResults = []; - for (var j = 0; j < message.analysisResults.length; ++j) - object.analysisResults[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.toObject(message.analysisResults[j], options); - } - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) - object.fullyExplored = message.fullyExplored; - if (message.stats && message.stats.length) { - object.stats = []; - for (var j = 0; j < message.stats.length; ++j) - object.stats[j] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.toObject(message.stats[j], options); - } - if (message.nonCriticalErrors && message.nonCriticalErrors.length) { - object.nonCriticalErrors = []; - for (var j = 0; j < message.nonCriticalErrors.length; ++j) - object.nonCriticalErrors[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.nonCriticalErrors[j], options); - } - return object; - }; - - /** - * Converts this IamPolicyAnalysis to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @instance - * @returns {Object.} JSON object - */ - IamPolicyAnalysis.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - IamPolicyAnalysis.Stats = (function() { - - /** - * Properties of a Stats. - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @interface IStats - * @property {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType|null} [nodeType] Stats nodeType - * @property {string|null} [nodeSubtype] Stats nodeSubtype - * @property {number|null} [discoveredNodeCount] Stats discoveredNodeCount - * @property {number|null} [matchedNodeCount] Stats matchedNodeCount - * @property {number|null} [exploredNodeCount] Stats exploredNodeCount - * @property {number|null} [cappedNodeCount] Stats cappedNodeCount - * @property {number|null} [permisionDeniedNodeCount] Stats permisionDeniedNodeCount - * @property {number|null} [executionTimeoutNodeCount] Stats executionTimeoutNodeCount - */ - - /** - * Constructs a new Stats. - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis - * @classdesc Represents a Stats. - * @implements IStats - * @constructor - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats=} [properties] Properties to set - */ - function Stats(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]]; - } - - /** - * Stats nodeType. - * @member {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType} nodeType - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.nodeType = 0; - - /** - * Stats nodeSubtype. - * @member {string} nodeSubtype - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.nodeSubtype = ""; - - /** - * Stats discoveredNodeCount. - * @member {number} discoveredNodeCount - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.discoveredNodeCount = 0; - - /** - * Stats matchedNodeCount. - * @member {number} matchedNodeCount - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.matchedNodeCount = 0; - - /** - * Stats exploredNodeCount. - * @member {number} exploredNodeCount - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.exploredNodeCount = 0; - - /** - * Stats cappedNodeCount. - * @member {number} cappedNodeCount - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.cappedNodeCount = 0; - - /** - * Stats permisionDeniedNodeCount. - * @member {number} permisionDeniedNodeCount - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.permisionDeniedNodeCount = 0; - - /** - * Stats executionTimeoutNodeCount. - * @member {number} executionTimeoutNodeCount - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - */ - Stats.prototype.executionTimeoutNodeCount = 0; - - /** - * Creates a new Stats instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats instance - */ - Stats.create = function create(properties) { - return new Stats(properties); - }; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeType); - if (message.nodeSubtype != null && Object.hasOwnProperty.call(message, "nodeSubtype")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeSubtype); - if (message.discoveredNodeCount != null && Object.hasOwnProperty.call(message, "discoveredNodeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.discoveredNodeCount); - if (message.matchedNodeCount != null && Object.hasOwnProperty.call(message, "matchedNodeCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchedNodeCount); - if (message.exploredNodeCount != null && Object.hasOwnProperty.call(message, "exploredNodeCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.exploredNodeCount); - if (message.cappedNodeCount != null && Object.hasOwnProperty.call(message, "cappedNodeCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.cappedNodeCount); - if (message.permisionDeniedNodeCount != null && Object.hasOwnProperty.call(message, "permisionDeniedNodeCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.permisionDeniedNodeCount); - if (message.executionTimeoutNodeCount != null && Object.hasOwnProperty.call(message, "executionTimeoutNodeCount")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.executionTimeoutNodeCount); - return writer; - }; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nodeType = reader.int32(); - break; - case 2: - message.nodeSubtype = reader.string(); - break; - case 3: - message.discoveredNodeCount = reader.int32(); - break; - case 4: - message.matchedNodeCount = reader.int32(); - break; - case 5: - message.exploredNodeCount = reader.int32(); - break; - case 6: - message.cappedNodeCount = reader.int32(); - break; - case 7: - message.permisionDeniedNodeCount = reader.int32(); - break; - case 8: - message.executionTimeoutNodeCount = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Stats message. - * @function verify - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Stats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeType != null && message.hasOwnProperty("nodeType")) - switch (message.nodeType) { - default: - return "nodeType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.nodeSubtype != null && message.hasOwnProperty("nodeSubtype")) - if (!$util.isString(message.nodeSubtype)) - return "nodeSubtype: string expected"; - if (message.discoveredNodeCount != null && message.hasOwnProperty("discoveredNodeCount")) - if (!$util.isInteger(message.discoveredNodeCount)) - return "discoveredNodeCount: integer expected"; - if (message.matchedNodeCount != null && message.hasOwnProperty("matchedNodeCount")) - if (!$util.isInteger(message.matchedNodeCount)) - return "matchedNodeCount: integer expected"; - if (message.exploredNodeCount != null && message.hasOwnProperty("exploredNodeCount")) - if (!$util.isInteger(message.exploredNodeCount)) - return "exploredNodeCount: integer expected"; - if (message.cappedNodeCount != null && message.hasOwnProperty("cappedNodeCount")) - if (!$util.isInteger(message.cappedNodeCount)) - return "cappedNodeCount: integer expected"; - if (message.permisionDeniedNodeCount != null && message.hasOwnProperty("permisionDeniedNodeCount")) - if (!$util.isInteger(message.permisionDeniedNodeCount)) - return "permisionDeniedNodeCount: integer expected"; - if (message.executionTimeoutNodeCount != null && message.hasOwnProperty("executionTimeoutNodeCount")) - if (!$util.isInteger(message.executionTimeoutNodeCount)) - return "executionTimeoutNodeCount: integer expected"; - return null; - }; - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} Stats - */ - Stats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats) - return object; - var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats(); - switch (object.nodeType) { - case "NODE_TYPE_UNSPECIFIED": - case 0: - message.nodeType = 0; - break; - case "BINDING": - case 1: - message.nodeType = 1; - break; - case "IDENTITY": - case 2: - message.nodeType = 2; - break; - case "RESOURCE": - case 3: - message.nodeType = 3; - break; - case "ACCESS": - case 4: - message.nodeType = 4; - break; - } - if (object.nodeSubtype != null) - message.nodeSubtype = String(object.nodeSubtype); - if (object.discoveredNodeCount != null) - message.discoveredNodeCount = object.discoveredNodeCount | 0; - if (object.matchedNodeCount != null) - message.matchedNodeCount = object.matchedNodeCount | 0; - if (object.exploredNodeCount != null) - message.exploredNodeCount = object.exploredNodeCount | 0; - if (object.cappedNodeCount != null) - message.cappedNodeCount = object.cappedNodeCount | 0; - if (object.permisionDeniedNodeCount != null) - message.permisionDeniedNodeCount = object.permisionDeniedNodeCount | 0; - if (object.executionTimeoutNodeCount != null) - message.executionTimeoutNodeCount = object.executionTimeoutNodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @static - * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats} message Stats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Stats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.nodeType = options.enums === String ? "NODE_TYPE_UNSPECIFIED" : 0; - object.nodeSubtype = ""; - object.discoveredNodeCount = 0; - object.matchedNodeCount = 0; - object.exploredNodeCount = 0; - object.cappedNodeCount = 0; - object.permisionDeniedNodeCount = 0; - object.executionTimeoutNodeCount = 0; - } - if (message.nodeType != null && message.hasOwnProperty("nodeType")) - object.nodeType = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType[message.nodeType] : message.nodeType; - if (message.nodeSubtype != null && message.hasOwnProperty("nodeSubtype")) - object.nodeSubtype = message.nodeSubtype; - if (message.discoveredNodeCount != null && message.hasOwnProperty("discoveredNodeCount")) - object.discoveredNodeCount = message.discoveredNodeCount; - if (message.matchedNodeCount != null && message.hasOwnProperty("matchedNodeCount")) - object.matchedNodeCount = message.matchedNodeCount; - if (message.exploredNodeCount != null && message.hasOwnProperty("exploredNodeCount")) - object.exploredNodeCount = message.exploredNodeCount; - if (message.cappedNodeCount != null && message.hasOwnProperty("cappedNodeCount")) - object.cappedNodeCount = message.cappedNodeCount; - if (message.permisionDeniedNodeCount != null && message.hasOwnProperty("permisionDeniedNodeCount")) - object.permisionDeniedNodeCount = message.permisionDeniedNodeCount; - if (message.executionTimeoutNodeCount != null && message.hasOwnProperty("executionTimeoutNodeCount")) - object.executionTimeoutNodeCount = message.executionTimeoutNodeCount; - return object; - }; - - /** - * Converts this Stats to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats - * @instance - * @returns {Object.} JSON object - */ - Stats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * NodeType enum. - * @name google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.Stats.NodeType - * @enum {number} - * @property {number} NODE_TYPE_UNSPECIFIED=0 NODE_TYPE_UNSPECIFIED value - * @property {number} BINDING=1 BINDING value - * @property {number} IDENTITY=2 IDENTITY value - * @property {number} RESOURCE=3 RESOURCE value - * @property {number} ACCESS=4 ACCESS value - */ - Stats.NodeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NODE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BINDING"] = 1; - values[valuesById[2] = "IDENTITY"] = 2; - values[valuesById[3] = "RESOURCE"] = 3; - values[valuesById[4] = "ACCESS"] = 4; - return values; - })(); - - return Stats; - })(); - - return IamPolicyAnalysis; - })(); - - return AnalyzeIamPolicyResponse; - })(); - - v1.IamPolicyAnalysisOutputConfig = (function() { + v1.ResourceSearchResult = (function() { /** - * Properties of an IamPolicyAnalysisOutputConfig. + * Properties of a ResourceSearchResult. * @memberof google.cloud.asset.v1 - * @interface IIamPolicyAnalysisOutputConfig - * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null} [gcsDestination] IamPolicyAnalysisOutputConfig gcsDestination - * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null} [bigqueryDestination] IamPolicyAnalysisOutputConfig bigqueryDestination + * @interface IResourceSearchResult + * @property {string|null} [name] ResourceSearchResult name + * @property {string|null} [assetType] ResourceSearchResult assetType + * @property {string|null} [project] ResourceSearchResult project + * @property {string|null} [displayName] ResourceSearchResult displayName + * @property {string|null} [description] ResourceSearchResult description + * @property {string|null} [location] ResourceSearchResult location + * @property {Object.|null} [labels] ResourceSearchResult labels + * @property {Array.|null} [networkTags] ResourceSearchResult networkTags + * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes */ /** - * Constructs a new IamPolicyAnalysisOutputConfig. + * Constructs a new ResourceSearchResult. * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicyAnalysisOutputConfig. - * @implements IIamPolicyAnalysisOutputConfig + * @classdesc Represents a ResourceSearchResult. + * @implements IResourceSearchResult * @constructor - * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set */ - function IamPolicyAnalysisOutputConfig(properties) { + function ResourceSearchResult(properties) { + this.labels = {}; + this.networkTags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8198,102 +7065,202 @@ } /** - * IamPolicyAnalysisOutputConfig gcsDestination. - * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * ResourceSearchResult name. + * @member {string} name + * @memberof google.cloud.asset.v1.ResourceSearchResult * @instance */ - IamPolicyAnalysisOutputConfig.prototype.gcsDestination = null; + ResourceSearchResult.prototype.name = ""; /** - * IamPolicyAnalysisOutputConfig bigqueryDestination. - * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null|undefined} bigqueryDestination - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * ResourceSearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.ResourceSearchResult * @instance */ - IamPolicyAnalysisOutputConfig.prototype.bigqueryDestination = null; + ResourceSearchResult.prototype.assetType = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ResourceSearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.project = ""; /** - * IamPolicyAnalysisOutputConfig destination. - * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * ResourceSearchResult displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.ResourceSearchResult * @instance */ - Object.defineProperty(IamPolicyAnalysisOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceSearchResult.prototype.displayName = ""; /** - * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * ResourceSearchResult description. + * @member {string} description + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.description = ""; + + /** + * ResourceSearchResult location. + * @member {string} location + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.location = ""; + + /** + * ResourceSearchResult labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.labels = $util.emptyObject; + + /** + * ResourceSearchResult networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.networkTags = $util.emptyArray; + + /** + * ResourceSearchResult additionalAttributes. + * @member {google.protobuf.IStruct|null|undefined} additionalAttributes + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.additionalAttributes = null; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig instance + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance */ - IamPolicyAnalysisOutputConfig.create = function create(properties) { - return new IamPolicyAnalysisOutputConfig(properties); + ResourceSearchResult.create = function create(properties) { + return new ResourceSearchResult(properties); }; /** - * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IamPolicyAnalysisOutputConfig.encode = function encode(message, writer) { + ResourceSearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) - $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysisOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); + if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) + $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * Decodes a ResourceSearchResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicyAnalysisOutputConfig.decode = function decode(reader, length) { + ResourceSearchResult.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.asset.v1.IamPolicyAnalysisOutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ResourceSearchResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); + message.assetType = reader.string(); + break; + case 3: + message.project = reader.string(); + break; + case 4: + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.location = reader.string(); + break; + case 7: + 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 8: + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + case 9: + message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8304,5332 +7271,467 @@ }; /** - * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IamPolicyAnalysisOutputConfig.decodeDelimited = function decodeDelimited(reader) { + ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IamPolicyAnalysisOutputConfig message. + * Verifies a ResourceSearchResult message. * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IamPolicyAnalysisOutputConfig.verify = function verify(message) { + ResourceSearchResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - if (properties.destination === 1) - return "destination: multiple values"; - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify(message.bigqueryDestination); - if (error) - return "bigqueryDestination." + error; - } + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); + if (error) + return "additionalAttributes." + error; } return null; }; /** - * Creates an IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult */ - IamPolicyAnalysisOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig) + ResourceSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.fromObject(object.gcsDestination); + var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.bigqueryDestination != null) { - if (typeof object.bigqueryDestination !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.bigqueryDestination: object expected"); - message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.fromObject(object.bigqueryDestination); + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.additionalAttributes != null) { + if (typeof object.additionalAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); + message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); } return message; }; /** - * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig + * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IamPolicyAnalysisOutputConfig.toObject = function toObject(message, options) { + ResourceSearchResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; + if (options.arrays || options.defaults) + object.networkTags = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + object.location = ""; + object.additionalAttributes = null; } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - object.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.toObject(message.bigqueryDestination, options); - if (options.oneofs) - object.destination = "bigqueryDestination"; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) + object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); return object; }; /** - * Converts this IamPolicyAnalysisOutputConfig to JSON. + * Converts this ResourceSearchResult to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @memberof google.cloud.asset.v1.ResourceSearchResult * @instance * @returns {Object.} JSON object */ - IamPolicyAnalysisOutputConfig.prototype.toJSON = function toJSON() { + ResourceSearchResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - IamPolicyAnalysisOutputConfig.GcsDestination = (function() { + return ResourceSearchResult; + })(); - /** - * Properties of a GcsDestination. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - */ + v1.IamPolicySearchResult = (function() { - /** - * Constructs a new GcsDestination. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set - */ - function GcsDestination(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 IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation + */ - /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; + /** + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + */ + function IamPolicySearchResult(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 GcsDestination instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination instance - */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); - }; + /** + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.resource = ""; - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; + /** + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.project = ""; - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance + */ + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); + }; - /** - * Verifies a GcsDestination message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination - */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} message GcsDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this GcsDestination to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination - * @instance - * @returns {Object.} JSON object - */ - GcsDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GcsDestination; - })(); - - IamPolicyAnalysisOutputConfig.BigQueryDestination = (function() { - - /** - * Properties of a BigQueryDestination. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig - * @interface IBigQueryDestination - * @property {string|null} [dataset] BigQueryDestination dataset - * @property {string|null} [tablePrefix] BigQueryDestination tablePrefix - * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null} [partitionKey] BigQueryDestination partitionKey - * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode|null} [writeMode] BigQueryDestination writeMode - */ - - /** - * Constructs a new BigQueryDestination. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig - * @classdesc Represents a BigQueryDestination. - * @implements IBigQueryDestination - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set - */ - function BigQueryDestination(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]]; - } - - /** - * BigQueryDestination dataset. - * @member {string} dataset - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.dataset = ""; - - /** - * BigQueryDestination tablePrefix. - * @member {string} tablePrefix - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.tablePrefix = ""; - - /** - * BigQueryDestination partitionKey. - * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey} partitionKey - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.partitionKey = 0; - - /** - * BigQueryDestination writeMode. - * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode} writeMode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.writeMode = 0; - - /** - * Creates a new BigQueryDestination instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination instance - */ - BigQueryDestination.create = function create(properties) { - return new BigQueryDestination(properties); - }; - - /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.tablePrefix != null && Object.hasOwnProperty.call(message, "tablePrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tablePrefix); - if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.partitionKey); - if (message.writeMode != null && Object.hasOwnProperty.call(message, "writeMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.writeMode); - return writer; - }; - - /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryDestination.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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataset = reader.string(); - break; - case 2: - message.tablePrefix = reader.string(); - break; - case 3: - message.partitionKey = reader.int32(); - break; - case 4: - message.writeMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BigQueryDestination message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BigQueryDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) - if (!$util.isString(message.tablePrefix)) - return "tablePrefix: string expected"; - if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) - switch (message.partitionKey) { - default: - return "partitionKey: enum value expected"; - case 0: - case 1: - break; - } - if (message.writeMode != null && message.hasOwnProperty("writeMode")) - switch (message.writeMode) { - default: - return "writeMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination - */ - BigQueryDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.tablePrefix != null) - message.tablePrefix = String(object.tablePrefix); - switch (object.partitionKey) { - case "PARTITION_KEY_UNSPECIFIED": - case 0: - message.partitionKey = 0; - break; - case "REQUEST_TIME": - case 1: - message.partitionKey = 1; - break; - } - switch (object.writeMode) { - case "WRITE_MODE_UNSPECIFIED": - case 0: - message.writeMode = 0; - break; - case "ABORT": - case 1: - message.writeMode = 1; - break; - case "OVERWRITE": - case 2: - message.writeMode = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} message BigQueryDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BigQueryDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataset = ""; - object.tablePrefix = ""; - object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; - object.writeMode = options.enums === String ? "WRITE_MODE_UNSPECIFIED" : 0; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) - object.tablePrefix = message.tablePrefix; - if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) - object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] : message.partitionKey; - if (message.writeMode != null && message.hasOwnProperty("writeMode")) - object.writeMode = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode[message.writeMode] : message.writeMode; - return object; - }; - - /** - * Converts this BigQueryDestination to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination - * @instance - * @returns {Object.} JSON object - */ - BigQueryDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * PartitionKey enum. - * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey - * @enum {number} - * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value - * @property {number} REQUEST_TIME=1 REQUEST_TIME value - */ - BigQueryDestination.PartitionKey = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; - values[valuesById[1] = "REQUEST_TIME"] = 1; - return values; - })(); - - /** - * WriteMode enum. - * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.WriteMode - * @enum {number} - * @property {number} WRITE_MODE_UNSPECIFIED=0 WRITE_MODE_UNSPECIFIED value - * @property {number} ABORT=1 ABORT value - * @property {number} OVERWRITE=2 OVERWRITE value - */ - BigQueryDestination.WriteMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WRITE_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ABORT"] = 1; - values[valuesById[2] = "OVERWRITE"] = 2; - return values; - })(); - - return BigQueryDestination; - })(); - - return IamPolicyAnalysisOutputConfig; - })(); - - v1.ExportIamPolicyAnalysisRequest = (function() { - - /** - * Properties of an ExportIamPolicyAnalysisRequest. - * @memberof google.cloud.asset.v1 - * @interface IExportIamPolicyAnalysisRequest - * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] ExportIamPolicyAnalysisRequest analysisQuery - * @property {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] ExportIamPolicyAnalysisRequest outputConfig - */ - - /** - * Constructs a new ExportIamPolicyAnalysisRequest. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an ExportIamPolicyAnalysisRequest. - * @implements IExportIamPolicyAnalysisRequest - * @constructor - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set - */ - function ExportIamPolicyAnalysisRequest(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]]; - } - - /** - * ExportIamPolicyAnalysisRequest analysisQuery. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @instance - */ - ExportIamPolicyAnalysisRequest.prototype.analysisQuery = null; - - /** - * ExportIamPolicyAnalysisRequest outputConfig. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @instance - */ - ExportIamPolicyAnalysisRequest.prototype.outputConfig = null; - - /** - * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest instance - */ - ExportIamPolicyAnalysisRequest.create = function create(properties) { - return new ExportIamPolicyAnalysisRequest(properties); - }; - - /** - * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportIamPolicyAnalysisRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) - $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportIamPolicyAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportIamPolicyAnalysisRequest.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.asset.v1.ExportIamPolicyAnalysisRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 2: - message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportIamPolicyAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportIamPolicyAnalysisRequest message. - * @function verify - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportIamPolicyAnalysisRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); - if (error) - return "analysisQuery." + error; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } - return null; - }; - - /** - * Creates an ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest - */ - ExportIamPolicyAnalysisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest) - return object; - var message = new $root.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest(); - if (object.analysisQuery != null) { - if (typeof object.analysisQuery !== "object") - throw TypeError(".google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.analysisQuery: object expected"); - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1.ExportIamPolicyAnalysisRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); - } - return message; - }; - - /** - * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @static - * @param {google.cloud.asset.v1.ExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportIamPolicyAnalysisRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.analysisQuery = null; - object.outputConfig = null; - } - if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) - object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); - return object; - }; - - /** - * Converts this ExportIamPolicyAnalysisRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - * @instance - * @returns {Object.} JSON object - */ - ExportIamPolicyAnalysisRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExportIamPolicyAnalysisRequest; - })(); - - v1.ExportIamPolicyAnalysisResponse = (function() { - - /** - * Properties of an ExportIamPolicyAnalysisResponse. - * @memberof google.cloud.asset.v1 - * @interface IExportIamPolicyAnalysisResponse - */ - - /** - * Constructs a new ExportIamPolicyAnalysisResponse. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an ExportIamPolicyAnalysisResponse. - * @implements IExportIamPolicyAnalysisResponse - * @constructor - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set - */ - function ExportIamPolicyAnalysisResponse(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 ExportIamPolicyAnalysisResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @static - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse instance - */ - ExportIamPolicyAnalysisResponse.create = function create(properties) { - return new ExportIamPolicyAnalysisResponse(properties); - }; - - /** - * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @static - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportIamPolicyAnalysisResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportIamPolicyAnalysisResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @static - * @param {google.cloud.asset.v1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportIamPolicyAnalysisResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportIamPolicyAnalysisResponse.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.asset.v1.ExportIamPolicyAnalysisResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.project = reader.string(); + break; + case 3: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 4: + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @memberof google.cloud.asset.v1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportIamPolicyAnalysisResponse.decodeDelimited = function decodeDelimited(reader) { + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportIamPolicyAnalysisResponse message. + * Verifies an IamPolicySearchResult message. * @function verify - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse + * @memberof google.cloud.asset.v1.IamPolicySearchResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportIamPolicyAnalysisResponse.verify = function verify(message) { + IamPolicySearchResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - return null; - }; - - /** - * Creates an ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse - */ - ExportIamPolicyAnalysisResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse) - return object; - return new $root.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse(); - }; - - /** - * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @static - * @param {google.cloud.asset.v1.ExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportIamPolicyAnalysisResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ExportIamPolicyAnalysisResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.ExportIamPolicyAnalysisResponse - * @instance - * @returns {Object.} JSON object - */ - ExportIamPolicyAnalysisResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExportIamPolicyAnalysisResponse; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; - })(); - - v1.TemporalAsset = (function() { - - /** - * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset - * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState - * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset - */ - - /** - * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset - * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - */ - function TemporalAsset(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]]; - } - - /** - * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.window = null; - - /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.deleted = false; - - /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.asset = null; - - /** - * TemporalAsset priorAssetState. - * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.priorAssetState = 0; - - /** - * TemporalAsset priorAsset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.priorAsset = null; - - /** - * Creates a new TemporalAsset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance - */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); - }; - - /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TemporalAsset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.window != null && Object.hasOwnProperty.call(message, "window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); - if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) - $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TemporalAsset.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.asset.v1.TemporalAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); - break; - case 4: - message.priorAssetState = reader.int32(); - break; - case 5: - message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TemporalAsset message. - * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TemporalAsset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - switch (message.priorAssetState) { - default: - return "priorAssetState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); - if (error) - return "priorAsset." + error; - } - return null; - }; - - /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset - */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) - return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); - } - switch (object.priorAssetState) { - case "PRIOR_ASSET_STATE_UNSPECIFIED": - case 0: - message.priorAssetState = 0; - break; - case "PRESENT": - case 1: - message.priorAssetState = 1; - break; - case "INVALID": - case 2: - message.priorAssetState = 2; - break; - case "DOES_NOT_EXIST": - case 3: - message.priorAssetState = 3; - break; - case "DELETED": - case 4: - message.priorAssetState = 4; - break; - } - if (object.priorAsset != null) { - if (typeof object.priorAsset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); - message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); - } - return message; - }; - - /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset - * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TemporalAsset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; - object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; - object.priorAsset = null; - } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); - if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; - if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) - object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); - return object; - }; - - /** - * Converts this TemporalAsset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset - * @instance - * @returns {Object.} JSON object - */ - TemporalAsset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * PriorAssetState enum. - * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState - * @enum {number} - * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value - * @property {number} PRESENT=1 PRESENT value - * @property {number} INVALID=2 INVALID value - * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value - * @property {number} DELETED=4 DELETED value - */ - TemporalAsset.PriorAssetState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRESENT"] = 1; - values[valuesById[2] = "INVALID"] = 2; - values[valuesById[3] = "DOES_NOT_EXIST"] = 3; - values[valuesById[4] = "DELETED"] = 4; - return values; - })(); - - return TemporalAsset; - })(); - - v1.TimeWindow = (function() { - - /** - * Properties of a TimeWindow. - * @memberof google.cloud.asset.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.asset.v1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow - * @constructor - * @param {google.cloud.asset.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.asset.v1.TimeWindow - * @instance - */ - TimeWindow.prototype.startTime = null; - - /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow - * @instance - */ - TimeWindow.prototype.endTime = null; - - /** - * Creates a new TimeWindow instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance - */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); - }; - - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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.asset.v1.TimeWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow - */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) - return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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.asset.v1.TimeWindow - * @instance - * @returns {Object.} JSON object - */ - TimeWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TimeWindow; - })(); - - v1.Asset = (function() { - - /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1 - * @interface IAsset - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [orgPolicy] Asset orgPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel - * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter - * @property {Array.|null} [ancestors] Asset ancestors - */ - - /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - */ - function Asset(properties) { - this.orgPolicy = []; - this.ancestors = []; - 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]]; - } - - /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.updateTime = null; - - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.assetType = ""; - - /** - * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.resource = null; - - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.iamPolicy = null; - - /** - * Asset orgPolicy. - * @member {Array.} orgPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.orgPolicy = $util.emptyArray; - - /** - * Asset accessPolicy. - * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessPolicy = null; - - /** - * Asset accessLevel. - * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessLevel = null; - - /** - * Asset servicePerimeter. - * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.servicePerimeter = null; - - /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.ancestors = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Asset accessContextPolicy. - * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Object.defineProperty(Asset.prototype, "accessContextPolicy", { - get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Asset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance - */ - Asset.create = function create(properties) { - return new Asset(properties); - }; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.orgPolicy != null && message.orgPolicy.length) - for (var i = 0; i < message.orgPolicy.length; ++i) - $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) - $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) - $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) - $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Asset.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.asset.v1.Asset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.orgPolicy && message.orgPolicy.length)) - message.orgPolicy = []; - message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); - break; - case 7: - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); - break; - case 8: - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); - break; - case 9: - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Asset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Asset message. - * @function verify - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Asset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { - if (!Array.isArray(message.orgPolicy)) - return "orgPolicy: array expected"; - for (var i = 0; i < message.orgPolicy.length; ++i) { - var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); - if (error) - return "orgPolicy." + error; - } - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); - if (error) - return "accessPolicy." + error; - } - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); - if (error) - return "accessLevel." + error; - } - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); - if (error) - return "servicePerimeter." + error; - } - } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; - } - return null; - }; - - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset - */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) - return object; - var message = new $root.google.cloud.asset.v1.Asset(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.orgPolicy) { - if (!Array.isArray(object.orgPolicy)) - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); - message.orgPolicy = []; - for (var i = 0; i < object.orgPolicy.length; ++i) { - if (typeof object.orgPolicy[i] !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); - message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); - } - } - if (object.accessPolicy != null) { - if (typeof object.accessPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); - } - if (object.accessLevel != null) { - if (typeof object.accessLevel !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); - } - if (object.servicePerimeter != null) { - if (typeof object.servicePerimeter !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); - } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } - return message; - }; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.Asset} message Asset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Asset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.orgPolicy = []; - object.ancestors = []; - } - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.orgPolicy && message.orgPolicy.length) { - object.orgPolicy = []; - for (var j = 0; j < message.orgPolicy.length; ++j) - object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); - if (options.oneofs) - object.accessContextPolicy = "accessPolicy"; - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); - if (options.oneofs) - object.accessContextPolicy = "accessLevel"; - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); - if (options.oneofs) - object.accessContextPolicy = "servicePerimeter"; - } - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; - - /** - * Converts this Asset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.Asset - * @instance - * @returns {Object.} JSON object - */ - Asset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Asset; - })(); - - v1.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - * @property {string|null} [location] Resource location - */ - - /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - */ - function Resource(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]]; - } - - /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; - - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.parent = ""; - - /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.data = null; - - /** - * Resource location. - * @member {string} location - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.location = ""; - - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); - return writer; - }; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.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.asset.v1.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 8: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Resource message. - * @function verify - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Resource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) - return object; - var message = new $root.google.cloud.asset.v1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); - } - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - object.location = ""; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Resource; - })(); - - v1.ResourceSearchResult = (function() { - - /** - * Properties of a ResourceSearchResult. - * @memberof google.cloud.asset.v1 - * @interface IResourceSearchResult - * @property {string|null} [name] ResourceSearchResult name - * @property {string|null} [assetType] ResourceSearchResult assetType - * @property {string|null} [project] ResourceSearchResult project - * @property {string|null} [displayName] ResourceSearchResult displayName - * @property {string|null} [description] ResourceSearchResult description - * @property {string|null} [location] ResourceSearchResult location - * @property {Object.|null} [labels] ResourceSearchResult labels - * @property {Array.|null} [networkTags] ResourceSearchResult networkTags - * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes - */ - - /** - * Constructs a new ResourceSearchResult. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a ResourceSearchResult. - * @implements IResourceSearchResult - * @constructor - * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set - */ - function ResourceSearchResult(properties) { - this.labels = {}; - this.networkTags = []; - 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]]; - } - - /** - * ResourceSearchResult name. - * @member {string} name - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.name = ""; - - /** - * ResourceSearchResult assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.assetType = ""; - - /** - * ResourceSearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.project = ""; - - /** - * ResourceSearchResult displayName. - * @member {string} displayName - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.displayName = ""; - - /** - * ResourceSearchResult description. - * @member {string} description - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.description = ""; - - /** - * ResourceSearchResult location. - * @member {string} location - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.location = ""; - - /** - * ResourceSearchResult labels. - * @member {Object.} labels - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.labels = $util.emptyObject; - - /** - * ResourceSearchResult networkTags. - * @member {Array.} networkTags - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.networkTags = $util.emptyArray; - - /** - * ResourceSearchResult additionalAttributes. - * @member {google.protobuf.IStruct|null|undefined} additionalAttributes - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.additionalAttributes = null; - - /** - * Creates a new ResourceSearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance - */ - ResourceSearchResult.create = function create(properties) { - return new ResourceSearchResult(properties); - }; - - /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSearchResult.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.networkTags != null && message.networkTags.length) - for (var i = 0; i < message.networkTags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); - if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) - $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSearchResult.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.asset.v1.ResourceSearchResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.project = reader.string(); - break; - case 4: - message.displayName = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 6: - message.location = reader.string(); - break; - case 7: - 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 8: - if (!(message.networkTags && message.networkTags.length)) - message.networkTags = []; - message.networkTags.push(reader.string()); - break; - case 9: - message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceSearchResult message. - * @function verify - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceSearchResult.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { - if (!Array.isArray(message.networkTags)) - return "networkTags: array expected"; - for (var i = 0; i < message.networkTags.length; ++i) - if (!$util.isString(message.networkTags[i])) - return "networkTags: string[] expected"; - } - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { - var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); - if (error) - return "additionalAttributes." + error; - } - return null; - }; - - /** - * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult - */ - ResourceSearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) - return object; - var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.project != null) - message.project = String(object.project); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.networkTags) { - if (!Array.isArray(object.networkTags)) - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); - message.networkTags = []; - for (var i = 0; i < object.networkTags.length; ++i) - message.networkTags[i] = String(object.networkTags[i]); - } - if (object.additionalAttributes != null) { - if (typeof object.additionalAttributes !== "object") - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); - message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); - } - return message; - }; - - /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkTags = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.project = ""; - object.displayName = ""; - object.description = ""; - object.location = ""; - object.additionalAttributes = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - 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.networkTags && message.networkTags.length) { - object.networkTags = []; - for (var j = 0; j < message.networkTags.length; ++j) - object.networkTags[j] = message.networkTags[j]; - } - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) - object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); - return object; - }; - - /** - * Converts this ResourceSearchResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - * @returns {Object.} JSON object - */ - ResourceSearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResourceSearchResult; - })(); - - v1.IamPolicySearchResult = (function() { - - /** - * Properties of an IamPolicySearchResult. - * @memberof google.cloud.asset.v1 - * @interface IIamPolicySearchResult - * @property {string|null} [resource] IamPolicySearchResult resource - * @property {string|null} [project] IamPolicySearchResult project - * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy - * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation - */ - - /** - * Constructs a new IamPolicySearchResult. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicySearchResult. - * @implements IIamPolicySearchResult - * @constructor - * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set - */ - function IamPolicySearchResult(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]]; - } - - /** - * IamPolicySearchResult resource. - * @member {string} resource - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.resource = ""; - - /** - * IamPolicySearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.project = ""; - - /** - * IamPolicySearchResult policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.policy = null; - - /** - * IamPolicySearchResult explanation. - * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.explanation = null; - - /** - * Creates a new IamPolicySearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance - */ - IamPolicySearchResult.create = function create(properties) { - return new IamPolicySearchResult(properties); - }; - - /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicySearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.project = reader.string(); - break; - case 3: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 4: - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IamPolicySearchResult message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IamPolicySearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.explanation != null && message.hasOwnProperty("explanation")) { - var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); - if (error) - return "explanation." + error; - } - return null; - }; - - /** - * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - */ - IamPolicySearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.project != null) - message.project = String(object.project); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.explanation != null) { - if (typeof object.explanation !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); - } - return message; - }; - - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicySearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.project = ""; - object.policy = null; - object.explanation = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); - return object; - }; - - /** - * Converts this IamPolicySearchResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - * @returns {Object.} JSON object - */ - IamPolicySearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - IamPolicySearchResult.Explanation = (function() { - - /** - * Properties of an Explanation. - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @interface IExplanation - * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions - */ - - /** - * Constructs a new Explanation. - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @classdesc Represents an Explanation. - * @implements IExplanation - * @constructor - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set - */ - function Explanation(properties) { - this.matchedPermissions = {}; - 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]]; - } - - /** - * Explanation matchedPermissions. - * @member {Object.} matchedPermissions - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @instance - */ - Explanation.prototype.matchedPermissions = $util.emptyObject; - - /** - * Creates a new Explanation instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance - */ - Explanation.create = function create(properties) { - return new Explanation(properties); - }; - - /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Explanation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) - for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Explanation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Explanation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Explanation.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.asset.v1.IamPolicySearchResult.Explanation(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.matchedPermissions === $util.emptyObject) - message.matchedPermissions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchedPermissions[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Explanation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Explanation message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Explanation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { - if (!$util.isObject(message.matchedPermissions)) - return "matchedPermissions: object expected"; - var key = Object.keys(message.matchedPermissions); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); - if (error) - return "matchedPermissions." + error; - } - } - return null; - }; - - /** - * Creates an Explanation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation - */ - Explanation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); - if (object.matchedPermissions) { - if (typeof object.matchedPermissions !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); - message.matchedPermissions = {}; - for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { - if (typeof object.matchedPermissions[keys[i]] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); - message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Explanation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.matchedPermissions = {}; - var keys2; - if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { - object.matchedPermissions = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Explanation to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @instance - * @returns {Object.} JSON object - */ - Explanation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Explanation.Permissions = (function() { - - /** - * Properties of a Permissions. - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @interface IPermissions - * @property {Array.|null} [permissions] Permissions permissions - */ - - /** - * Constructs a new Permissions. - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @classdesc Represents a Permissions. - * @implements IPermissions - * @constructor - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set - */ - function Permissions(properties) { - this.permissions = []; - 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]]; - } - - /** - * Permissions permissions. - * @member {Array.} permissions - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @instance - */ - Permissions.prototype.permissions = $util.emptyArray; - - /** - * Creates a new Permissions instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance - */ - Permissions.create = function create(properties) { - return new Permissions(properties); - }; - - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Permissions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Permissions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Permissions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Permissions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Permissions message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Permissions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a Permissions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - */ - Permissions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Permissions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this Permissions to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @instance - * @returns {Object.} JSON object - */ - Permissions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Permissions; - })(); - - return Explanation; - })(); - - return IamPolicySearchResult; - })(); - - v1.IamPolicyAnalysisState = (function() { - - /** - * Properties of an IamPolicyAnalysisState. - * @memberof google.cloud.asset.v1 - * @interface IIamPolicyAnalysisState - * @property {google.rpc.Code|null} [code] IamPolicyAnalysisState code - * @property {string|null} [cause] IamPolicyAnalysisState cause - */ - - /** - * Constructs a new IamPolicyAnalysisState. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicyAnalysisState. - * @implements IIamPolicyAnalysisState - * @constructor - * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set - */ - function IamPolicyAnalysisState(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]]; - } - - /** - * IamPolicyAnalysisState code. - * @member {google.rpc.Code} code - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @instance - */ - IamPolicyAnalysisState.prototype.code = 0; - - /** - * IamPolicyAnalysisState cause. - * @member {string} cause - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @instance - */ - IamPolicyAnalysisState.prototype.cause = ""; - - /** - * Creates a new IamPolicyAnalysisState instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState instance - */ - IamPolicyAnalysisState.create = function create(properties) { - return new IamPolicyAnalysisState(properties); - }; - - /** - * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysisState.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.cause != null && Object.hasOwnProperty.call(message, "cause")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); - return writer; - }; - - /** - * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicyAnalysisState.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.asset.v1.IamPolicyAnalysisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.cause = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicyAnalysisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IamPolicyAnalysisState message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IamPolicyAnalysisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - switch (message.code) { - default: - return "code: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 16: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - break; - } - if (message.cause != null && message.hasOwnProperty("cause")) - if (!$util.isString(message.cause)) - return "cause: string expected"; - return null; - }; - - /** - * Creates an IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState - */ - IamPolicyAnalysisState.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisState) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisState(); - switch (object.code) { - case "OK": - case 0: - message.code = 0; - break; - case "CANCELLED": - case 1: - message.code = 1; - break; - case "UNKNOWN": - case 2: - message.code = 2; - break; - case "INVALID_ARGUMENT": - case 3: - message.code = 3; - break; - case "DEADLINE_EXCEEDED": - case 4: - message.code = 4; - break; - case "NOT_FOUND": - case 5: - message.code = 5; - break; - case "ALREADY_EXISTS": - case 6: - message.code = 6; - break; - case "PERMISSION_DENIED": - case 7: - message.code = 7; - break; - case "UNAUTHENTICATED": - case 16: - message.code = 16; - break; - case "RESOURCE_EXHAUSTED": - case 8: - message.code = 8; - break; - case "FAILED_PRECONDITION": - case 9: - message.code = 9; - break; - case "ABORTED": - case 10: - message.code = 10; - break; - case "OUT_OF_RANGE": - case 11: - message.code = 11; - break; - case "UNIMPLEMENTED": - case 12: - message.code = 12; - break; - case "INTERNAL": - case 13: - message.code = 13; - break; - case "UNAVAILABLE": - case 14: - message.code = 14; - break; - case "DATA_LOSS": - case 15: - message.code = 15; - break; - } - if (object.cause != null) - message.cause = String(object.cause); - return message; - }; - - /** - * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisState} message IamPolicyAnalysisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicyAnalysisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = options.enums === String ? "OK" : 0; - object.cause = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; - if (message.cause != null && message.hasOwnProperty("cause")) - object.cause = message.cause; - return object; - }; - - /** - * Converts this IamPolicyAnalysisState to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisState - * @instance - * @returns {Object.} JSON object - */ - IamPolicyAnalysisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IamPolicyAnalysisState; - })(); - - v1.IamPolicyAnalysisResult = (function() { - - /** - * Properties of an IamPolicyAnalysisResult. - * @memberof google.cloud.asset.v1 - * @interface IIamPolicyAnalysisResult - * @property {string|null} [attachedResourceFullName] IamPolicyAnalysisResult attachedResourceFullName - * @property {google.iam.v1.IBinding|null} [iamBinding] IamPolicyAnalysisResult iamBinding - * @property {Array.|null} [accessControlLists] IamPolicyAnalysisResult accessControlLists - * @property {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null} [identityList] IamPolicyAnalysisResult identityList - * @property {boolean|null} [fullyExplored] IamPolicyAnalysisResult fullyExplored - */ - - /** - * Constructs a new IamPolicyAnalysisResult. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicyAnalysisResult. - * @implements IIamPolicyAnalysisResult - * @constructor - * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set - */ - function IamPolicyAnalysisResult(properties) { - this.accessControlLists = []; - 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]]; - } - - /** - * IamPolicyAnalysisResult attachedResourceFullName. - * @member {string} attachedResourceFullName - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @instance - */ - IamPolicyAnalysisResult.prototype.attachedResourceFullName = ""; - - /** - * IamPolicyAnalysisResult iamBinding. - * @member {google.iam.v1.IBinding|null|undefined} iamBinding - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @instance - */ - IamPolicyAnalysisResult.prototype.iamBinding = null; - - /** - * IamPolicyAnalysisResult accessControlLists. - * @member {Array.} accessControlLists - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @instance - */ - IamPolicyAnalysisResult.prototype.accessControlLists = $util.emptyArray; - - /** - * IamPolicyAnalysisResult identityList. - * @member {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null|undefined} identityList - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @instance - */ - IamPolicyAnalysisResult.prototype.identityList = null; - - /** - * IamPolicyAnalysisResult fullyExplored. - * @member {boolean} fullyExplored - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @instance - */ - IamPolicyAnalysisResult.prototype.fullyExplored = false; - - /** - * Creates a new IamPolicyAnalysisResult instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult instance - */ - IamPolicyAnalysisResult.create = function create(properties) { - return new IamPolicyAnalysisResult(properties); - }; - - /** - * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysisResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attachedResourceFullName != null && Object.hasOwnProperty.call(message, "attachedResourceFullName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); - if (message.iamBinding != null && Object.hasOwnProperty.call(message, "iamBinding")) - $root.google.iam.v1.Binding.encode(message.iamBinding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.accessControlLists != null && message.accessControlLists.length) - for (var i = 0; i < message.accessControlLists.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.identityList != null && Object.hasOwnProperty.call(message, "identityList")) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fullyExplored); - return writer; - }; - - /** - * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicyAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicyAnalysisResult.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.asset.v1.IamPolicyAnalysisResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.attachedResourceFullName = reader.string(); - break; - case 2: - message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.accessControlLists && message.accessControlLists.length)) - message.accessControlLists = []; - message.accessControlLists.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); - break; - case 4: - message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); - break; - case 5: - message.fullyExplored = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicyAnalysisResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IamPolicyAnalysisResult message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IamPolicyAnalysisResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) - if (!$util.isString(message.attachedResourceFullName)) - return "attachedResourceFullName: string expected"; - if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) { - var error = $root.google.iam.v1.Binding.verify(message.iamBinding); - if (error) - return "iamBinding." + error; - } - if (message.accessControlLists != null && message.hasOwnProperty("accessControlLists")) { - if (!Array.isArray(message.accessControlLists)) - return "accessControlLists: array expected"; - for (var i = 0; i < message.accessControlLists.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify(message.accessControlLists[i]); - if (error) - return "accessControlLists." + error; - } - } - if (message.identityList != null && message.hasOwnProperty("identityList")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify(message.identityList); - if (error) - return "identityList." + error; - } - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) - if (typeof message.fullyExplored !== "boolean") - return "fullyExplored: boolean expected"; - return null; - }; - - /** - * Creates an IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult - */ - IamPolicyAnalysisResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult(); - if (object.attachedResourceFullName != null) - message.attachedResourceFullName = String(object.attachedResourceFullName); - if (object.iamBinding != null) { - if (typeof object.iamBinding !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.iamBinding: object expected"); - message.iamBinding = $root.google.iam.v1.Binding.fromObject(object.iamBinding); - } - if (object.accessControlLists) { - if (!Array.isArray(object.accessControlLists)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.accessControlLists: array expected"); - message.accessControlLists = []; - for (var i = 0; i < object.accessControlLists.length; ++i) { - if (typeof object.accessControlLists[i] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.accessControlLists: object expected"); - message.accessControlLists[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.fromObject(object.accessControlLists[i]); - } - } - if (object.identityList != null) { - if (typeof object.identityList !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.identityList: object expected"); - message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.fromObject(object.identityList); - } - if (object.fullyExplored != null) - message.fullyExplored = Boolean(object.fullyExplored); - return message; - }; - - /** - * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult} message IamPolicyAnalysisResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicyAnalysisResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accessControlLists = []; - if (options.defaults) { - object.attachedResourceFullName = ""; - object.iamBinding = null; - object.identityList = null; - object.fullyExplored = false; - } - if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) - object.attachedResourceFullName = message.attachedResourceFullName; - if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) - object.iamBinding = $root.google.iam.v1.Binding.toObject(message.iamBinding, options); - if (message.accessControlLists && message.accessControlLists.length) { - object.accessControlLists = []; - for (var j = 0; j < message.accessControlLists.length; ++j) - object.accessControlLists[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.toObject(message.accessControlLists[j], options); - } - if (message.identityList != null && message.hasOwnProperty("identityList")) - object.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.toObject(message.identityList, options); - if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) - object.fullyExplored = message.fullyExplored; - return object; - }; - - /** - * Converts this IamPolicyAnalysisResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @instance - * @returns {Object.} JSON object - */ - IamPolicyAnalysisResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - IamPolicyAnalysisResult.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @interface IResource - * @property {string|null} [fullResourceName] Resource fullResourceName - * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Resource analysisState - */ - - /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set - */ - function Resource(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]]; - } - - /** - * Resource fullResourceName. - * @member {string} fullResourceName - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @instance - */ - Resource.prototype.fullResourceName = ""; - - /** - * Resource analysisState. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @instance - */ - Resource.prototype.analysisState = null; - - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); - if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) - $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.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.asset.v1.IamPolicyAnalysisResult.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; - case 2: - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Resource message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Resource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) - if (!$util.isString(message.fullResourceName)) - return "fullResourceName: string expected"; - if (message.analysisState != null && message.hasOwnProperty("analysisState")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); - if (error) - return "analysisState." + error; - } - return null; - }; - - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource(); - if (object.fullResourceName != null) - message.fullResourceName = String(object.fullResourceName); - if (object.analysisState != null) { - if (typeof object.analysisState !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.analysisState: object expected"); - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); - } - return message; - }; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fullResourceName = ""; - object.analysisState = null; - } - if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) - object.fullResourceName = message.fullResourceName; - if (message.analysisState != null && message.hasOwnProperty("analysisState")) - object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); - return object; - }; - - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Resource; - })(); - - IamPolicyAnalysisResult.Access = (function() { - - /** - * Properties of an Access. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @interface IAccess - * @property {string|null} [role] Access role - * @property {string|null} [permission] Access permission - * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Access analysisState - */ - - /** - * Constructs a new Access. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @classdesc Represents an Access. - * @implements IAccess - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set - */ - function Access(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]]; - } - - /** - * Access role. - * @member {string} role - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @instance - */ - Access.prototype.role = ""; - - /** - * Access permission. - * @member {string} permission - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @instance - */ - Access.prototype.permission = ""; - - /** - * Access analysisState. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @instance - */ - Access.prototype.analysisState = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Access oneofAccess. - * @member {"role"|"permission"|undefined} oneofAccess - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @instance - */ - Object.defineProperty(Access.prototype, "oneofAccess", { - get: $util.oneOfGetter($oneOfFields = ["role", "permission"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Access instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access instance - */ - Access.create = function create(properties) { - return new Access(properties); - }; - - /** - * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Access.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); - if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) - $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Access.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Access message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Access.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.asset.v1.IamPolicyAnalysisResult.Access(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - message.permission = reader.string(); - break; - case 3: - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Access message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Access.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Access message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Access.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.role != null && message.hasOwnProperty("role")) { - properties.oneofAccess = 1; - if (!$util.isString(message.role)) - return "role: string expected"; - } - if (message.permission != null && message.hasOwnProperty("permission")) { - if (properties.oneofAccess === 1) - return "oneofAccess: multiple values"; - properties.oneofAccess = 1; - if (!$util.isString(message.permission)) - return "permission: string expected"; - } - if (message.analysisState != null && message.hasOwnProperty("analysisState")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); - if (error) - return "analysisState." + error; - } - return null; - }; - - /** - * Creates an Access message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access - */ - Access.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access(); - if (object.role != null) - message.role = String(object.role); - if (object.permission != null) - message.permission = String(object.permission); - if (object.analysisState != null) { - if (typeof object.analysisState !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Access.analysisState: object expected"); - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); - } - return message; - }; - - /** - * Creates a plain object from an Access message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} message Access - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Access.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.analysisState = null; - if (message.role != null && message.hasOwnProperty("role")) { - object.role = message.role; - if (options.oneofs) - object.oneofAccess = "role"; - } - if (message.permission != null && message.hasOwnProperty("permission")) { - object.permission = message.permission; - if (options.oneofs) - object.oneofAccess = "permission"; - } - if (message.analysisState != null && message.hasOwnProperty("analysisState")) - object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); - return object; - }; - - /** - * Converts this Access to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access - * @instance - * @returns {Object.} JSON object - */ - Access.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Access; - })(); - - IamPolicyAnalysisResult.Identity = (function() { - - /** - * Properties of an Identity. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @interface IIdentity - * @property {string|null} [name] Identity name - * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Identity analysisState - */ - - /** - * Constructs a new Identity. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @classdesc Represents an Identity. - * @implements IIdentity - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set - */ - function Identity(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]]; - } - - /** - * Identity name. - * @member {string} name - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @instance - */ - Identity.prototype.name = ""; - - /** - * Identity analysisState. - * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @instance - */ - Identity.prototype.analysisState = null; - - /** - * Creates a new Identity instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity instance - */ - Identity.create = function create(properties) { - return new Identity(properties); - }; - - /** - * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Identity.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.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) - $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Identity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Identity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Identity.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.asset.v1.IamPolicyAnalysisResult.Identity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Identity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Identity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Identity message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Identity.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.analysisState != null && message.hasOwnProperty("analysisState")) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); - if (error) - return "analysisState." + error; - } - return null; - }; - - /** - * Creates an Identity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity - */ - Identity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity(); - if (object.name != null) - message.name = String(object.name); - if (object.analysisState != null) { - if (typeof object.analysisState !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.analysisState: object expected"); - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); - } - return message; - }; - - /** - * Creates a plain object from an Identity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} message Identity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Identity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.analysisState = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.analysisState != null && message.hasOwnProperty("analysisState")) - object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); - return object; - }; - - /** - * Converts this Identity to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity - * @instance - * @returns {Object.} JSON object - */ - Identity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Identity; - })(); - - IamPolicyAnalysisResult.Edge = (function() { - - /** - * Properties of an Edge. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @interface IEdge - * @property {string|null} [sourceNode] Edge sourceNode - * @property {string|null} [targetNode] Edge targetNode - */ - - /** - * Constructs a new Edge. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @classdesc Represents an Edge. - * @implements IEdge - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set - */ - function Edge(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]]; - } - - /** - * Edge sourceNode. - * @member {string} sourceNode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @instance - */ - Edge.prototype.sourceNode = ""; - - /** - * Edge targetNode. - * @member {string} targetNode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @instance - */ - Edge.prototype.targetNode = ""; - - /** - * Creates a new Edge instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge instance - */ - Edge.create = function create(properties) { - return new Edge(properties); - }; - - /** - * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Edge.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sourceNode != null && Object.hasOwnProperty.call(message, "sourceNode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); - if (message.targetNode != null && Object.hasOwnProperty.call(message, "targetNode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetNode); - return writer; - }; - - /** - * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Edge.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Edge message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Edge.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.asset.v1.IamPolicyAnalysisResult.Edge(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sourceNode = reader.string(); - break; - case 2: - message.targetNode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Edge message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Edge.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Edge message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Edge.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) - if (!$util.isString(message.sourceNode)) - return "sourceNode: string expected"; - if (message.targetNode != null && message.hasOwnProperty("targetNode")) - if (!$util.isString(message.targetNode)) - return "targetNode: string expected"; - return null; - }; - - /** - * Creates an Edge message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge - */ - Edge.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge(); - if (object.sourceNode != null) - message.sourceNode = String(object.sourceNode); - if (object.targetNode != null) - message.targetNode = String(object.targetNode); - return message; - }; - - /** - * Creates a plain object from an Edge message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} message Edge - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Edge.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sourceNode = ""; - object.targetNode = ""; - } - if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) - object.sourceNode = message.sourceNode; - if (message.targetNode != null && message.hasOwnProperty("targetNode")) - object.targetNode = message.targetNode; - return object; - }; - - /** - * Converts this Edge to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge - * @instance - * @returns {Object.} JSON object - */ - Edge.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Edge; - })(); - - IamPolicyAnalysisResult.AccessControlList = (function() { - - /** - * Properties of an AccessControlList. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @interface IAccessControlList - * @property {Array.|null} [resources] AccessControlList resources - * @property {Array.|null} [accesses] AccessControlList accesses - * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges - */ - - /** - * Constructs a new AccessControlList. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @classdesc Represents an AccessControlList. - * @implements IAccessControlList - * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set - */ - function AccessControlList(properties) { - this.resources = []; - this.accesses = []; - this.resourceEdges = []; - 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]]; - } - - /** - * AccessControlList resources. - * @member {Array.} resources - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @instance - */ - AccessControlList.prototype.resources = $util.emptyArray; - - /** - * AccessControlList accesses. - * @member {Array.} accesses - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @instance - */ - AccessControlList.prototype.accesses = $util.emptyArray; - - /** - * AccessControlList resourceEdges. - * @member {Array.} resourceEdges - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @instance - */ - AccessControlList.prototype.resourceEdges = $util.emptyArray; - - /** - * Creates a new AccessControlList instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList instance - */ - AccessControlList.create = function create(properties) { - return new AccessControlList(properties); - }; - - /** - * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessControlList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resources != null && message.resources.length) - for (var i = 0; i < message.resources.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.accesses != null && message.accesses.length) - for (var i = 0; i < message.accesses.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.encode(message.accesses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceEdges != null && message.resourceEdges.length) - for (var i = 0; i < message.resourceEdges.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessControlList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessControlList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessControlList.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.asset.v1.IamPolicyAnalysisResult.AccessControlList(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.accesses && message.accesses.length)) - message.accesses = []; - message.accesses.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.resourceEdges && message.resourceEdges.length)) - message.resourceEdges = []; - message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessControlList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessControlList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessControlList message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessControlList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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.asset.v1.IamPolicyAnalysisResult.Resource.verify(message.resources[i]); - if (error) - return "resources." + error; - } - } - if (message.accesses != null && message.hasOwnProperty("accesses")) { - if (!Array.isArray(message.accesses)) - return "accesses: array expected"; - for (var i = 0; i < message.accesses.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify(message.accesses[i]); - if (error) - return "accesses." + error; - } - } - if (message.resourceEdges != null && message.hasOwnProperty("resourceEdges")) { - if (!Array.isArray(message.resourceEdges)) - return "resourceEdges: array expected"; - for (var i = 0; i < message.resourceEdges.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify(message.resourceEdges[i]); - if (error) - return "resourceEdges." + error; - } - } - return null; - }; - - /** - * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList - */ - AccessControlList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList(); - if (object.resources) { - if (!Array.isArray(object.resources)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resources: array expected"); - message.resources = []; - for (var i = 0; i < object.resources.length; ++i) { - if (typeof object.resources[i] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resources: object expected"); - message.resources[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.fromObject(object.resources[i]); - } - } - if (object.accesses) { - if (!Array.isArray(object.accesses)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.accesses: array expected"); - message.accesses = []; - for (var i = 0; i < object.accesses.length; ++i) { - if (typeof object.accesses[i] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.accesses: object expected"); - message.accesses[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.fromObject(object.accesses[i]); - } - } - if (object.resourceEdges) { - if (!Array.isArray(object.resourceEdges)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: array expected"); - message.resourceEdges = []; - for (var i = 0; i < object.resourceEdges.length; ++i) { - if (typeof object.resourceEdges[i] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: object expected"); - message.resourceEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); - } - } - return message; - }; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } + return null; + }; - /** - * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} message AccessControlList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessControlList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.resources = []; - object.accesses = []; - object.resourceEdges = []; - } - if (message.resources && message.resources.length) { - object.resources = []; - for (var j = 0; j < message.resources.length; ++j) - object.resources[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.toObject(message.resources[j], options); - } - if (message.accesses && message.accesses.length) { - object.accesses = []; - for (var j = 0; j < message.accesses.length; ++j) - object.accesses[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.toObject(message.accesses[j], options); - } - if (message.resourceEdges && message.resourceEdges.length) { - object.resourceEdges = []; - for (var j = 0; j < message.resourceEdges.length; ++j) - object.resourceEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); - } + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) return object; - }; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } + return message; + }; - /** - * Converts this AccessControlList to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList - * @instance - * @returns {Object.} JSON object - */ - AccessControlList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicySearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; + object.explanation = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + return object; + }; - return AccessControlList; - })(); + /** + * Converts this IamPolicySearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicySearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - IamPolicyAnalysisResult.IdentityList = (function() { + IamPolicySearchResult.Explanation = (function() { /** - * Properties of an IdentityList. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @interface IIdentityList - * @property {Array.|null} [identities] IdentityList identities - * @property {Array.|null} [groupEdges] IdentityList groupEdges + * Properties of an Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions */ /** - * Constructs a new IdentityList. - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult - * @classdesc Represents an IdentityList. - * @implements IIdentityList + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation * @constructor - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set */ - function IdentityList(properties) { - this.identities = []; - this.groupEdges = []; + function Explanation(properties) { + this.matchedPermissions = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13637,94 +7739,97 @@ } /** - * IdentityList identities. - * @member {Array.} identities - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList - * @instance - */ - IdentityList.prototype.identities = $util.emptyArray; - - /** - * IdentityList groupEdges. - * @member {Array.} groupEdges - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @instance */ - IdentityList.prototype.groupEdges = $util.emptyArray; + Explanation.prototype.matchedPermissions = $util.emptyObject; /** - * Creates a new IdentityList instance using the specified properties. + * Creates a new Explanation instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList instance + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance */ - IdentityList.create = function create(properties) { - return new IdentityList(properties); + Explanation.create = function create(properties) { + return new Explanation(properties); }; /** - * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IdentityList.encode = function encode(message, writer) { + Explanation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.identities != null && message.identities.length) - for (var i = 0; i < message.identities.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.encode(message.identities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.groupEdges != null && message.groupEdges.length) - for (var i = 0; i < message.groupEdges.length; ++i) - $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.groupEdges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IdentityList.encodeDelimited = function encodeDelimited(message, writer) { + Explanation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IdentityList message from the specified reader or buffer. + * Decodes an Explanation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IdentityList.decode = function decode(reader, length) { + Explanation.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.asset.v1.IamPolicyAnalysisResult.IdentityList(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.identities && message.identities.length)) - message.identities = []; - message.identities.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.groupEdges && message.groupEdges.length)) - message.groupEdges = []; - message.groupEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; break; default: reader.skipType(tag & 7); @@ -13735,133 +7840,312 @@ }; /** - * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * Decodes an Explanation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IdentityList.decodeDelimited = function decodeDelimited(reader) { + Explanation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IdentityList message. + * Verifies an Explanation message. * @function verify - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IdentityList.verify = function verify(message) { + Explanation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.identities != null && message.hasOwnProperty("identities")) { - if (!Array.isArray(message.identities)) - return "identities: array expected"; - for (var i = 0; i < message.identities.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify(message.identities[i]); - if (error) - return "identities." + error; - } - } - if (message.groupEdges != null && message.hasOwnProperty("groupEdges")) { - if (!Array.isArray(message.groupEdges)) - return "groupEdges: array expected"; - for (var i = 0; i < message.groupEdges.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify(message.groupEdges[i]); + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); if (error) - return "groupEdges." + error; + return "matchedPermissions." + error; } } return null; }; /** - * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation */ - IdentityList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList) + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) return object; - var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList(); - if (object.identities) { - if (!Array.isArray(object.identities)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities: array expected"); - message.identities = []; - for (var i = 0; i < object.identities.length; ++i) { - if (typeof object.identities[i] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities: object expected"); - message.identities[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.fromObject(object.identities[i]); - } - } - if (object.groupEdges) { - if (!Array.isArray(object.groupEdges)) - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: array expected"); - message.groupEdges = []; - for (var i = 0; i < object.groupEdges.length; ++i) { - if (typeof object.groupEdges[i] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: object expected"); - message.groupEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.groupEdges[i]); + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); } } return message; }; /** - * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * Creates a plain object from an Explanation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @static - * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} message IdentityList + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IdentityList.toObject = function toObject(message, options) { + Explanation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.identities = []; - object.groupEdges = []; - } - if (message.identities && message.identities.length) { - object.identities = []; - for (var j = 0; j < message.identities.length; ++j) - object.identities[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.toObject(message.identities[j], options); - } - if (message.groupEdges && message.groupEdges.length) { - object.groupEdges = []; - for (var j = 0; j < message.groupEdges.length; ++j) - object.groupEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.groupEdges[j], options); + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); } return object; }; /** - * Converts this IdentityList to JSON. + * Converts this Explanation to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation * @instance * @returns {Object.} JSON object */ - IdentityList.prototype.toJSON = function toJSON() { + Explanation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return IdentityList; + Explanation.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + this.permissions = []; + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Permissions; + })(); + + return Explanation; })(); - return IamPolicyAnalysisResult; + return IamPolicySearchResult; })(); return v1; @@ -40917,6 +35201,225 @@ return Timestamp; })(); + 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.Struct = (function() { /** @@ -41731,225 +36234,6 @@ return ListValue; })(); - 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() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 258879fcb1a..e4d819f310f 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -97,23 +97,6 @@ "(google.api.http).get": "/v1/{scope=*/*}:searchAllIamPolicies", "(google.api.method_signature)": "scope,query" } - }, - "AnalyzeIamPolicy": { - "requestType": "AnalyzeIamPolicyRequest", - "responseType": "AnalyzeIamPolicyResponse", - "options": { - "(google.api.http).get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" - } - }, - "ExportIamPolicyAnalysis": { - "requestType": "ExportIamPolicyAnalysisRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{analysis_query.scope=*/*}:exportIamPolicyAnalysis", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.ExportIamPolicyAnalysisResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.ExportIamPolicyAnalysisRequest" - } } } }, @@ -547,357 +530,6 @@ } } }, - "IamPolicyAnalysisQuery": { - "fields": { - "scope": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resourceSelector": { - "type": "ResourceSelector", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "identitySelector": { - "type": "IdentitySelector", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "accessSelector": { - "type": "AccessSelector", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "options": { - "type": "Options", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ResourceSelector": { - "fields": { - "fullResourceName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "IdentitySelector": { - "fields": { - "identity": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AccessSelector": { - "fields": { - "roles": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Options": { - "fields": { - "expandGroups": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expandRoles": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expandResources": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputResourceEdges": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputGroupEdges": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "analyzeServiceAccountImpersonation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxFanoutsPerGroup": { - "type": "int32", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxFanoutsPerResource": { - "type": "int32", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "AnalyzeIamPolicyRequest": { - "fields": { - "analysisQuery": { - "type": "IamPolicyAnalysisQuery", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "executionTimeout": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AnalyzeIamPolicyResponse": { - "fields": { - "mainAnalysis": { - "type": "IamPolicyAnalysis", - "id": 1 - }, - "serviceAccountImpersonationAnalysis": { - "rule": "repeated", - "type": "IamPolicyAnalysis", - "id": 2 - }, - "fullyExplored": { - "type": "bool", - "id": 3 - } - }, - "nested": { - "IamPolicyAnalysis": { - "fields": { - "analysisQuery": { - "type": "IamPolicyAnalysisQuery", - "id": 1 - }, - "analysisResults": { - "rule": "repeated", - "type": "IamPolicyAnalysisResult", - "id": 2 - }, - "fullyExplored": { - "type": "bool", - "id": 3 - }, - "stats": { - "rule": "repeated", - "type": "Stats", - "id": 4 - }, - "nonCriticalErrors": { - "rule": "repeated", - "type": "IamPolicyAnalysisState", - "id": 5 - } - }, - "nested": { - "Stats": { - "fields": { - "nodeType": { - "type": "NodeType", - "id": 1 - }, - "nodeSubtype": { - "type": "string", - "id": 2 - }, - "discoveredNodeCount": { - "type": "int32", - "id": 3 - }, - "matchedNodeCount": { - "type": "int32", - "id": 4 - }, - "exploredNodeCount": { - "type": "int32", - "id": 5 - }, - "cappedNodeCount": { - "type": "int32", - "id": 6 - }, - "permisionDeniedNodeCount": { - "type": "int32", - "id": 7 - }, - "executionTimeoutNodeCount": { - "type": "int32", - "id": 8 - } - }, - "nested": { - "NodeType": { - "values": { - "NODE_TYPE_UNSPECIFIED": 0, - "BINDING": 1, - "IDENTITY": 2, - "RESOURCE": 3, - "ACCESS": 4 - } - } - } - } - } - } - } - }, - "IamPolicyAnalysisOutputConfig": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination", - "bigqueryDestination" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 1 - }, - "bigqueryDestination": { - "type": "BigQueryDestination", - "id": 2 - } - }, - "nested": { - "GcsDestination": { - "fields": { - "uri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BigQueryDestination": { - "fields": { - "dataset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "tablePrefix": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "partitionKey": { - "type": "PartitionKey", - "id": 3 - }, - "writeMode": { - "type": "WriteMode", - "id": 4 - } - }, - "nested": { - "PartitionKey": { - "values": { - "PARTITION_KEY_UNSPECIFIED": 0, - "REQUEST_TIME": 1 - } - }, - "WriteMode": { - "values": { - "WRITE_MODE_UNSPECIFIED": 0, - "ABORT": 1, - "OVERWRITE": 2 - } - } - } - } - } - }, - "ExportIamPolicyAnalysisRequest": { - "fields": { - "analysisQuery": { - "type": "IamPolicyAnalysisQuery", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "outputConfig": { - "type": "IamPolicyAnalysisOutputConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportIamPolicyAnalysisResponse": { - "fields": {} - }, "ContentType": { "values": { "CONTENT_TYPE_UNSPECIFIED": 0, @@ -1128,138 +760,6 @@ } } } - }, - "IamPolicyAnalysisState": { - "fields": { - "code": { - "type": "google.rpc.Code", - "id": 1 - }, - "cause": { - "type": "string", - "id": 2 - } - } - }, - "IamPolicyAnalysisResult": { - "fields": { - "attachedResourceFullName": { - "type": "string", - "id": 1 - }, - "iamBinding": { - "type": "google.iam.v1.Binding", - "id": 2 - }, - "accessControlLists": { - "rule": "repeated", - "type": "AccessControlList", - "id": 3 - }, - "identityList": { - "type": "IdentityList", - "id": 4 - }, - "fullyExplored": { - "type": "bool", - "id": 5 - } - }, - "nested": { - "Resource": { - "fields": { - "fullResourceName": { - "type": "string", - "id": 1 - }, - "analysisState": { - "type": "IamPolicyAnalysisState", - "id": 2 - } - } - }, - "Access": { - "oneofs": { - "oneofAccess": { - "oneof": [ - "role", - "permission" - ] - } - }, - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "permission": { - "type": "string", - "id": 2 - }, - "analysisState": { - "type": "IamPolicyAnalysisState", - "id": 3 - } - } - }, - "Identity": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "analysisState": { - "type": "IamPolicyAnalysisState", - "id": 2 - } - } - }, - "Edge": { - "fields": { - "sourceNode": { - "type": "string", - "id": 1 - }, - "targetNode": { - "type": "string", - "id": 2 - } - } - }, - "AccessControlList": { - "fields": { - "resources": { - "rule": "repeated", - "type": "Resource", - "id": 1 - }, - "accesses": { - "rule": "repeated", - "type": "Access", - "id": 2 - }, - "resourceEdges": { - "rule": "repeated", - "type": "Edge", - "id": 3 - } - } - }, - "IdentityList": { - "fields": { - "identities": { - "rule": "repeated", - "type": "Identity", - "id": 1 - }, - "groupEdges": { - "rule": "repeated", - "type": "Edge", - "id": 2 - } - } - } - } } } }, @@ -3918,6 +3418,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Struct": { "fields": { "fields": { @@ -3981,18 +3493,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index c66c325187e..c6827482b5d 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -211,12 +211,6 @@ export class AssetServiceClient { const exportAssetsMetadata = protoFilesRoot.lookup( '.google.cloud.asset.v1.ExportAssetsRequest' ) as gax.protobuf.Type; - const exportIamPolicyAnalysisResponse = protoFilesRoot.lookup( - '.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse' - ) as gax.protobuf.Type; - const exportIamPolicyAnalysisMetadata = protoFilesRoot.lookup( - '.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest' - ) as gax.protobuf.Type; this.descriptors.longrunning = { exportAssets: new this._gaxModule.LongrunningDescriptor( @@ -224,15 +218,6 @@ export class AssetServiceClient { exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) ), - exportIamPolicyAnalysis: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportIamPolicyAnalysisResponse.decode.bind( - exportIamPolicyAnalysisResponse - ), - exportIamPolicyAnalysisMetadata.decode.bind( - exportIamPolicyAnalysisMetadata - ) - ), }; // Put together the default options sent with requests. @@ -290,8 +275,6 @@ export class AssetServiceClient { 'deleteFeed', 'searchAllResources', 'searchAllIamPolicies', - 'analyzeIamPolicy', - 'exportIamPolicyAnalysis', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -917,115 +900,6 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.deleteFeed(request, options, callback); } - analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, - {} | undefined - ] - >; - analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Analyzes IAM policies to answer which identities have what accesses on - * which resources. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery - * The request query. - * @param {google.protobuf.Duration} [request.executionTimeout] - * Amount of time executable has to complete. See JSON representation of - * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). - * - * If this field is set with a value less than the RPC deadline, and the - * execution of your query hasn't finished in the specified - * execution timeout, you will get a response with partial result. - * Otherwise, your query's execution will continue until the RPC deadline. - * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. - * - * Default is empty. - * - * (-- We had discussion of whether we should have this field in the --) - * (-- request or use the RPC deadline instead. We finally choose this --) - * (-- approach for the following reasons (detailed in --) - * (-- go/analyze-iam-policy-deadlines): --) - * (-- * HTTP clients have very limited support of the RPC deadline. --) - * (-- There is an X-Server-Timeout header introduced in 2019/09, but --) - * (-- only implemented in the C++ HTTP server library. --) - * (-- * The purpose of the RPC deadline is for RPC clients to --) - * (-- communicate its max waiting time to the server. This deadline --) - * (-- could be further propagated to the downstream servers. It is --) - * (-- mainly used for servers to cancel the request processing --) - * (-- to avoid resource wasting. Overloading the RPC deadline for --) - * (-- other purposes could make our backend system harder to reason --) - * (-- about. --) - * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1.AnalyzeIamPolicyResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - | protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | 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({ - 'analysis_query.scope': request.analysisQuery!.scope || '', - }); - this.initialize(); - return this.innerApiCalls.analyzeIamPolicy(request, options, callback); - } exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, @@ -1203,154 +1077,6 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest >; } - exportIamPolicyAnalysis( - request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, - options?: gax.CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - exportIamPolicyAnalysis( - request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, - options: gax.CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - exportIamPolicyAnalysis( - request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, - callback: Callback< - LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Exports the answers of which identities have what accesses on which - * resources to a Google Cloud Storage or a BigQuery destination. For Cloud - * Storage destination, the output format is the JSON format that represents a - * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|google.cloud.asset.v1.AnalyzeIamPolicyResponse}. - * This method implements the - * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows - * you to track the export status. We recommend intervals of at least 2 - * seconds with exponential retry to poll the export operation result. The - * metadata contains the request to help callers to map responses to requests. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery - * The request query. - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig - * Output configuration indicating where the results will be output to. - * @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. - */ - exportIamPolicyAnalysis( - request: protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >, - 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({ - 'analysis_query.scope': request.analysisQuery!.scope || '', - }); - this.initialize(); - return this.innerApiCalls.exportIamPolicyAnalysis( - request, - options, - callback - ); - } - /** - * Check the status of the long running operation returned by the exportIamPolicyAnalysis() 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 checkExportIamPolicyAnalysisProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * - */ - async checkExportIamPolicyAnalysisProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - > - > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( - operation, - this.descriptors.longrunning.exportIamPolicyAnalysis, - gax.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.cloud.asset.v1.ExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest - >; - } searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index 897d6d7a2f5..ac06aea1e81 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -6,9 +6,6 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" ] }, "retry_params": { @@ -67,16 +64,6 @@ "timeout_millis": 15000, "retry_codes_name": "idempotent", "retry_params_name": "default" - }, - "AnalyzeIamPolicy": { - "timeout_millis": 300000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ExportIamPolicyAnalysis": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f05995894f5..f14aeb5b2ff 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "6a6e22d61fa2700c42961df03eb6b78c134e83bd" + "sha": "ee124ce650607387263f432adcd2afdb1d6065ee" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "72eb54c45231d84266ca059473bc1793c394fcb2", - "internalRef": "328059685" + "sha": "ef03f63f2f2d3b2dd936e46595c0f746cb10c43c", + "internalRef": "330786980" } }, { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 924643d9483..40976e91e77 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -900,121 +900,6 @@ describe('v1.AssetServiceClient', () => { }); }); - describe('analyzeIamPolicy', () => { - it('invokes analyzeIamPolicy without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() - ); - client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.analyzeIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes analyzeIamPolicy without error using callback', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() - ); - client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.analyzeIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes analyzeIamPolicy with error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.analyzeIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.analyzeIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.analyzeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); - describe('exportAssets', () => { it('invokes exportAssets without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ @@ -1206,209 +1091,6 @@ describe('v1.AssetServiceClient', () => { }); }); - describe('exportIamPolicyAnalysis', () => { - it('invokes exportIamPolicyAnalysis without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( - expectedResponse - ); - const [operation] = await client.exportIamPolicyAnalysis(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes exportIamPolicyAnalysis without error using callback', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.exportIamPolicyAnalysis( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisResponse, - protos.google.cloud.asset.v1.IExportIamPolicyAnalysisRequest - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes exportIamPolicyAnalysis with call error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects( - client.exportIamPolicyAnalysis(request), - expectedError - ); - assert( - (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes exportIamPolicyAnalysis with LRO error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportIamPolicyAnalysisRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.exportIamPolicyAnalysis(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportIamPolicyAnalysis as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkExportIamPolicyAnalysisProgress without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - 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.checkExportIamPolicyAnalysisProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportIamPolicyAnalysisProgress with error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - 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.checkExportIamPolicyAnalysisProgress(''), - expectedError - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - describe('searchAllResources', () => { it('invokes searchAllResources without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ From 6272f96cf183b29f0acb80365aa31f50ce18164a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 20:16:20 -0700 Subject: [PATCH 266/429] build(test): recursively find test files; fail on unsupported dependency versions (#397) Source-Author: Megan Potter <57276408+feywind@users.noreply.github.com> Source-Date: Fri Sep 11 18:47:00 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: fdd03c161003ab97657cc0218f25c82c89ddf4b6 Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-asset/.mocharc.js | 3 ++- packages/google-cloud-asset/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/.mocharc.js b/packages/google-cloud-asset/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-asset/.mocharc.js +++ b/packages/google-cloud-asset/.mocharc.js @@ -14,7 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index f14aeb5b2ff..96c9eb419fc 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "ee124ce650607387263f432adcd2afdb1d6065ee" + "sha": "1d45e05b9241ba18fd906d5c9ac87653e1cc795d" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From 0fa856ec71f3dbf7ae838697eda9620db8ffb21a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2020 11:11:31 -0700 Subject: [PATCH 267/429] chore: release 3.7.1 (#396) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 00a874abb0b..0cc6f82e24d 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,19 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.7.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.7.0...v3.7.1) (2020-09-13) + + +### ⚠ BREAKING CHANGES + +* remove unused AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs (#393) + +### Bug Fixes + +* remove unused AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs ([#393](https://www.github.com/googleapis/nodejs-asset/issues/393)) ([5994b6c](https://www.github.com/googleapis/nodejs-asset/commit/5994b6c74705e71d660f60fbbbfa55fa21b6251f)) +* remove unused AnalyzeIamPolicy and ExportIamPolicyAnalysis RPCs ([#395](https://www.github.com/googleapis/nodejs-asset/issues/395)) ([1d45e05](https://www.github.com/googleapis/nodejs-asset/commit/1d45e05b9241ba18fd906d5c9ac87653e1cc795d)) +* **deps:** update dependency yargs to v16 ([#391](https://www.github.com/googleapis/nodejs-asset/issues/391)) ([ee124ce](https://www.github.com/googleapis/nodejs-asset/commit/ee124ce650607387263f432adcd2afdb1d6065ee)) + ## [3.7.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.6.0...v3.7.0) (2020-08-24) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1ed6be6eed5..39a00951406 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.7.0", + "version": "3.7.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index f7415c4794f..de205377e24 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.7.0", + "@google-cloud/asset": "^3.7.1", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 9bc3782b40ab81b06861c9af2f538cd86bba7604 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 16 Sep 2020 07:58:34 -0700 Subject: [PATCH 268/429] feat: added support for per type and partition export for Cloud Asset API (#398) Clients can now specify two more args when export assets to bigquery PiperOrigin-RevId: 331912851 Source-Author: Google APIs Source-Date: Tue Sep 15 20:04:02 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 5e53d6b6dde0e72fa9510ec1d796176d128afa40 Source-Link: https://github.com/googleapis/googleapis/commit/5e53d6b6dde0e72fa9510ec1d796176d128afa40 --- .../google/cloud/asset/v1/asset_service.proto | 77 +++++ .../google-cloud-asset/protos/protos.d.ts | 112 ++++++++ packages/google-cloud-asset/protos/protos.js | 270 ++++++++++++++++++ .../google-cloud-asset/protos/protos.json | 25 ++ packages/google-cloud-asset/synth.metadata | 6 +- 5 files changed, 487 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 4aa3ee74ee2..6b66d4444dc 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -393,6 +393,83 @@ message BigQueryDestination { // is `FALSE` or unset and the destination table already exists, the export // call returns an INVALID_ARGUMEMT error. bool force = 3; + + // [partition_spec] determines whether to export to partitioned table(s) and + // how to partition the data. + // + // If [partition_spec] is unset or [partition_spec.partion_key] is unset or + // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + // non-partitioned table(s). [force] will decide whether to overwrite existing + // table(s). + // + // If [partition_spec] is specified. First, the snapshot results will be + // written to partitioned table(s) with two additional timestamp columns, + // readTime and requestTime, one of which will be the partition key. Secondly, + // in the case when any destination table already exists, it will first try to + // update existing table's schema as necessary by appending additional + // columns. Then, if [force] is `TRUE`, the corresponding partition will be + // overwritten by the snapshot results (data in different partitions will + // remain intact); if [force] is unset or `FALSE`, it will append the data. An + // error will be returned if the schema update or data appension fails. + PartitionSpec partition_spec = 4; + + // If this flag is `TRUE`, the snapshot results will be written to one or + // multiple tables, each of which contains results of one asset type. The + // [force] and [partition_spec] fields will apply to each of them. + // + // Field [table] will be concatenated with "_" and the asset type names (see + // https://cloud.google.com/asset-inventory/docs/supported-asset-types for + // supported asset types) to construct per-asset-type table names, in which + // all non-alphanumeric characters like "." and "/" will be substituted by + // "_". Example: if field [table] is "mytable" and snapshot results + // contain "storage.googleapis.com/Bucket" assets, the corresponding table + // name will be "mytable_storage_googleapis_com_Bucket". If any of these + // tables does not exist, a new table with the concatenated name will be + // created. + // + // When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + // each table will include RECORD-type columns mapped to the nested fields in + // the Asset.resource.data field of that asset type (up to the 15 nested level + // BigQuery supports + // (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + // fields in >15 nested levels will be stored in JSON format string as a child + // column of its parent RECORD column. + // + // If error occurs when exporting to any table, the whole export call will + // return an error but the export results that already succeed will persist. + // Example: if exporting to table_type_A succeeds when exporting to + // table_type_B fails during one export call, the results in table_type_A will + // persist and there will not be partial results persisting in a table. + bool separate_tables_per_asset_type = 5; +} + +// Specifications of BigQuery partitioned table as export destination. +message PartitionSpec { + // This enum is used to determine the partition key column when exporting + // assets to BigQuery partitioned table(s). Note that, if the partition key is + // a timestamp column, the actual partition is based on its date value + // (expressed in UTC. see details in + // https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables). + enum PartitionKey { + // Unspecified partition key. If used, it means using non-partitioned table. + PARTITION_KEY_UNSPECIFIED = 0; + + // The time when the snapshot is taken. If specified as partition key, the + // result table(s) is partitoned by the additional timestamp column, + // readTime. If [read_time] in ExportAssetsRequest is specified, the + // readTime column's value will be the same as it. Otherwise, its value will + // be the current time that is used to take the snapshot. + READ_TIME = 1; + + // The time when the request is received and started to be processed. If + // specified as partition key, the result table(s) is partitoned by the + // requestTime column, an additional timestamp column representing when the + // request was received. + REQUEST_TIME = 2; + } + + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 1; } // A Pub/Sub destination. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 5e5c844f96b..66662cd6888 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1603,6 +1603,12 @@ export namespace google { /** BigQueryDestination force */ force?: (boolean|null); + + /** BigQueryDestination partitionSpec */ + partitionSpec?: (google.cloud.asset.v1.IPartitionSpec|null); + + /** BigQueryDestination separateTablesPerAssetType */ + separateTablesPerAssetType?: (boolean|null); } /** Represents a BigQueryDestination. */ @@ -1623,6 +1629,12 @@ export namespace google { /** BigQueryDestination force. */ public force: boolean; + /** BigQueryDestination partitionSpec. */ + public partitionSpec?: (google.cloud.asset.v1.IPartitionSpec|null); + + /** BigQueryDestination separateTablesPerAssetType. */ + public separateTablesPerAssetType: boolean; + /** * Creates a new BigQueryDestination instance using the specified properties. * @param [properties] Properties to set @@ -1694,6 +1706,106 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a PartitionSpec. */ + interface IPartitionSpec { + + /** PartitionSpec partitionKey */ + partitionKey?: (google.cloud.asset.v1.PartitionSpec.PartitionKey|keyof typeof google.cloud.asset.v1.PartitionSpec.PartitionKey|null); + } + + /** Represents a PartitionSpec. */ + class PartitionSpec implements IPartitionSpec { + + /** + * Constructs a new PartitionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IPartitionSpec); + + /** PartitionSpec partitionKey. */ + public partitionKey: (google.cloud.asset.v1.PartitionSpec.PartitionKey|keyof typeof google.cloud.asset.v1.PartitionSpec.PartitionKey); + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionSpec instance + */ + public static create(properties?: google.cloud.asset.v1.IPartitionSpec): google.cloud.asset.v1.PartitionSpec; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @param message PartitionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IPartitionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @param message PartitionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IPartitionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionSpec + * @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.asset.v1.PartitionSpec; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionSpec + * @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.asset.v1.PartitionSpec; + + /** + * Verifies a PartitionSpec 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 PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PartitionSpec; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @param message PartitionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.PartitionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PartitionSpec { + + /** PartitionKey enum. */ + enum PartitionKey { + PARTITION_KEY_UNSPECIFIED = 0, + READ_TIME = 1, + REQUEST_TIME = 2 + } + } + /** Properties of a PubsubDestination. */ interface IPubsubDestination { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 75251f38f6e..525014aec75 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -3615,6 +3615,8 @@ * @property {string|null} [dataset] BigQueryDestination dataset * @property {string|null} [table] BigQueryDestination table * @property {boolean|null} [force] BigQueryDestination force + * @property {google.cloud.asset.v1.IPartitionSpec|null} [partitionSpec] BigQueryDestination partitionSpec + * @property {boolean|null} [separateTablesPerAssetType] BigQueryDestination separateTablesPerAssetType */ /** @@ -3656,6 +3658,22 @@ */ BigQueryDestination.prototype.force = false; + /** + * BigQueryDestination partitionSpec. + * @member {google.cloud.asset.v1.IPartitionSpec|null|undefined} partitionSpec + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.partitionSpec = null; + + /** + * BigQueryDestination separateTablesPerAssetType. + * @member {boolean} separateTablesPerAssetType + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.separateTablesPerAssetType = false; + /** * Creates a new BigQueryDestination instance using the specified properties. * @function create @@ -3686,6 +3704,10 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); if (message.force != null && Object.hasOwnProperty.call(message, "force")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.partitionSpec != null && Object.hasOwnProperty.call(message, "partitionSpec")) + $root.google.cloud.asset.v1.PartitionSpec.encode(message.partitionSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.separateTablesPerAssetType != null && Object.hasOwnProperty.call(message, "separateTablesPerAssetType")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.separateTablesPerAssetType); return writer; }; @@ -3729,6 +3751,12 @@ case 3: message.force = reader.bool(); break; + case 4: + message.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.decode(reader, reader.uint32()); + break; + case 5: + message.separateTablesPerAssetType = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -3773,6 +3801,14 @@ if (message.force != null && message.hasOwnProperty("force")) if (typeof message.force !== "boolean") return "force: boolean expected"; + if (message.partitionSpec != null && message.hasOwnProperty("partitionSpec")) { + var error = $root.google.cloud.asset.v1.PartitionSpec.verify(message.partitionSpec); + if (error) + return "partitionSpec." + error; + } + if (message.separateTablesPerAssetType != null && message.hasOwnProperty("separateTablesPerAssetType")) + if (typeof message.separateTablesPerAssetType !== "boolean") + return "separateTablesPerAssetType: boolean expected"; return null; }; @@ -3794,6 +3830,13 @@ message.table = String(object.table); if (object.force != null) message.force = Boolean(object.force); + if (object.partitionSpec != null) { + if (typeof object.partitionSpec !== "object") + throw TypeError(".google.cloud.asset.v1.BigQueryDestination.partitionSpec: object expected"); + message.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.fromObject(object.partitionSpec); + } + if (object.separateTablesPerAssetType != null) + message.separateTablesPerAssetType = Boolean(object.separateTablesPerAssetType); return message; }; @@ -3814,6 +3857,8 @@ object.dataset = ""; object.table = ""; object.force = false; + object.partitionSpec = null; + object.separateTablesPerAssetType = false; } if (message.dataset != null && message.hasOwnProperty("dataset")) object.dataset = message.dataset; @@ -3821,6 +3866,10 @@ object.table = message.table; if (message.force != null && message.hasOwnProperty("force")) object.force = message.force; + if (message.partitionSpec != null && message.hasOwnProperty("partitionSpec")) + object.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.toObject(message.partitionSpec, options); + if (message.separateTablesPerAssetType != null && message.hasOwnProperty("separateTablesPerAssetType")) + object.separateTablesPerAssetType = message.separateTablesPerAssetType; return object; }; @@ -3838,6 +3887,227 @@ return BigQueryDestination; })(); + v1.PartitionSpec = (function() { + + /** + * Properties of a PartitionSpec. + * @memberof google.cloud.asset.v1 + * @interface IPartitionSpec + * @property {google.cloud.asset.v1.PartitionSpec.PartitionKey|null} [partitionKey] PartitionSpec partitionKey + */ + + /** + * Constructs a new PartitionSpec. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a PartitionSpec. + * @implements IPartitionSpec + * @constructor + * @param {google.cloud.asset.v1.IPartitionSpec=} [properties] Properties to set + */ + function PartitionSpec(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]]; + } + + /** + * PartitionSpec partitionKey. + * @member {google.cloud.asset.v1.PartitionSpec.PartitionKey} partitionKey + * @memberof google.cloud.asset.v1.PartitionSpec + * @instance + */ + PartitionSpec.prototype.partitionKey = 0; + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.IPartitionSpec=} [properties] Properties to set + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec instance + */ + PartitionSpec.create = function create(properties) { + return new PartitionSpec(properties); + }; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partitionKey); + return writer; + }; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.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.asset.v1.PartitionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.partitionKey = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionSpec message. + * @function verify + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + switch (message.partitionKey) { + default: + return "partitionKey: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec + */ + PartitionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.PartitionSpec) + return object; + var message = new $root.google.cloud.asset.v1.PartitionSpec(); + switch (object.partitionKey) { + case "PARTITION_KEY_UNSPECIFIED": + case 0: + message.partitionKey = 0; + break; + case "READ_TIME": + case 1: + message.partitionKey = 1; + break; + case "REQUEST_TIME": + case 2: + message.partitionKey = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.PartitionSpec} message PartitionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.PartitionSpec.PartitionKey[message.partitionKey] : message.partitionKey; + return object; + }; + + /** + * Converts this PartitionSpec to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.PartitionSpec + * @instance + * @returns {Object.} JSON object + */ + PartitionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PartitionKey enum. + * @name google.cloud.asset.v1.PartitionSpec.PartitionKey + * @enum {number} + * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value + * @property {number} READ_TIME=1 READ_TIME value + * @property {number} REQUEST_TIME=2 REQUEST_TIME value + */ + PartitionSpec.PartitionKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_TIME"] = 1; + values[valuesById[2] = "REQUEST_TIME"] = 2; + return values; + })(); + + return PartitionSpec; + })(); + v1.PubsubDestination = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index e4d819f310f..d982a76543b 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -358,6 +358,31 @@ "force": { "type": "bool", "id": 3 + }, + "partitionSpec": { + "type": "PartitionSpec", + "id": 4 + }, + "separateTablesPerAssetType": { + "type": "bool", + "id": 5 + } + } + }, + "PartitionSpec": { + "fields": { + "partitionKey": { + "type": "PartitionKey", + "id": 1 + } + }, + "nested": { + "PartitionKey": { + "values": { + "PARTITION_KEY_UNSPECIFIED": 0, + "READ_TIME": 1, + "REQUEST_TIME": 2 + } } } }, diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 96c9eb419fc..d11546680f1 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "1d45e05b9241ba18fd906d5c9ac87653e1cc795d" + "sha": "1c1eb901a33c78ff2271651f53df165f6fab42b5" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ef03f63f2f2d3b2dd936e46595c0f746cb10c43c", - "internalRef": "330786980" + "sha": "5e53d6b6dde0e72fa9510ec1d796176d128afa40", + "internalRef": "331912851" } }, { From be6292c8775f1ec864488cd77aa5d480ac8f6ea7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2020 07:39:12 -0700 Subject: [PATCH 269/429] chore: release 3.8.0 (#399) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 0cc6f82e24d..6b15e3a7d9a 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.8.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.7.1...v3.8.0) (2020-09-16) + + +### Features + +* added support for per type and partition export for Cloud Asset API ([#398](https://www.github.com/googleapis/nodejs-asset/issues/398)) ([6462767](https://www.github.com/googleapis/nodejs-asset/commit/64627674e3e23e79ff055ea845d884e8714ad023)) + ### [3.7.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.7.0...v3.7.1) (2020-09-13) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 39a00951406..e1cfffc43b7 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.7.1", + "version": "3.8.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index de205377e24..6fc46a324ec 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.7.1", + "@google-cloud/asset": "^3.8.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From cd3ddc610dab9d188950c5d7ff040b823737b6c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Oct 2020 04:33:06 -0700 Subject: [PATCH 270/429] chore: update bucket for cloud-rad (#401) Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Source-Author: F. Hinkelmann Source-Date: Wed Sep 30 14:13:57 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 079dcce498117f9570cebe6e6cff254b38ba3860 Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index d11546680f1..dbbf6ec7654 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "1c1eb901a33c78ff2271651f53df165f6fab42b5" + "sha": "5832a00924b5b2637003f6949805903225fcacfc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From 07047441eaa9bb036963dd575e73ca4378cb7dd9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:54 -0700 Subject: [PATCH 271/429] build(node_library): migrate to Trampoline V2 (#402) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e2b098f4-76c4-4fe5-820c-ae293231f7bd/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 --- packages/google-cloud-asset/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index dbbf6ec7654..93bb84d89da 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "5832a00924b5b2637003f6949805903225fcacfc" + "sha": "d2b27fc846b873e02ba4121ff8a1ed0156c2d679" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -120,10 +120,12 @@ ".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", From a0727793ca5a31fb57928340d673e9bfa81cf0b0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:56:17 +0200 Subject: [PATCH 272/429] chore(deps): update dependency webpack-cli to v4 (#405) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.11` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index e1cfffc43b7..6a1c2acd93a 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -66,7 +66,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.42.0", - "webpack-cli": "^3.3.11", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" } From c0b3a3979b5d3c3f582544d052c491768cf7a4c9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:02:35 +0200 Subject: [PATCH 273/429] chore(deps): update dependency webpack to v5 (#404) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.42.0` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 6a1c2acd93a..80cb06a1ca9 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -65,7 +65,7 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack": "^4.42.0", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From a358ff03a79c26fe9decea3cf317a23814cb52bc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 09:06:11 -0700 Subject: [PATCH 274/429] build: only check --engine-strict for production deps (#406) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/220288a4-7076-443b-9721-9f71deddc661/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 93bb84d89da..8ea20fba080 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "d2b27fc846b873e02ba4121ff8a1ed0156c2d679" + "sha": "18d6522d9b0b8362700ce1171417fb23e2c704bc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 9b64c6221c1aad4054eb4ab53a8fc05b6ae9532c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 11:20:40 -0700 Subject: [PATCH 275/429] chore: clean up Node.js TOC for cloud-rad (#407) * chore: clean up Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 09:26:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 * chore: fix Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 12:01:24 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 8ea20fba080..10b697115dc 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "18d6522d9b0b8362700ce1171417fb23e2c704bc" + "sha": "c13b930fc5f71792cf3651091ac4ad779c84effb" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From a9c3d26737dd74089df2598572b39f34e7f582a0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 08:38:42 -0700 Subject: [PATCH 276/429] docs: updated code of conduct (includes update to actions) (#411) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/6dcea365-b918-4c52-b1db-d7a62c956000/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89c849ba5013e45e8fb688b138f33c2ec6083dc5 Source-Link: https://github.com/googleapis/synthtool/commit/a783321fd55f010709294455584a553f4b24b944 Source-Link: https://github.com/googleapis/synthtool/commit/b7413d38b763827c72c0360f0a3d286c84656eeb Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 --- .../google-cloud-asset/CODE_OF_CONDUCT.md | 123 +++++++++++++----- packages/google-cloud-asset/synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-asset/CODE_OF_CONDUCT.md b/packages/google-cloud-asset/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-asset/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-asset/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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 10b697115dc..de18035618a 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "c13b930fc5f71792cf3651091ac4ad779c84effb" + "sha": "10fcb7a234816f801d19edf3bd66c505741273b7" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From 74cdda88d6677e21c522502e307221e36ee2c180 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 09:29:27 -0800 Subject: [PATCH 277/429] feat: add AnalyzeIamPolicy and AnalyzeIamPolicyLongrunning RPCs (#412) PiperOrigin-RevId: 339708980 Source-Author: Google APIs Source-Date: Thu Oct 29 11:23:44 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 00bbad4dfd6633cf4b5f9596c1f93b756bb5c776 Source-Link: https://github.com/googleapis/googleapis/commit/00bbad4dfd6633cf4b5f9596c1f93b756bb5c776 --- .../google/cloud/asset/v1/asset_service.proto | 315 + .../protos/google/cloud/asset/v1/assets.proto | 145 + .../google-cloud-asset/protos/protos.d.ts | 3317 ++++-- packages/google-cloud-asset/protos/protos.js | 9169 +++++++++++++---- .../google-cloud-asset/protos/protos.json | 428 + .../src/v1/asset_service_client.ts | 259 + .../src/v1/asset_service_client_config.json | 13 + packages/google-cloud-asset/synth.metadata | 6 +- .../test/gapic_asset_service_v1.ts | 318 + 9 files changed, 11405 insertions(+), 2565 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 6b66d4444dc..c5873958ad4 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -138,6 +138,34 @@ service AssetService { }; option (google.api.method_signature) = "scope,query"; } + + // Analyzes IAM policies to answer which identities have what accesses on + // which resources. + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) { + option (google.api.http) = { + get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + }; + } + + // Analyzes IAM policies asynchronously to answer which identities have what + // accesses on which resources, and writes the analysis results to a Google + // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the + // output format is the JSON format that represents a + // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the + // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation + // status. We recommend intervals of at least 2 seconds with exponential + // backoff retry to poll the operation result. The metadata contains the + // request to help callers to map responses to requests. + rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse" + metadata_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" + }; + } } // Export asset request. @@ -715,6 +743,293 @@ message SearchAllIamPoliciesResponse { string next_page_token = 2; } +// IAM policy analysis query message. +message IamPolicyAnalysisQuery { + // Specifies the resource to analyze for access policies, which may be set + // directly on the resource, or on ancestors such as organizations, folders or + // projects. + message ResourceSelector { + // Required. The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of a resource of [supported resource + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies an identity for which to determine resource access, based on + // roles assigned either directly to them or to the groups they belong to, + // directly or indirectly. + message IdentitySelector { + // Required. The identity appear in the form of members in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + // + // The examples of supported forms are: + // "user:mike@example.com", + // "group:admins@example.com", + // "domain:google.com", + // "serviceAccount:my-project-id@appspot.gserviceaccount.com". + // + // Notice that wildcard characters (such as * and ?) are not supported. + // You must give a specific identity. + string identity = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies roles and/or permissions to analyze, to determine both the + // identities possessing them and the resources they control. If multiple + // values are specified, results will include roles or permissions matching + // any of them. The total number of roles and permissions should be equal or + // less than 10. + message AccessSelector { + // Optional. The roles to appear in result. + repeated string roles = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The permissions to appear in result. + repeated string permissions = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Contains query options. + message Options { + // Optional. If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] is specified, the + // identity in the result will be determined by the selector, and this flag + // is not allowed to set. + // + // Default is false. + bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the access section of result will expand any roles + // appearing in IAM policy bindings to include their permissions. + // + // If [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] is specified, the access + // section of the result will be determined by the selector, and this flag + // is not allowed to set. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is not + // specified, the resource section of the result will expand any resource + // attached to an IAM policy to include resources lower in the resource + // hierarchy. + // + // For example, if the request analyzes for which resources user A has + // permission P, and the results include an IAM policy with P on a GCP + // folder, the results will also include resources in that folder with + // permission P. + // + // If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is specified, + // the resource section of the result will expand the specified resource to + // include resources lower in the resource hierarchy. Only project or + // lower resources are supported. Folder and organization resource cannot be + // used together with this option. + // + // For example, if the request analyzes for which users have permission P on + // a GCP project with this option enabled, the results will include all + // users who have permission P on that project or any lower resource. + // + // Default is false. + bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output resource edges, starting + // from the policy attached resource, to any expanded resources. + // Default is false. + bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output group identity edges, starting + // from the binding's group members, to any expanded identities. + // Default is false. + bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the response will include access analysis from identities to + // resources via service account impersonation. This is a very expensive + // operation, because many derived queries will be executed. We highly + // recommend you use [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc + // instead. + // + // For example, if the request analyzes for which resources user A has + // permission P, and there's an IAM policy states user A has + // iam.serviceAccounts.getAccessToken permission to a service account SA, + // and there's another IAM policy states service account SA has permission P + // to a GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a GCP folder F, and there's an IAM policy states user A + // has iam.serviceAccounts.actAs permission to a service account SA, and + // there's another IAM policy states service account SA has permission P to + // the GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Default is false. + bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The relative name of the root asset. Only resources and IAM policies within + // the scope will be analyzed. + // + // This can only be an organization number (such as "organizations/123"), a + // folder number (such as "folders/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + // + // To know how to get organization id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // To know how to get folder or project id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies a resource for analysis. + ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies an identity for analysis. + IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies roles or permissions for analysis. This is optional. + AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The query options. + Options options = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyRequest { + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Amount of time executable has to complete. See JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + // + // If this field is set with a value less than the RPC deadline, and the + // execution of your query hasn't finished in the specified + // execution timeout, you will get a response with partial result. + // Otherwise, your query's execution will continue until the RPC deadline. + // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + // + // Default is empty. + google.protobuf.Duration execution_timeout = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyResponse { + // An analysis message to group the query and results. + message IamPolicyAnalysis { + // The analysis query. + IamPolicyAnalysisQuery analysis_query = 1; + + // A list of [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] that matches the analysis query, or + // empty if no result is found. + repeated IamPolicyAnalysisResult analysis_results = 2; + + // Represents whether all entries in the [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been + // fully explored to answer the query. + bool fully_explored = 3; + + // A list of non-critical errors happened during the query handling. + repeated IamPolicyAnalysisState non_critical_errors = 5; + } + + // The main analysis that matches the original request. + IamPolicyAnalysis main_analysis = 1; + + // The service account impersonation analysis if + // [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + // enabled. + repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; + + // Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and + // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to + // answer the query in the request. + bool fully_explored = 3; +} + +// Output configuration for export IAM policy analysis destination. +message IamPolicyAnalysisOutputConfig { + // A Cloud Storage location. + message GcsDestination { + // Required. The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. For example: "gs://bucket_name/object_name". See + // [Quickstart: Using the gsutil tool] + // (https://cloud.google.com/storage/docs/quickstart-gsutil) for examples. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A BigQuery destination. + message BigQueryDestination { + // This enum determines the partition key column for the bigquery tables. + // Partitioning can improve query performance and reduce query cost by + // filtering partitions. Refer to + // https://cloud.google.com/bigquery/docs/partitioned-tables for details. + enum PartitionKey { + // Unspecified partition key. Tables won't be partitioned using this + // option. + PARTITION_KEY_UNSPECIFIED = 0; + + // The time when the request is received. If specified as partition key, + // the result table(s) is partitoned by the RequestTime column, an + // additional timestamp column representing when the request was received. + REQUEST_TIME = 1; + } + + // Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", + // to which the analysis results should be exported. If this dataset does + // not exist, the export call will return an INVALID_ARGUMENT error. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The prefix of the BigQuery tables to which the analysis results will be + // written. Tables will be created based on this table_prefix if not exist: + // * _analysis table will contain export operation's metadata. + // * _analysis_result will contain all the + // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. + // When [partition_key] is specified, both tables will be partitioned based + // on the [partition_key]. + string table_prefix = 2 [(google.api.field_behavior) = REQUIRED]; + + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 3; + + // Optional. Specifies the action that occurs if the destination table or partition + // already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + // overwrites the entire table or all the partitions data. + // * WRITE_APPEND: If the table or partition already exists, BigQuery + // appends the data to the table or the latest partition. + // * WRITE_EMPTY: If the table already exists and contains data, an error is + // returned. + // + // The default value is WRITE_APPEND. Each action is atomic and only occurs + // if BigQuery is able to complete the job successfully. Details are at + // https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. + string write_disposition = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // IAM policy analysis export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on BigQuery. + BigQueryDestination bigquery_destination = 2; + } +} + +// A request message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningRequest { + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Output configuration indicating where the results will be output to. + IamPolicyAnalysisOutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningResponse {} + // Asset content type. enum ContentType { // Unspecified content type. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index b9d56744e16..c06caf71a7d 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -378,3 +378,148 @@ message IamPolicySearchResult { // information to explain why the search result matches the query. Explanation explanation = 4; } + +// Represents the detailed state of an entity under analysis, such as a +// resource, an identity or an access. +message IamPolicyAnalysisState { + // The Google standard error code that best describes the state. + // For example: + // - OK means the analysis on this entity has been successfully finished; + // - PERMISSION_DENIED means an access denied error is encountered; + // - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + // in time; + google.rpc.Code code = 1; + + // The human-readable description of the cause of failure. + string cause = 2; +} + +// IAM Policy analysis result, consisting of one IAM policy binding and derived +// access control lists. +message IamPolicyAnalysisResult { + // A Google Cloud resource under analysis. + message Resource { + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + string full_resource_name = 1; + + // The analysis state of this resource. + IamPolicyAnalysisState analysis_state = 2; + } + + // An IAM role or permission under analysis. + message Access { + oneof oneof_access { + // The role. + string role = 1; + + // The permission. + string permission = 2; + } + + // The analysis state of this access. + IamPolicyAnalysisState analysis_state = 3; + } + + // An identity under analysis. + message Identity { + // The identity name in any form of members appear in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such + // as: + // - user:foo@google.com + // - group:group1@google.com + // - serviceAccount:s1@prj1.iam.gserviceaccount.com + // - projectOwner:some_project_id + // - domain:google.com + // - allUsers + // - etc. + string name = 1; + + // The analysis state of this identity. + IamPolicyAnalysisState analysis_state = 2; + } + + // A directional edge. + message Edge { + // The source node of the edge. For example, it could be a full resource + // name for a resource node or an email of an identity. + string source_node = 1; + + // The target node of the edge. For example, it could be a full resource + // name for a resource node or an email of an identity. + string target_node = 2; + } + + // An access control list, derived from the above IAM policy binding, which + // contains a set of resources and accesses. May include one + // item from each set to compose an access control entry. + // + // NOTICE that there could be multiple access control lists for one IAM policy + // binding. The access control lists are created based on resource and access + // combinations. + // + // For example, assume we have the following cases in one IAM policy binding: + // - Permission P1 and P2 apply to resource R1 and R2; + // - Permission P3 applies to resource R2 and R3; + // + // This will result in the following access control lists: + // - AccessControlList 1: [R1, R2], [P1, P2] + // - AccessControlList 2: [R2, R3], [P3] + message AccessControlList { + // The resources that match one of the following conditions: + // - The resource_selector, if it is specified in request; + // - Otherwise, resources reachable from the policy attached resource. + repeated Resource resources = 1; + + // The accesses that match one of the following conditions: + // - The access_selector, if it is specified in request; + // - Otherwise, access specifiers reachable from the policy binding's role. + repeated Access accesses = 2; + + // Resource edges of the graph starting from the policy attached + // resource to any descendant resources. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] contains + // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // contains the full resource name of a child resource. This field is + // present only if the output_resource_edges option is enabled in request. + repeated Edge resource_edges = 3; + } + + // The identities and group edges. + message IdentityList { + // Only the identities that match one of the following conditions will be + // presented: + // - The identity_selector, if it is specified in request; + // - Otherwise, identities reachable from the policy binding's members. + repeated Identity identities = 1; + + // Group identity edges of the graph starting from the binding's + // group members to any node of the [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // contains a group, such as `group:parent@google.com`. The + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] contains a member of the group, + // such as `group:child@google.com` or `user:foo@google.com`. + // This field is present only if the output_group_edges option is enabled in + // request. + repeated Edge group_edges = 2; + } + + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the resource to which the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] policy attaches. + string attached_resource_full_name = 1; + + // The Cloud IAM policy binding under analysis. + google.iam.v1.Binding iam_binding = 2; + + // The access control lists derived from the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match resource and access selectors specified in the request. + repeated AccessControlList access_control_lists = 3; + + // The identity list derived from members of the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match identity selector specified in the request. + IdentityList identity_list = 4; + + // Represents whether all analyses on the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] have successfully + // finished. + bool fully_explored = 5; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 66662cd6888..7ed21b94829 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -171,6 +171,34 @@ export namespace google { * @returns Promise */ public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): Promise; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + */ + public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback): void; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): Promise; + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @param request AnalyzeIamPolicyLongrunningRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public analyzeIamPolicyLongrunning(request: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunningCallback): void; + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @param request AnalyzeIamPolicyLongrunningRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicyLongrunning(request: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest): Promise; } namespace AssetService { @@ -237,6 +265,20 @@ export namespace google { * @param [response] SearchAllIamPoliciesResponse */ type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllIamPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. + * @param error Error, if any + * @param [response] AnalyzeIamPolicyResponse + */ + type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeIamPolicyResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicyLongrunning}. + * @param error Error, if any + * @param [response] Operation + */ + type AnalyzeIamPolicyLongrunningCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of an ExportAssetsRequest. */ @@ -2529,939 +2571,3054 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { + /** Properties of an IamPolicyAnalysisQuery. */ + interface IIamPolicyAnalysisQuery { - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); + /** IamPolicyAnalysisQuery scope */ + scope?: (string|null); - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** IamPolicyAnalysisQuery resourceSelector */ + resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery identitySelector */ + identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); - /** TemporalAsset priorAssetState */ - priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + /** IamPolicyAnalysisQuery accessSelector */ + accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); - /** TemporalAsset priorAsset */ - priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery options */ + options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an IamPolicyAnalysisQuery. */ + class IamPolicyAnalysisQuery implements IIamPolicyAnalysisQuery { /** - * Constructs a new TemporalAsset. + * Constructs a new IamPolicyAnalysisQuery. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery); - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + /** IamPolicyAnalysisQuery scope. */ + public scope: string; - /** TemporalAsset deleted. */ - public deleted: boolean; + /** IamPolicyAnalysisQuery resourceSelector. */ + public resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery identitySelector. */ + public identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); - /** TemporalAsset priorAssetState. */ - public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + /** IamPolicyAnalysisQuery accessSelector. */ + public accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); - /** TemporalAsset priorAsset. */ - public priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** IamPolicyAnalysisQuery options. */ + public options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns IamPolicyAnalysisQuery instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns IamPolicyAnalysisQuery * @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.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns IamPolicyAnalysisQuery * @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.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Verifies a TemporalAsset message. + * Verifies an IamPolicyAnalysisQuery 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns IamPolicyAnalysisQuery */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this IamPolicyAnalysisQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace TemporalAsset { + namespace IamPolicyAnalysisQuery { - /** PriorAssetState enum. */ - enum PriorAssetState { - PRIOR_ASSET_STATE_UNSPECIFIED = 0, - PRESENT = 1, - INVALID = 2, - DOES_NOT_EXIST = 3, - DELETED = 4 + /** Properties of a ResourceSelector. */ + interface IResourceSelector { + + /** ResourceSelector fullResourceName */ + fullResourceName?: (string|null); } - } - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** Represents a ResourceSelector. */ + class ResourceSelector implements IResourceSelector { - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new ResourceSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } + /** ResourceSelector fullResourceName. */ + public fullResourceName: string; - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** + * Creates a new ResourceSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSelector instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * Constructs a new TimeWindow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSelector + * @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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * Creates a new TimeWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeWindow instance - */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSelector + * @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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a ResourceSelector 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); - /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; - /** - * 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.asset.v1.TimeWindow; + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @param message ResourceSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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.asset.v1.TimeWindow; + /** + * Converts this ResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of an IdentitySelector. */ + interface IIdentitySelector { - /** - * 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.asset.v1.TimeWindow; + /** IdentitySelector identity */ + identity?: (string|null); + } - /** - * 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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an IdentitySelector. */ + class IdentitySelector implements IIdentitySelector { - /** - * Converts this TimeWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new IdentitySelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector); - /** Properties of an Asset. */ - interface IAsset { + /** IdentitySelector identity. */ + public identity: string; - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new IdentitySelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentitySelector instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset name */ - name?: (string|null); + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset assetType */ - assetType?: (string|null); + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentitySelector + * @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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentitySelector + * @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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + /** + * Verifies an IdentitySelector 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); - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** + * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentitySelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @param message IdentitySelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** + * Converts this IdentitySelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Asset ancestors */ - ancestors?: (string[]|null); - } + /** Properties of an AccessSelector. */ + interface IAccessSelector { - /** Represents an Asset. */ - class Asset implements IAsset { + /** AccessSelector roles */ + roles?: (string[]|null); - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAsset); + /** AccessSelector permissions */ + permissions?: (string[]|null); + } - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** Represents an AccessSelector. */ + class AccessSelector implements IAccessSelector { - /** Asset name. */ - public name: string; + /** + * Constructs a new AccessSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector); - /** Asset assetType. */ - public assetType: string; + /** AccessSelector roles. */ + public roles: string[]; - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); + /** AccessSelector permissions. */ + public permissions: string[]; - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** + * Creates a new AccessSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSelector instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** Asset orgPolicy. */ - public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset accessPolicy. */ - public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset accessLevel. */ - public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSelector + * @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.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** Asset servicePerimeter. */ - public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSelector + * @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.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** Asset ancestors. */ - public ancestors: string[]; + /** + * Verifies an AccessSelector 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); - /** Asset accessContextPolicy. */ - public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + /** + * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @param message AccessSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this AccessSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an Options. */ + interface IOptions { - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @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.asset.v1.Asset; + /** Options expandGroups */ + expandGroups?: (boolean|null); - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @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.asset.v1.Asset; + /** Options expandRoles */ + expandRoles?: (boolean|null); - /** - * Verifies an Asset 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); + /** Options expandResources */ + expandResources?: (boolean|null); - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + /** Options outputResourceEdges */ + outputResourceEdges?: (boolean|null); - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Options outputGroupEdges */ + outputGroupEdges?: (boolean|null); - /** - * Converts this Asset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Options analyzeServiceAccountImpersonation */ + analyzeServiceAccountImpersonation?: (boolean|null); + } - /** Properties of a Resource. */ - interface IResource { + /** Represents an Options. */ + class Options implements IOptions { - /** Resource version */ - version?: (string|null); + /** + * Constructs a new Options. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions); - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Options expandGroups. */ + public expandGroups: boolean; - /** Resource discoveryName */ - discoveryName?: (string|null); + /** Options expandRoles. */ + public expandRoles: boolean; - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** Options expandResources. */ + public expandResources: boolean; - /** Resource parent */ - parent?: (string|null); + /** Options outputResourceEdges. */ + public outputResourceEdges: boolean; - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** Options outputGroupEdges. */ + public outputGroupEdges: boolean; - /** Resource location */ - location?: (string|null); - } + /** Options analyzeServiceAccountImpersonation. */ + public analyzeServiceAccountImpersonation: boolean; - /** Represents a Resource. */ - class Resource implements IResource { + /** + * Creates a new Options instance using the specified properties. + * @param [properties] Properties to set + * @returns Options instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IResource); + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Resource version. */ - public version: string; + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** + * Decodes an Options message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Options + * @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.asset.v1.IamPolicyAnalysisQuery.Options; - /** Resource discoveryName. */ - public discoveryName: string; + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Options + * @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.asset.v1.IamPolicyAnalysisQuery.Options; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** + * Verifies an Options 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); - /** Resource parent. */ - public parent: string; + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Options + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @param message Options + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Resource location. */ - public location: string; + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeIamPolicyRequest. */ + interface IAnalyzeIamPolicyRequest { + + /** AnalyzeIamPolicyRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an AnalyzeIamPolicyRequest. */ + class AnalyzeIamPolicyRequest implements IAnalyzeIamPolicyRequest { /** - * Creates a new Resource instance using the specified properties. + * Constructs a new AnalyzeIamPolicyRequest. * @param [properties] Properties to set - * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest); + + /** AnalyzeIamPolicyRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): google.cloud.asset.v1.AnalyzeIamPolicyRequest; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns AnalyzeIamPolicyRequest * @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.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyRequest; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns AnalyzeIamPolicyRequest * @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.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyRequest; /** - * Verifies a Resource message. + * Verifies an AnalyzeIamPolicyRequest 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns AnalyzeIamPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyRequest; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this AnalyzeIamPolicyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceSearchResult. */ - interface IResourceSearchResult { - - /** ResourceSearchResult name */ - name?: (string|null); - - /** ResourceSearchResult assetType */ - assetType?: (string|null); - - /** ResourceSearchResult project */ - project?: (string|null); - - /** ResourceSearchResult displayName */ - displayName?: (string|null); - - /** ResourceSearchResult description */ - description?: (string|null); - - /** ResourceSearchResult location */ - location?: (string|null); + /** Properties of an AnalyzeIamPolicyResponse. */ + interface IAnalyzeIamPolicyResponse { - /** ResourceSearchResult labels */ - labels?: ({ [k: string]: string }|null); + /** AnalyzeIamPolicyResponse mainAnalysis */ + mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); - /** ResourceSearchResult networkTags */ - networkTags?: (string[]|null); + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis */ + serviceAccountImpersonationAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]|null); - /** ResourceSearchResult additionalAttributes */ - additionalAttributes?: (google.protobuf.IStruct|null); + /** AnalyzeIamPolicyResponse fullyExplored */ + fullyExplored?: (boolean|null); } - /** Represents a ResourceSearchResult. */ - class ResourceSearchResult implements IResourceSearchResult { + /** Represents an AnalyzeIamPolicyResponse. */ + class AnalyzeIamPolicyResponse implements IAnalyzeIamPolicyResponse { /** - * Constructs a new ResourceSearchResult. + * Constructs a new AnalyzeIamPolicyResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse); - /** ResourceSearchResult name. */ - public name: string; - - /** ResourceSearchResult assetType. */ - public assetType: string; + /** AnalyzeIamPolicyResponse mainAnalysis. */ + public mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); - /** ResourceSearchResult project. */ - public project: string; + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. */ + public serviceAccountImpersonationAnalysis: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]; - /** ResourceSearchResult displayName. */ - public displayName: string; + /** AnalyzeIamPolicyResponse fullyExplored. */ + public fullyExplored: boolean; - /** ResourceSearchResult description. */ - public description: string; + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse): google.cloud.asset.v1.AnalyzeIamPolicyResponse; - /** ResourceSearchResult location. */ - public location: string; - - /** ResourceSearchResult labels. */ - public labels: { [k: string]: string }; - - /** ResourceSearchResult networkTags. */ - public networkTags: string[]; - - /** ResourceSearchResult additionalAttributes. */ - public additionalAttributes?: (google.protobuf.IStruct|null); - - /** - * Creates a new ResourceSearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceSearchResult instance - */ - public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; - - /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceSearchResult + * @returns AnalyzeIamPolicyResponse * @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.asset.v1.ResourceSearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceSearchResult + * @returns AnalyzeIamPolicyResponse * @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.asset.v1.ResourceSearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Verifies a ResourceSearchResult message. + * Verifies an AnalyzeIamPolicyResponse 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceSearchResult + * @returns AnalyzeIamPolicyResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse; /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @param message ResourceSearchResult + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceSearchResult to JSON. + * Converts this AnalyzeIamPolicyResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an IamPolicySearchResult. */ - interface IIamPolicySearchResult { + namespace AnalyzeIamPolicyResponse { - /** IamPolicySearchResult resource */ - resource?: (string|null); + /** Properties of an IamPolicyAnalysis. */ + interface IIamPolicyAnalysis { - /** IamPolicySearchResult project */ - project?: (string|null); + /** IamPolicyAnalysis analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); - /** IamPolicySearchResult policy */ - policy?: (google.iam.v1.IPolicy|null); + /** IamPolicyAnalysis analysisResults */ + analysisResults?: (google.cloud.asset.v1.IIamPolicyAnalysisResult[]|null); - /** IamPolicySearchResult explanation */ - explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** IamPolicyAnalysis fullyExplored */ + fullyExplored?: (boolean|null); + + /** IamPolicyAnalysis nonCriticalErrors */ + nonCriticalErrors?: (google.cloud.asset.v1.IIamPolicyAnalysisState[]|null); + } + + /** Represents an IamPolicyAnalysis. */ + class IamPolicyAnalysis implements IIamPolicyAnalysis { + + /** + * Constructs a new IamPolicyAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis); + + /** IamPolicyAnalysis analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults. */ + public analysisResults: google.cloud.asset.v1.IIamPolicyAnalysisResult[]; + + /** IamPolicyAnalysis fullyExplored. */ + public fullyExplored: boolean; + + /** IamPolicyAnalysis nonCriticalErrors. */ + public nonCriticalErrors: google.cloud.asset.v1.IIamPolicyAnalysisState[]; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysis instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysis + * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysis + * @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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Verifies an IamPolicyAnalysis 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 IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @param message IamPolicyAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Represents an IamPolicySearchResult. */ - class IamPolicySearchResult implements IIamPolicySearchResult { + /** Properties of an IamPolicyAnalysisOutputConfig. */ + interface IIamPolicyAnalysisOutputConfig { + + /** IamPolicyAnalysisOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + + /** IamPolicyAnalysisOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); + } + + /** Represents an IamPolicyAnalysisOutputConfig. */ + class IamPolicyAnalysisOutputConfig implements IIamPolicyAnalysisOutputConfig { /** - * Constructs a new IamPolicySearchResult. + * Constructs a new IamPolicyAnalysisOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); - - /** IamPolicySearchResult resource. */ - public resource: string; + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig); - /** IamPolicySearchResult project. */ - public project: string; + /** IamPolicyAnalysisOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); - /** IamPolicySearchResult policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** IamPolicyAnalysisOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); - /** IamPolicySearchResult explanation. */ - public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** IamPolicyAnalysisOutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); /** - * Creates a new IamPolicySearchResult instance using the specified properties. + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicySearchResult instance + * @returns IamPolicyAnalysisOutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicySearchResult + * @returns IamPolicyAnalysisOutputConfig * @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.asset.v1.IamPolicySearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicySearchResult + * @returns IamPolicyAnalysisOutputConfig * @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.asset.v1.IamPolicySearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Verifies an IamPolicyAnalysisOutputConfig 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 IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisOutputConfig { + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination tablePrefix */ + tablePrefix?: (string|null); + + /** BigQueryDestination partitionKey */ + partitionKey?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null); + + /** BigQueryDestination writeDisposition */ + writeDisposition?: (string|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination tablePrefix. */ + public tablePrefix: string; + + /** BigQueryDestination partitionKey. */ + public partitionKey: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey); + + /** BigQueryDestination writeDisposition. */ + public writeDisposition: string; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Verifies a BigQueryDestination 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 BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BigQueryDestination { + + /** PartitionKey enum. */ + enum PartitionKey { + PARTITION_KEY_UNSPECIFIED = 0, + REQUEST_TIME = 1 + } + } + } + + /** Properties of an AnalyzeIamPolicyLongrunningRequest. */ + interface IAnalyzeIamPolicyLongrunningRequest { + + /** AnalyzeIamPolicyLongrunningRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyLongrunningRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an AnalyzeIamPolicyLongrunningRequest. */ + class AnalyzeIamPolicyLongrunningRequest implements IAnalyzeIamPolicyLongrunningRequest { + + /** + * Constructs a new AnalyzeIamPolicyLongrunningRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest); + + /** AnalyzeIamPolicyLongrunningRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyLongrunningRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new AnalyzeIamPolicyLongrunningRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyLongrunningRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyLongrunningRequest + * @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.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyLongrunningRequest + * @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.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Verifies an AnalyzeIamPolicyLongrunningRequest 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 AnalyzeIamPolicyLongrunningRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyLongrunningRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningRequest message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyLongrunningRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyLongrunningRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnalyzeIamPolicyLongrunningResponse. */ + interface IAnalyzeIamPolicyLongrunningResponse { + } + + /** Represents an AnalyzeIamPolicyLongrunningResponse. */ + class AnalyzeIamPolicyLongrunningResponse implements IAnalyzeIamPolicyLongrunningResponse { + + /** + * Constructs a new AnalyzeIamPolicyLongrunningResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse); + + /** + * Creates a new AnalyzeIamPolicyLongrunningResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyLongrunningResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyLongrunningResponse + * @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.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyLongrunningResponse + * @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.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Verifies an AnalyzeIamPolicyLongrunningResponse 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 AnalyzeIamPolicyLongrunningResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyLongrunningResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningResponse message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyLongrunningResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyLongrunningResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TemporalAsset { + + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } + + /** 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.asset.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.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @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.asset.v1.Asset; + + /** + * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + + /** Resource location */ + location?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** Resource location. */ + public location: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { + + /** ResourceSearchResult name */ + name?: (string|null); + + /** ResourceSearchResult assetType */ + assetType?: (string|null); + + /** ResourceSearchResult project */ + project?: (string|null); + + /** ResourceSearchResult displayName */ + displayName?: (string|null); + + /** ResourceSearchResult description */ + description?: (string|null); + + /** ResourceSearchResult location */ + location?: (string|null); + + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); + + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + } + + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { + + /** + * Constructs a new ResourceSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Verifies a ResourceSearchResult 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Explanation { + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of an IamPolicyAnalysisState. */ + interface IIamPolicyAnalysisState { + + /** IamPolicyAnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** IamPolicyAnalysisState cause */ + cause?: (string|null); + } + + /** Represents an IamPolicyAnalysisState. */ + class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + + /** + * Constructs a new IamPolicyAnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + + /** IamPolicyAnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** IamPolicyAnalysisState cause. */ + public cause: string; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisState + * @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.asset.v1.IamPolicyAnalysisState; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisState + * @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.asset.v1.IamPolicyAnalysisState; + + /** + * Verifies an IamPolicyAnalysisState 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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicyAnalysisResult. */ + interface IIamPolicyAnalysisResult { + + /** IamPolicyAnalysisResult attachedResourceFullName */ + attachedResourceFullName?: (string|null); + + /** IamPolicyAnalysisResult iamBinding */ + iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists */ + accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysisResult. */ + class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + + /** + * Constructs a new IamPolicyAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisResult + * @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.asset.v1.IamPolicyAnalysisResult; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisResult + * @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.asset.v1.IamPolicyAnalysisResult; + + /** + * Verifies an IamPolicyAnalysisResult 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Access. */ + interface IAccess { + + /** Access role */ + role?: (string|null); + + /** Access permission */ + permission?: (string|null); + + /** Access analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess); + + /** Access role. */ + public role: string; + + /** Access permission. */ + public permission: string; + + /** Access analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** Access oneofAccess. */ + public oneofAccess?: ("role"|"permission"); + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @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.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @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.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Verifies an Access 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 Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Identity. */ + interface IIdentity { + + /** Identity name */ + name?: (string|null); + + /** Identity analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents an Identity. */ + class Identity implements IIdentity { + + /** + * Constructs a new Identity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity); + + /** Identity name. */ + public name: string; + + /** Identity analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Identity instance using the specified properties. + * @param [properties] Properties to set + * @returns Identity instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Identity + * @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.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Identity + * @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.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Verifies an Identity 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 Identity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Identity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @param message Identity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Identity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Edge. */ + interface IEdge { + + /** Edge sourceNode */ + sourceNode?: (string|null); + + /** Edge targetNode */ + targetNode?: (string|null); + } + + /** Represents an Edge. */ + class Edge implements IEdge { + + /** + * Constructs a new Edge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge); + + /** Edge sourceNode. */ + public sourceNode: string; + + /** Edge targetNode. */ + public targetNode: string; + + /** + * Creates a new Edge instance using the specified properties. + * @param [properties] Properties to set + * @returns Edge instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Edge + * @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.asset.v1.IamPolicyAnalysisResult.Edge; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Edge + * @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.asset.v1.IamPolicyAnalysisResult.Edge; - /** - * Verifies an IamPolicySearchResult 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); + /** + * Verifies an Edge 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IamPolicySearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + /** + * Creates an Edge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Edge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @param message IamPolicySearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @param message Edge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Edge, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this IamPolicySearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Edge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - namespace IamPolicySearchResult { + /** Properties of an AccessControlList. */ + interface IAccessControlList { - /** Properties of an Explanation. */ - interface IExplanation { + /** AccessControlList resources */ + resources?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]|null); - /** Explanation matchedPermissions */ - matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + /** AccessControlList accesses */ + accesses?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]|null); + + /** AccessControlList resourceEdges */ + resourceEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); } - /** Represents an Explanation. */ - class Explanation implements IExplanation { + /** Represents an AccessControlList. */ + class AccessControlList implements IAccessControlList { /** - * Constructs a new Explanation. + * Constructs a new AccessControlList. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList); - /** Explanation matchedPermissions. */ - public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + /** AccessControlList resources. */ + public resources: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]; + + /** AccessControlList accesses. */ + public accesses: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]; + + /** AccessControlList resourceEdges. */ + public resourceEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; /** - * Creates a new Explanation instance using the specified properties. + * Creates a new AccessControlList instance using the specified properties. * @param [properties] Properties to set - * @returns Explanation instance + * @returns AccessControlList instance */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Explanation message from the specified reader or buffer. + * Decodes an AccessControlList message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Explanation + * @returns AccessControlList * @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.asset.v1.IamPolicySearchResult.Explanation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Explanation + * @returns AccessControlList * @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.asset.v1.IamPolicySearchResult.Explanation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Verifies an Explanation message. + * Verifies an AccessControlList 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 Explanation message from a plain object. Also converts values to their respective internal types. + * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Explanation + * @returns AccessControlList */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. - * @param message Explanation + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @param message AccessControlList * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Explanation to JSON. + * Converts this AccessControlList to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Explanation { + /** Properties of an IdentityList. */ + interface IIdentityList { - /** Properties of a Permissions. */ - interface IPermissions { + /** IdentityList identities */ + identities?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]|null); - /** Permissions permissions */ - permissions?: (string[]|null); - } + /** IdentityList groupEdges */ + groupEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); + } - /** Represents a Permissions. */ - class Permissions implements IPermissions { + /** Represents an IdentityList. */ + class IdentityList implements IIdentityList { - /** - * Constructs a new Permissions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + /** + * Constructs a new IdentityList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList); - /** Permissions permissions. */ - public permissions: string[]; + /** IdentityList identities. */ + public identities: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]; - /** - * Creates a new Permissions instance using the specified properties. - * @param [properties] Properties to set - * @returns Permissions instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** IdentityList groupEdges. */ + public groupEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new IdentityList instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityList instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Permissions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** + * Decodes an IdentityList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityList + * @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.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Verifies a Permissions 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); + /** + * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityList + * @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.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Creates a Permissions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Permissions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + /** + * Verifies an IdentityList 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 plain object from a Permissions message. Also converts values to other types if specified. - * @param message Permissions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; - /** - * Converts this Permissions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * @param message IdentityList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 525014aec75..c77b139d6f5 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -395,6 +395,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} [response] AnalyzeIamPolicyResponse + */ + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback} callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeIamPolicy = function analyzeIamPolicy(request, callback) { + return this.rpcCall(analyzeIamPolicy, $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest, $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse, request, callback); + }, "name", { value: "AnalyzeIamPolicy" }); + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicyLongrunning}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeIamPolicyLongrunningCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @function analyzeIamPolicyLongrunning + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} request AnalyzeIamPolicyLongrunningRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunningCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeIamPolicyLongrunning = function analyzeIamPolicyLongrunning(request, callback) { + return this.rpcCall(analyzeIamPolicyLongrunning, $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnalyzeIamPolicyLongrunning" }); + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @function analyzeIamPolicyLongrunning + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} request AnalyzeIamPolicyLongrunningRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); @@ -5907,48 +5973,28 @@ return SearchAllIamPoliciesResponse; })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; - })(); - - v1.TemporalAsset = (function() { + v1.IamPolicyAnalysisQuery = (function() { /** - * Properties of a TemporalAsset. + * Properties of an IamPolicyAnalysisQuery. * @memberof google.cloud.asset.v1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset - * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState - * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset + * @interface IIamPolicyAnalysisQuery + * @property {string|null} [scope] IamPolicyAnalysisQuery scope + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null} [resourceSelector] IamPolicyAnalysisQuery resourceSelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null} [options] IamPolicyAnalysisQuery options */ /** - * Constructs a new TemporalAsset. + * Constructs a new IamPolicyAnalysisQuery. * @memberof google.cloud.asset.v1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents an IamPolicyAnalysisQuery. + * @implements IIamPolicyAnalysisQuery * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set */ - function TemporalAsset(properties) { + function IamPolicyAnalysisQuery(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5956,127 +6002,127 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.window = null; + IamPolicyAnalysisQuery.prototype.scope = ""; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery resourceSelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null|undefined} resourceSelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.deleted = false; + IamPolicyAnalysisQuery.prototype.resourceSelector = null; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery identitySelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null|undefined} identitySelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.asset = null; + IamPolicyAnalysisQuery.prototype.identitySelector = null; /** - * TemporalAsset priorAssetState. - * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery accessSelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null|undefined} accessSelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.priorAssetState = 0; + IamPolicyAnalysisQuery.prototype.accessSelector = null; /** - * TemporalAsset priorAsset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset - * @memberof google.cloud.asset.v1.TemporalAsset + * IamPolicyAnalysisQuery options. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance */ - TemporalAsset.prototype.priorAsset = null; + IamPolicyAnalysisQuery.prototype.options = null; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + IamPolicyAnalysisQuery.create = function create(properties) { + return new IamPolicyAnalysisQuery(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + IamPolicyAnalysisQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && Object.hasOwnProperty.call(message, "window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); - if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) - $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identitySelector != null && Object.hasOwnProperty.call(message, "identitySelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accessSelector != null && Object.hasOwnProperty.call(message, "accessSelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.encode(message.options, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + IamPolicyAnalysisQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + IamPolicyAnalysisQuery.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.asset.v1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + message.scope = reader.string(); break; case 2: - message.deleted = reader.bool(); + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); break; case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); break; case 4: - message.priorAssetState = reader.int32(); + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); break; case 5: - message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6087,1247 +6133,1297 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + IamPolicyAnalysisQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies an IamPolicyAnalysisQuery message. * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + IamPolicyAnalysisQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify(message.resourceSelector); if (error) - return "window." + error; + return "resourceSelector." + error; } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify(message.identitySelector); if (error) - return "asset." + error; + return "identitySelector." + error; } - if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - switch (message.priorAssetState) { - default: - return "priorAssetState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify(message.accessSelector); if (error) - return "priorAsset." + error; + return "accessSelector." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify(message.options); + if (error) + return "options." + error; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + IamPolicyAnalysisQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery) return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.resourceSelector != null) { + if (typeof object.resourceSelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.resourceSelector: object expected"); + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.fromObject(object.resourceSelector); } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + if (object.identitySelector != null) { + if (typeof object.identitySelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.identitySelector: object expected"); + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.fromObject(object.identitySelector); } - switch (object.priorAssetState) { - case "PRIOR_ASSET_STATE_UNSPECIFIED": - case 0: - message.priorAssetState = 0; - break; - case "PRESENT": - case 1: - message.priorAssetState = 1; - break; - case "INVALID": - case 2: - message.priorAssetState = 2; - break; - case "DOES_NOT_EXIST": - case 3: - message.priorAssetState = 3; - break; - case "DELETED": - case 4: - message.priorAssetState = 4; - break; + if (object.accessSelector != null) { + if (typeof object.accessSelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.accessSelector: object expected"); + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.fromObject(object.accessSelector); } - if (object.priorAsset != null) { - if (typeof object.priorAsset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); - message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.options: object expected"); + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.fromObject(object.options); } return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} message IamPolicyAnalysisQuery * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + IamPolicyAnalysisQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; - object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; - object.priorAsset = null; + object.scope = ""; + object.resourceSelector = null; + object.identitySelector = null; + object.accessSelector = null; + object.options = null; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); - if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; - if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) - object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + object.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.toObject(message.resourceSelector, options); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + object.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.toObject(message.identitySelector, options); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + object.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.toObject(message.options, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this IamPolicyAnalysisQuery to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + IamPolicyAnalysisQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * PriorAssetState enum. - * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState - * @enum {number} - * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value - * @property {number} PRESENT=1 PRESENT value - * @property {number} INVALID=2 INVALID value - * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value - * @property {number} DELETED=4 DELETED value - */ - TemporalAsset.PriorAssetState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRESENT"] = 1; - values[valuesById[2] = "INVALID"] = 2; - values[valuesById[3] = "DOES_NOT_EXIST"] = 3; - values[valuesById[4] = "DELETED"] = 4; - return values; - })(); + IamPolicyAnalysisQuery.ResourceSelector = (function() { - return TemporalAsset; - })(); + /** + * Properties of a ResourceSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IResourceSelector + * @property {string|null} [fullResourceName] ResourceSelector fullResourceName + */ - v1.TimeWindow = (function() { + /** + * Constructs a new ResourceSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents a ResourceSelector. + * @implements IResourceSelector + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + */ + function ResourceSelector(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 TimeWindow. - * @memberof google.cloud.asset.v1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime - */ + /** + * ResourceSelector fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + */ + ResourceSelector.prototype.fullResourceName = ""; - /** - * Constructs a new TimeWindow. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow - * @constructor - * @param {google.cloud.asset.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]]; - } + /** + * Creates a new ResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector instance + */ + ResourceSelector.create = function create(properties) { + return new ResourceSelector(properties); + }; - /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow - * @instance - */ - TimeWindow.prototype.startTime = null; + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + return writer; + }; - /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow - * @instance - */ - TimeWindow.prototype.endTime = null; + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new TimeWindow instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance - */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); - }; + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.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.asset.v1.IamPolicyAnalysisQuery.ResourceSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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; - }; + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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(); - }; + /** + * Verifies a ResourceSelector message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + return null; + }; - /** - * Decodes a TimeWindow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.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.asset.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.asset.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.asset.v1.TimeWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.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.asset.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 ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + */ + ResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + return message; + }; - /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow - */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} message ResourceSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow - * @static - * @param {google.cloud.asset.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 ResourceSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + * @returns {Object.} JSON object + */ + ResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this TimeWindow to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.TimeWindow - * @instance - * @returns {Object.} JSON object - */ - TimeWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ResourceSelector; + })(); - return TimeWindow; - })(); + IamPolicyAnalysisQuery.IdentitySelector = (function() { - v1.Asset = (function() { + /** + * Properties of an IdentitySelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IIdentitySelector + * @property {string|null} [identity] IdentitySelector identity + */ - /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1 - * @interface IAsset - * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [orgPolicy] Asset orgPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy - * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel - * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter - * @property {Array.|null} [ancestors] Asset ancestors - */ + /** + * Constructs a new IdentitySelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an IdentitySelector. + * @implements IIdentitySelector + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + */ + function IdentitySelector(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]]; + } - /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - */ - function Asset(properties) { - this.orgPolicy = []; - this.ancestors = []; - 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]]; - } + /** + * IdentitySelector identity. + * @member {string} identity + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + */ + IdentitySelector.prototype.identity = ""; - /** - * Asset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.updateTime = null; + /** + * Creates a new IdentitySelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector instance + */ + IdentitySelector.create = function create(properties) { + return new IdentitySelector(properties); + }; - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.name = ""; + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity); + return writer; + }; - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.assetType = ""; + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.resource = null; + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.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.asset.v1.IamPolicyAnalysisQuery.IdentitySelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.iamPolicy = null; + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Asset orgPolicy. - * @member {Array.} orgPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.orgPolicy = $util.emptyArray; + /** + * Verifies an IdentitySelector message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitySelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + return null; + }; - /** - * Asset accessPolicy. - * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessPolicy = null; + /** + * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + */ + IdentitySelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector(); + if (object.identity != null) + message.identity = String(object.identity); + return message; + }; - /** - * Asset accessLevel. - * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.accessLevel = null; + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} message IdentitySelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitySelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.identity = ""; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + return object; + }; - /** - * Asset servicePerimeter. - * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.servicePerimeter = null; + /** + * Converts this IdentitySelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + * @returns {Object.} JSON object + */ + IdentitySelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.ancestors = $util.emptyArray; + return IdentitySelector; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + IamPolicyAnalysisQuery.AccessSelector = (function() { - /** - * Asset accessContextPolicy. - * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Object.defineProperty(Asset.prototype, "accessContextPolicy", { - get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Properties of an AccessSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IAccessSelector + * @property {Array.|null} [roles] AccessSelector roles + * @property {Array.|null} [permissions] AccessSelector permissions + */ - /** - * Creates a new Asset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance - */ - Asset.create = function create(properties) { - return new Asset(properties); - }; + /** + * Constructs a new AccessSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an AccessSelector. + * @implements IAccessSelector + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + */ + function AccessSelector(properties) { + this.roles = []; + this.permissions = []; + 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 Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.orgPolicy != null && message.orgPolicy.length) - for (var i = 0; i < message.orgPolicy.length; ++i) - $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) - $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) - $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) - $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; + /** + * AccessSelector roles. + * @member {Array.} roles + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.roles = $util.emptyArray; - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * AccessSelector permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.permissions = $util.emptyArray; - /** - * Decodes an Asset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Asset.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.asset.v1.Asset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.orgPolicy && message.orgPolicy.length)) - message.orgPolicy = []; - message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); - break; - case 7: - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); - break; - case 8: - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); - break; - case 9: - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new AccessSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector instance + */ + AccessSelector.create = function create(properties) { + return new AccessSelector(properties); + }; - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Asset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.roles[i]); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; - /** - * Verifies an Asset message. - * @function verify - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Asset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { - if (!Array.isArray(message.orgPolicy)) - return "orgPolicy: array expected"; - for (var i = 0; i < message.orgPolicy.length; ++i) { - var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); - if (error) - return "orgPolicy." + error; - } - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); - if (error) - return "accessPolicy." + error; + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.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.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + case 2: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); - if (error) - return "accessLevel." + error; + return message; + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSelector message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + if (!$util.isString(message.roles[i])) + return "roles: string[] expected"; } - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - if (properties.accessContextPolicy === 1) - return "accessContextPolicy: multiple values"; - properties.accessContextPolicy = 1; - { - var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); - if (error) - return "servicePerimeter." + error; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; } - } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; - } - return null; - }; + return null; + }; - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset - */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) - return object; - var message = new $root.google.cloud.asset.v1.Asset(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.orgPolicy) { - if (!Array.isArray(object.orgPolicy)) - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); - message.orgPolicy = []; - for (var i = 0; i < object.orgPolicy.length; ++i) { - if (typeof object.orgPolicy[i] !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); - message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + /** + * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + */ + AccessSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + message.roles[i] = String(object.roles[i]); } - } - if (object.accessPolicy != null) { - if (typeof object.accessPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); - } - if (object.accessLevel != null) { - if (typeof object.accessLevel !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); - } - if (object.servicePerimeter != null) { - if (typeof object.servicePerimeter !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); - } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } - return message; - }; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.Asset - * @static - * @param {google.cloud.asset.v1.Asset} message Asset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Asset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.orgPolicy = []; - object.ancestors = []; - } - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.orgPolicy && message.orgPolicy.length) { - object.orgPolicy = []; - for (var j = 0; j < message.orgPolicy.length; ++j) - object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); - } - if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { - object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); - if (options.oneofs) - object.accessContextPolicy = "accessPolicy"; - } - if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { - object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); - if (options.oneofs) - object.accessContextPolicy = "accessLevel"; - } - if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { - object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); - if (options.oneofs) - object.accessContextPolicy = "servicePerimeter"; - } - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - return object; - }; + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; - /** - * Converts this Asset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.Asset - * @instance - * @returns {Object.} JSON object - */ - Asset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} message AccessSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.roles = []; + object.permissions = []; + } + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = message.roles[j]; + } + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; - return Asset; - })(); + /** + * Converts this AccessSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + * @returns {Object.} JSON object + */ + AccessSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.Resource = (function() { + return AccessSelector; + })(); - /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - * @property {string|null} [location] Resource location - */ + IamPolicyAnalysisQuery.Options = (function() { - /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - */ - function Resource(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 Options. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IOptions + * @property {boolean|null} [expandGroups] Options expandGroups + * @property {boolean|null} [expandRoles] Options expandRoles + * @property {boolean|null} [expandResources] Options expandResources + * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges + * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges + * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation + */ - /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.version = ""; + /** + * Constructs a new Options. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set + */ + function Options(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]]; + } - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; + /** + * Options expandGroups. + * @member {boolean} expandGroups + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandGroups = false; - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandRoles = false; - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandResources = false; - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.parent = ""; + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; - /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.data = null; + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; - /** - * Resource location. - * @member {string} location - * @memberof google.cloud.asset.v1.Resource - * @instance - */ - Resource.prototype.location = ""; + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); - return writer; - }; + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandGroups != null && Object.hasOwnProperty.call(message, "expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && Object.hasOwnProperty.call(message, "expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && Object.hasOwnProperty.call(message, "expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && Object.hasOwnProperty.call(message, "outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && Object.hasOwnProperty.call(message, "outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && Object.hasOwnProperty.call(message, "analyzeServiceAccountImpersonation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); + return writer; + }; - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.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.asset.v1.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 8: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an Options message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.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.asset.v1.IamPolicyAnalysisQuery.Options(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandGroups = reader.bool(); + break; + case 2: + message.expandRoles = reader.bool(); + break; + case 3: + message.expandResources = reader.bool(); + break; + case 4: + message.outputResourceEdges = reader.bool(); + break; + case 5: + message.outputGroupEdges = reader.bool(); + break; + case 6: + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Options message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Options.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (typeof message.expandGroups !== "boolean") + return "expandGroups: boolean expected"; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (typeof message.expandRoles !== "boolean") + return "expandRoles: boolean expected"; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (typeof message.expandResources !== "boolean") + return "expandResources: boolean expected"; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (typeof message.outputResourceEdges !== "boolean") + return "outputResourceEdges: boolean expected"; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (typeof message.outputGroupEdges !== "boolean") + return "outputGroupEdges: boolean expected"; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (typeof message.analyzeServiceAccountImpersonation !== "boolean") + return "analyzeServiceAccountImpersonation: boolean expected"; + return null; + }; + + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options(); + if (object.expandGroups != null) + message.expandGroups = Boolean(object.expandGroups); + if (object.expandRoles != null) + message.expandRoles = Boolean(object.expandRoles); + if (object.expandResources != null) + message.expandResources = Boolean(object.expandResources); + if (object.outputResourceEdges != null) + message.outputResourceEdges = Boolean(object.outputResourceEdges); + if (object.outputGroupEdges != null) + message.outputGroupEdges = Boolean(object.outputGroupEdges); + if (object.analyzeServiceAccountImpersonation != null) + message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); + return message; + }; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} message Options + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Options.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandGroups = false; + object.expandRoles = false; + object.expandResources = false; + object.outputResourceEdges = false; + object.outputGroupEdges = false; + object.analyzeServiceAccountImpersonation = false; + } + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + object.expandGroups = message.expandGroups; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + object.expandRoles = message.expandRoles; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + object.expandResources = message.expandResources; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + object.outputResourceEdges = message.outputResourceEdges; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + object.outputGroupEdges = message.outputGroupEdges; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; + return object; + }; + + /** + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + return IamPolicyAnalysisQuery; + })(); + + v1.AnalyzeIamPolicyRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyRequest + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {google.protobuf.IDuration|null} [executionTimeout] AnalyzeIamPolicyRequest executionTimeout + */ + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyRequest. + * @implements IAnalyzeIamPolicyRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + */ + function AnalyzeIamPolicyRequest(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]]; + } + + /** + * AnalyzeIamPolicyRequest analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyRequest executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.executionTimeout = null; + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest instance + */ + AnalyzeIamPolicyRequest.create = function create(properties) { + return new AnalyzeIamPolicyRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + AnalyzeIamPolicyRequest.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.asset.v1.AnalyzeIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies an AnalyzeIamPolicyRequest message. * @function verify - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + AnalyzeIamPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); if (error) - return "data." + error; + return "analysisQuery." + error; + } + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + error; } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) + AnalyzeIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest) return object; - var message = new $root.google.cloud.asset.v1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); } - if (object.location != null) - message.location = String(object.location); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @static - * @param {google.cloud.asset.v1.Resource} message Resource + * @param {google.cloud.asset.v1.AnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + AnalyzeIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - object.location = ""; + object.analysisQuery = null; + object.executionTimeout = null; } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this AnalyzeIamPolicyRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + AnalyzeIamPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return AnalyzeIamPolicyRequest; })(); - v1.ResourceSearchResult = (function() { + v1.AnalyzeIamPolicyResponse = (function() { /** - * Properties of a ResourceSearchResult. + * Properties of an AnalyzeIamPolicyResponse. * @memberof google.cloud.asset.v1 - * @interface IResourceSearchResult - * @property {string|null} [name] ResourceSearchResult name - * @property {string|null} [assetType] ResourceSearchResult assetType - * @property {string|null} [project] ResourceSearchResult project - * @property {string|null} [displayName] ResourceSearchResult displayName - * @property {string|null} [description] ResourceSearchResult description - * @property {string|null} [location] ResourceSearchResult location - * @property {Object.|null} [labels] ResourceSearchResult labels - * @property {Array.|null} [networkTags] ResourceSearchResult networkTags - * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes + * @interface IAnalyzeIamPolicyResponse + * @property {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null} [mainAnalysis] AnalyzeIamPolicyResponse mainAnalysis + * @property {Array.|null} [serviceAccountImpersonationAnalysis] AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis + * @property {boolean|null} [fullyExplored] AnalyzeIamPolicyResponse fullyExplored */ /** - * Constructs a new ResourceSearchResult. + * Constructs a new AnalyzeIamPolicyResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents a ResourceSearchResult. - * @implements IResourceSearchResult + * @classdesc Represents an AnalyzeIamPolicyResponse. + * @implements IAnalyzeIamPolicyResponse * @constructor - * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set */ - function ResourceSearchResult(properties) { - this.labels = {}; - this.networkTags = []; + function AnalyzeIamPolicyResponse(properties) { + this.serviceAccountImpersonationAnalysis = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7335,202 +7431,104 @@ } /** - * ResourceSearchResult name. - * @member {string} name - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.name = ""; - - /** - * ResourceSearchResult assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.assetType = ""; - - /** - * ResourceSearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.project = ""; - - /** - * ResourceSearchResult displayName. - * @member {string} displayName - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.displayName = ""; - - /** - * ResourceSearchResult description. - * @member {string} description - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.description = ""; - - /** - * ResourceSearchResult location. - * @member {string} location - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - */ - ResourceSearchResult.prototype.location = ""; - - /** - * ResourceSearchResult labels. - * @member {Object.} labels - * @memberof google.cloud.asset.v1.ResourceSearchResult + * AnalyzeIamPolicyResponse mainAnalysis. + * @member {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null|undefined} mainAnalysis + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance */ - ResourceSearchResult.prototype.labels = $util.emptyObject; + AnalyzeIamPolicyResponse.prototype.mainAnalysis = null; /** - * ResourceSearchResult networkTags. - * @member {Array.} networkTags - * @memberof google.cloud.asset.v1.ResourceSearchResult + * AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. + * @member {Array.} serviceAccountImpersonationAnalysis + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance */ - ResourceSearchResult.prototype.networkTags = $util.emptyArray; + AnalyzeIamPolicyResponse.prototype.serviceAccountImpersonationAnalysis = $util.emptyArray; /** - * ResourceSearchResult additionalAttributes. - * @member {google.protobuf.IStruct|null|undefined} additionalAttributes - * @memberof google.cloud.asset.v1.ResourceSearchResult + * AnalyzeIamPolicyResponse fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @instance */ - ResourceSearchResult.prototype.additionalAttributes = null; + AnalyzeIamPolicyResponse.prototype.fullyExplored = false; /** - * Creates a new ResourceSearchResult instance using the specified properties. + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse instance */ - ResourceSearchResult.create = function create(properties) { - return new ResourceSearchResult(properties); + AnalyzeIamPolicyResponse.create = function create(properties) { + return new AnalyzeIamPolicyResponse(properties); }; /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceSearchResult.encode = function encode(message, writer) { + AnalyzeIamPolicyResponse.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.networkTags != null && message.networkTags.length) - for (var i = 0; i < message.networkTags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); - if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) - $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.mainAnalysis != null && Object.hasOwnProperty.call(message, "mainAnalysis")) + $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.mainAnalysis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.serviceAccountImpersonationAnalysis != null && message.serviceAccountImpersonationAnalysis.length) + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) + $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); return writer; }; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static - * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceSearchResult.decode = function decode(reader, length) { + AnalyzeIamPolicyResponse.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.asset.v1.ResourceSearchResult(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); break; case 2: - message.assetType = reader.string(); + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); break; case 3: - message.project = reader.string(); - break; - case 4: - message.displayName = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 6: - message.location = reader.string(); - break; - case 7: - 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 8: - if (!(message.networkTags && message.networkTags.length)) - message.networkTags = []; - message.networkTags.push(reader.string()); - break; - case 9: - message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.fullyExplored = reader.bool(); break; default: reader.skipType(tag & 7); @@ -7541,467 +7539,5856 @@ }; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { + AnalyzeIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceSearchResult message. + * Verifies an AnalyzeIamPolicyResponse message. * @function verify - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceSearchResult.verify = function verify(message) { + AnalyzeIamPolicyResponse.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { - if (!Array.isArray(message.networkTags)) - return "networkTags: array expected"; - for (var i = 0; i < message.networkTags.length; ++i) - if (!$util.isString(message.networkTags[i])) - return "networkTags: string[] expected"; - } - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { - var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) { + var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.mainAnalysis); if (error) - return "additionalAttributes." + error; + return "mainAnalysis." + error; + } + if (message.serviceAccountImpersonationAnalysis != null && message.hasOwnProperty("serviceAccountImpersonationAnalysis")) { + if (!Array.isArray(message.serviceAccountImpersonationAnalysis)) + return "serviceAccountImpersonationAnalysis: array expected"; + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.serviceAccountImpersonationAnalysis[i]); + if (error) + return "serviceAccountImpersonationAnalysis." + error; + } } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; return null; }; /** - * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ResourceSearchResult + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse */ - ResourceSearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) + AnalyzeIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse) return object; - var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.project != null) - message.project = String(object.project); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.networkTags) { - if (!Array.isArray(object.networkTags)) - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); - message.networkTags = []; - for (var i = 0; i < object.networkTags.length; ++i) - message.networkTags[i] = String(object.networkTags[i]); + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse(); + if (object.mainAnalysis != null) { + if (typeof object.mainAnalysis !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.mainAnalysis: object expected"); + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.mainAnalysis); } - if (object.additionalAttributes != null) { - if (typeof object.additionalAttributes !== "object") - throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); - message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); + if (object.serviceAccountImpersonationAnalysis) { + if (!Array.isArray(object.serviceAccountImpersonationAnalysis)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: array expected"); + message.serviceAccountImpersonationAnalysis = []; + for (var i = 0; i < object.serviceAccountImpersonationAnalysis.length; ++i) { + if (typeof object.serviceAccountImpersonationAnalysis[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: object expected"); + message.serviceAccountImpersonationAnalysis[i] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.serviceAccountImpersonationAnalysis[i]); + } } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); return message; }; - /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @static - * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkTags = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.project = ""; - object.displayName = ""; - object.description = ""; - object.location = ""; - object.additionalAttributes = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - 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.networkTags && message.networkTags.length) { - object.networkTags = []; - for (var j = 0; j < message.networkTags.length; ++j) - object.networkTags[j] = message.networkTags[j]; - } - if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) - object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); - return object; - }; + /** + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceAccountImpersonationAnalysis = []; + if (options.defaults) { + object.mainAnalysis = null; + object.fullyExplored = false; + } + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + object.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.mainAnalysis, options); + if (message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length) { + object.serviceAccountImpersonationAnalysis = []; + for (var j = 0; j < message.serviceAccountImpersonationAnalysis.length; ++j) + object.serviceAccountImpersonationAnalysis[j] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.serviceAccountImpersonationAnalysis[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { + + /** + * Properties of an IamPolicyAnalysis. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @interface IIamPolicyAnalysis + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] IamPolicyAnalysis analysisQuery + * @property {Array.|null} [analysisResults] IamPolicyAnalysis analysisResults + * @property {boolean|null} [fullyExplored] IamPolicyAnalysis fullyExplored + * @property {Array.|null} [nonCriticalErrors] IamPolicyAnalysis nonCriticalErrors + */ + + /** + * Constructs a new IamPolicyAnalysis. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @classdesc Represents an IamPolicyAnalysis. + * @implements IIamPolicyAnalysis + * @constructor + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + */ + function IamPolicyAnalysis(properties) { + this.analysisResults = []; + this.nonCriticalErrors = []; + 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]]; + } + + /** + * IamPolicyAnalysis analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisQuery = null; + + /** + * IamPolicyAnalysis analysisResults. + * @member {Array.} analysisResults + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisResults = $util.emptyArray; + + /** + * IamPolicyAnalysis fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.fullyExplored = false; + + /** + * IamPolicyAnalysis nonCriticalErrors. + * @member {Array.} nonCriticalErrors + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.nonCriticalErrors = $util.emptyArray; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis instance + */ + IamPolicyAnalysis.create = function create(properties) { + return new IamPolicyAnalysis(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.analysisResults != null && message.analysisResults.length) + for (var i = 0; i < message.analysisResults.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + if (message.nonCriticalErrors != null && message.nonCriticalErrors.length) + for (var i = 0; i < message.nonCriticalErrors.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.nonCriticalErrors[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.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.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + case 3: + message.fullyExplored = reader.bool(); + break; + case 5: + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysis message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.analysisResults != null && message.hasOwnProperty("analysisResults")) { + if (!Array.isArray(message.analysisResults)) + return "analysisResults: array expected"; + for (var i = 0; i < message.analysisResults.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.verify(message.analysisResults[i]); + if (error) + return "analysisResults." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + if (message.nonCriticalErrors != null && message.hasOwnProperty("nonCriticalErrors")) { + if (!Array.isArray(message.nonCriticalErrors)) + return "nonCriticalErrors: array expected"; + for (var i = 0; i < message.nonCriticalErrors.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.nonCriticalErrors[i]); + if (error) + return "nonCriticalErrors." + error; + } + } + return null; + }; + + /** + * Creates an IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + */ + IamPolicyAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.analysisResults) { + if (!Array.isArray(object.analysisResults)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: array expected"); + message.analysisResults = []; + for (var i = 0; i < object.analysisResults.length; ++i) { + if (typeof object.analysisResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: object expected"); + message.analysisResults[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.fromObject(object.analysisResults[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + if (object.nonCriticalErrors) { + if (!Array.isArray(object.nonCriticalErrors)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: array expected"); + message.nonCriticalErrors = []; + for (var i = 0; i < object.nonCriticalErrors.length; ++i) { + if (typeof object.nonCriticalErrors[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: object expected"); + message.nonCriticalErrors[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.nonCriticalErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} message IamPolicyAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.analysisResults = []; + object.nonCriticalErrors = []; + } + if (options.defaults) { + object.analysisQuery = null; + object.fullyExplored = false; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.analysisResults && message.analysisResults.length) { + object.analysisResults = []; + for (var j = 0; j < message.analysisResults.length; ++j) + object.analysisResults[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.toObject(message.analysisResults[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + if (message.nonCriticalErrors && message.nonCriticalErrors.length) { + object.nonCriticalErrors = []; + for (var j = 0; j < message.nonCriticalErrors.length; ++j) + object.nonCriticalErrors[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.nonCriticalErrors[j], options); + } + return object; + }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicyAnalysis; + })(); + + return AnalyzeIamPolicyResponse; + })(); + + v1.IamPolicyAnalysisOutputConfig = (function() { + + /** + * Properties of an IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisOutputConfig + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null} [gcsDestination] IamPolicyAnalysisOutputConfig gcsDestination + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null} [bigqueryDestination] IamPolicyAnalysisOutputConfig bigqueryDestination + */ + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisOutputConfig. + * @implements IIamPolicyAnalysisOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + */ + function IamPolicyAnalysisOutputConfig(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]]; + } + + /** + * IamPolicyAnalysisOutputConfig gcsDestination. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + */ + IamPolicyAnalysisOutputConfig.prototype.gcsDestination = null; + + /** + * IamPolicyAnalysisOutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + */ + IamPolicyAnalysisOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IamPolicyAnalysisOutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + */ + Object.defineProperty(IamPolicyAnalysisOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig instance + */ + IamPolicyAnalysisOutputConfig.create = function create(properties) { + return new IamPolicyAnalysisOutputConfig(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisOutputConfig.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.asset.v1.IamPolicyAnalysisOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + */ + IamPolicyAnalysisOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.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.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + IamPolicyAnalysisOutputConfig.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [tablePrefix] BigQueryDestination tablePrefix + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null} [partitionKey] BigQueryDestination partitionKey + * @property {string|null} [writeDisposition] BigQueryDestination writeDisposition + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination tablePrefix. + * @member {string} tablePrefix + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.tablePrefix = ""; + + /** + * BigQueryDestination partitionKey. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey} partitionKey + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.partitionKey = 0; + + /** + * BigQueryDestination writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.writeDisposition = ""; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.tablePrefix != null && Object.hasOwnProperty.call(message, "tablePrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tablePrefix); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.partitionKey); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.writeDisposition); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.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.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataset = reader.string(); + break; + case 2: + message.tablePrefix = reader.string(); + break; + case 3: + message.partitionKey = reader.int32(); + break; + case 4: + message.writeDisposition = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) + if (!$util.isString(message.tablePrefix)) + return "tablePrefix: string expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + switch (message.partitionKey) { + default: + return "partitionKey: enum value expected"; + case 0: + case 1: + break; + } + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.tablePrefix != null) + message.tablePrefix = String(object.tablePrefix); + switch (object.partitionKey) { + case "PARTITION_KEY_UNSPECIFIED": + case 0: + message.partitionKey = 0; + break; + case "REQUEST_TIME": + case 1: + message.partitionKey = 1; + break; + } + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.tablePrefix = ""; + object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; + object.writeDisposition = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) + object.tablePrefix = message.tablePrefix; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] : message.partitionKey; + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + object.writeDisposition = message.writeDisposition; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PartitionKey enum. + * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey + * @enum {number} + * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value + * @property {number} REQUEST_TIME=1 REQUEST_TIME value + */ + BigQueryDestination.PartitionKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_TIME"] = 1; + return values; + })(); + + return BigQueryDestination; + })(); + + return IamPolicyAnalysisOutputConfig; + })(); + + v1.AnalyzeIamPolicyLongrunningRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyLongrunningRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyLongrunningRequest + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyLongrunningRequest analysisQuery + * @property {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] AnalyzeIamPolicyLongrunningRequest outputConfig + */ + + /** + * Constructs a new AnalyzeIamPolicyLongrunningRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyLongrunningRequest. + * @implements IAnalyzeIamPolicyLongrunningRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest=} [properties] Properties to set + */ + function AnalyzeIamPolicyLongrunningRequest(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]]; + } + + /** + * AnalyzeIamPolicyLongrunningRequest analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyLongrunningRequest outputConfig. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.outputConfig = null; + + /** + * Creates a new AnalyzeIamPolicyLongrunningRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest instance + */ + AnalyzeIamPolicyLongrunningRequest.create = function create(properties) { + return new AnalyzeIamPolicyLongrunningRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningRequest.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.asset.v1.AnalyzeIamPolicyLongrunningRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyLongrunningRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyLongrunningRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyLongrunningRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest + */ + AnalyzeIamPolicyLongrunningRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} message AnalyzeIamPolicyLongrunningRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyLongrunningRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.outputConfig = null; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AnalyzeIamPolicyLongrunningRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyLongrunningRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalyzeIamPolicyLongrunningRequest; + })(); + + v1.AnalyzeIamPolicyLongrunningResponse = (function() { + + /** + * Properties of an AnalyzeIamPolicyLongrunningResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyLongrunningResponse + */ + + /** + * Constructs a new AnalyzeIamPolicyLongrunningResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyLongrunningResponse. + * @implements IAnalyzeIamPolicyLongrunningResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse=} [properties] Properties to set + */ + function AnalyzeIamPolicyLongrunningResponse(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 AnalyzeIamPolicyLongrunningResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse instance + */ + AnalyzeIamPolicyLongrunningResponse.create = function create(properties) { + return new AnalyzeIamPolicyLongrunningResponse(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse} message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse} message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningResponse.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.asset.v1.AnalyzeIamPolicyLongrunningResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyLongrunningResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyLongrunningResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AnalyzeIamPolicyLongrunningResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse + */ + AnalyzeIamPolicyLongrunningResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse) + return object; + return new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse(); + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} message AnalyzeIamPolicyLongrunningResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyLongrunningResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AnalyzeIamPolicyLongrunningResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyLongrunningResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalyzeIamPolicyLongrunningResponse; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState + * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(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]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * TemporalAsset priorAssetState. + * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAssetState = 0; + + /** + * TemporalAsset priorAsset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAsset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); + if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) + $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.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.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + case 4: + message.priorAssetState = reader.int32(); + break; + case 5: + message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + switch (message.priorAssetState) { + default: + return "priorAssetState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); + if (error) + return "priorAsset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + switch (object.priorAssetState) { + case "PRIOR_ASSET_STATE_UNSPECIFIED": + case 0: + message.priorAssetState = 0; + break; + case "PRESENT": + case 1: + message.priorAssetState = 1; + break; + case "INVALID": + case 2: + message.priorAssetState = 2; + break; + case "DOES_NOT_EXIST": + case 3: + message.priorAssetState = 3; + break; + case "DELETED": + case 4: + message.priorAssetState = 4; + break; + } + if (object.priorAsset != null) { + if (typeof object.priorAsset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); + message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; + object.priorAsset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) + object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PriorAssetState enum. + * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState + * @enum {number} + * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} INVALID=2 INVALID value + * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value + * @property {number} DELETED=4 DELETED value + */ + TemporalAsset.PriorAssetState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "DOES_NOT_EXIST"] = 3; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.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.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.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.asset.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.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.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.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + 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]]; + } + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.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.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + case 7: + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + case 8: + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + case 9: + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {string|null} [location] Resource location + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 8: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.location = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + v1.ResourceSearchResult = (function() { + + /** + * Properties of a ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @interface IResourceSearchResult + * @property {string|null} [name] ResourceSearchResult name + * @property {string|null} [assetType] ResourceSearchResult assetType + * @property {string|null} [project] ResourceSearchResult project + * @property {string|null} [displayName] ResourceSearchResult displayName + * @property {string|null} [description] ResourceSearchResult description + * @property {string|null} [location] ResourceSearchResult location + * @property {Object.|null} [labels] ResourceSearchResult labels + * @property {Array.|null} [networkTags] ResourceSearchResult networkTags + * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes + */ + + /** + * Constructs a new ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ResourceSearchResult. + * @implements IResourceSearchResult + * @constructor + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + */ + function ResourceSearchResult(properties) { + this.labels = {}; + this.networkTags = []; + 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]]; + } + + /** + * ResourceSearchResult name. + * @member {string} name + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.name = ""; + + /** + * ResourceSearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.assetType = ""; + + /** + * ResourceSearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.project = ""; + + /** + * ResourceSearchResult displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.displayName = ""; + + /** + * ResourceSearchResult description. + * @member {string} description + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.description = ""; + + /** + * ResourceSearchResult location. + * @member {string} location + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.location = ""; + + /** + * ResourceSearchResult labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.labels = $util.emptyObject; + + /** + * ResourceSearchResult networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.networkTags = $util.emptyArray; + + /** + * ResourceSearchResult additionalAttributes. + * @member {google.protobuf.IStruct|null|undefined} additionalAttributes + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.additionalAttributes = null; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance + */ + ResourceSearchResult.create = function create(properties) { + return new ResourceSearchResult(properties); + }; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); + if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) + $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.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.asset.v1.ResourceSearchResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.project = reader.string(); + break; + case 4: + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.location = reader.string(); + break; + case 7: + 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 8: + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + case 9: + message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSearchResult.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); + if (error) + return "additionalAttributes." + error; + } + return null; + }; + + /** + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + */ + ResourceSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) + return object; + var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.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.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.additionalAttributes != null) { + if (typeof object.additionalAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); + message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); + } + return message; + }; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkTags = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + object.location = ""; + object.additionalAttributes = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) + object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); + return object; + }; + + /** + * Converts this ResourceSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + * @returns {Object.} JSON object + */ + ResourceSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSearchResult; + })(); + + v1.IamPolicySearchResult = (function() { + + /** + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation + */ + + /** + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + */ + function IamPolicySearchResult(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]]; + } + + /** + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.resource = ""; + + /** + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.project = ""; + + /** + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance + */ + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); + }; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.project = reader.string(); + break; + case 3: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 4: + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicySearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicySearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } + return null; + }; + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicySearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; + object.explanation = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + return object; + }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicySearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicySearchResult.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + this.matchedPermissions = {}; + 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]]; + } + + /** + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + */ + Explanation.prototype.matchedPermissions = $util.emptyObject; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.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.asset.v1.IamPolicySearchResult.Explanation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); + if (error) + return "matchedPermissions." + error; + } + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Explanation.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + this.permissions = []; + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Permissions; + })(); + + return Explanation; + })(); + + return IamPolicySearchResult; + })(); + + v1.IamPolicyAnalysisState = (function() { + + /** + * Properties of an IamPolicyAnalysisState. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisState + * @property {google.rpc.Code|null} [code] IamPolicyAnalysisState code + * @property {string|null} [cause] IamPolicyAnalysisState cause + */ + + /** + * Constructs a new IamPolicyAnalysisState. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisState. + * @implements IIamPolicyAnalysisState + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set + */ + function IamPolicyAnalysisState(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]]; + } + + /** + * IamPolicyAnalysisState code. + * @member {google.rpc.Code} code + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + */ + IamPolicyAnalysisState.prototype.code = 0; + + /** + * IamPolicyAnalysisState cause. + * @member {string} cause + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + */ + IamPolicyAnalysisState.prototype.cause = ""; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState instance + */ + IamPolicyAnalysisState.create = function create(properties) { + return new IamPolicyAnalysisState(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisState.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.cause != null && Object.hasOwnProperty.call(message, "cause")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisState.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.asset.v1.IamPolicyAnalysisState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.cause = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisState message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.cause != null && message.hasOwnProperty("cause")) + if (!$util.isString(message.cause)) + return "cause: string expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + */ + IamPolicyAnalysisState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisState) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisState(); + switch (object.code) { + case "OK": + case 0: + message.code = 0; + break; + case "CANCELLED": + case 1: + message.code = 1; + break; + case "UNKNOWN": + case 2: + message.code = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.code = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.code = 4; + break; + case "NOT_FOUND": + case 5: + message.code = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.code = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.code = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.code = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.code = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.code = 9; + break; + case "ABORTED": + case 10: + message.code = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.code = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.code = 12; + break; + case "INTERNAL": + case 13: + message.code = 13; + break; + case "UNAVAILABLE": + case 14: + message.code = 14; + break; + case "DATA_LOSS": + case 15: + message.code = 15; + break; + } + if (object.cause != null) + message.cause = String(object.cause); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisState} message IamPolicyAnalysisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "OK" : 0; + object.cause = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; + if (message.cause != null && message.hasOwnProperty("cause")) + object.cause = message.cause; + return object; + }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicyAnalysisState; + })(); + + v1.IamPolicyAnalysisResult = (function() { + + /** + * Properties of an IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisResult + * @property {string|null} [attachedResourceFullName] IamPolicyAnalysisResult attachedResourceFullName + * @property {google.iam.v1.IBinding|null} [iamBinding] IamPolicyAnalysisResult iamBinding + * @property {Array.|null} [accessControlLists] IamPolicyAnalysisResult accessControlLists + * @property {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null} [identityList] IamPolicyAnalysisResult identityList + * @property {boolean|null} [fullyExplored] IamPolicyAnalysisResult fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisResult. + * @implements IIamPolicyAnalysisResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set + */ + function IamPolicyAnalysisResult(properties) { + this.accessControlLists = []; + 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]]; + } + + /** + * IamPolicyAnalysisResult attachedResourceFullName. + * @member {string} attachedResourceFullName + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.attachedResourceFullName = ""; + + /** + * IamPolicyAnalysisResult iamBinding. + * @member {google.iam.v1.IBinding|null|undefined} iamBinding + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.iamBinding = null; + + /** + * IamPolicyAnalysisResult accessControlLists. + * @member {Array.} accessControlLists + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.accessControlLists = $util.emptyArray; + + /** + * IamPolicyAnalysisResult identityList. + * @member {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null|undefined} identityList + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.identityList = null; + + /** + * IamPolicyAnalysisResult fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult instance + */ + IamPolicyAnalysisResult.create = function create(properties) { + return new IamPolicyAnalysisResult(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResourceFullName != null && Object.hasOwnProperty.call(message, "attachedResourceFullName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); + if (message.iamBinding != null && Object.hasOwnProperty.call(message, "iamBinding")) + $root.google.iam.v1.Binding.encode(message.iamBinding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessControlLists != null && message.accessControlLists.length) + for (var i = 0; i < message.accessControlLists.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.identityList != null && Object.hasOwnProperty.call(message, "identityList")) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.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.asset.v1.IamPolicyAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attachedResourceFullName = reader.string(); + break; + case 2: + message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.accessControlLists && message.accessControlLists.length)) + message.accessControlLists = []; + message.accessControlLists.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + case 4: + message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); + break; + case 5: + message.fullyExplored = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + if (!$util.isString(message.attachedResourceFullName)) + return "attachedResourceFullName: string expected"; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) { + var error = $root.google.iam.v1.Binding.verify(message.iamBinding); + if (error) + return "iamBinding." + error; + } + if (message.accessControlLists != null && message.hasOwnProperty("accessControlLists")) { + if (!Array.isArray(message.accessControlLists)) + return "accessControlLists: array expected"; + for (var i = 0; i < message.accessControlLists.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify(message.accessControlLists[i]); + if (error) + return "accessControlLists." + error; + } + } + if (message.identityList != null && message.hasOwnProperty("identityList")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify(message.identityList); + if (error) + return "identityList." + error; + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + */ + IamPolicyAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult(); + if (object.attachedResourceFullName != null) + message.attachedResourceFullName = String(object.attachedResourceFullName); + if (object.iamBinding != null) { + if (typeof object.iamBinding !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.iamBinding: object expected"); + message.iamBinding = $root.google.iam.v1.Binding.fromObject(object.iamBinding); + } + if (object.accessControlLists) { + if (!Array.isArray(object.accessControlLists)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.accessControlLists: array expected"); + message.accessControlLists = []; + for (var i = 0; i < object.accessControlLists.length; ++i) { + if (typeof object.accessControlLists[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.accessControlLists: object expected"); + message.accessControlLists[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.fromObject(object.accessControlLists[i]); + } + } + if (object.identityList != null) { + if (typeof object.identityList !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.identityList: object expected"); + message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.fromObject(object.identityList); + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult} message IamPolicyAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accessControlLists = []; + if (options.defaults) { + object.attachedResourceFullName = ""; + object.iamBinding = null; + object.identityList = null; + object.fullyExplored = false; + } + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + object.attachedResourceFullName = message.attachedResourceFullName; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + object.iamBinding = $root.google.iam.v1.Binding.toObject(message.iamBinding, options); + if (message.accessControlLists && message.accessControlLists.length) { + object.accessControlLists = []; + for (var j = 0; j < message.accessControlLists.length; ++j) + object.accessControlLists[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.toObject(message.accessControlLists[j], options); + } + if (message.identityList != null && message.hasOwnProperty("identityList")) + object.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.toObject(message.identityList, options); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IResource + * @property {string|null} [fullResourceName] Resource fullResourceName + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Resource analysisState + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + */ + function Resource(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]]; + } + + /** + * Resource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.fullResourceName = ""; + + /** + * Resource analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.analysisState = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.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.asset.v1.IamPolicyAnalysisResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fullResourceName = ""; + object.analysisState = null; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + IamPolicyAnalysisResult.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IAccess + * @property {string|null} [role] Access role + * @property {string|null} [permission] Access permission + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Access analysisState + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + */ + function Access(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]]; + } + + /** + * Access role. + * @member {string} role + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.role = ""; + + /** + * Access permission. + * @member {string} permission + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.permission = ""; + + /** + * Access analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.analysisState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Access oneofAccess. + * @member {"role"|"permission"|undefined} oneofAccess + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Object.defineProperty(Access.prototype, "oneofAccess", { + get: $util.oneOfGetter($oneOfFields = ["role", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.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.asset.v1.IamPolicyAnalysisResult.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.permission = reader.string(); + break; + case 3: + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.role != null && message.hasOwnProperty("role")) { + properties.oneofAccess = 1; + if (!$util.isString(message.role)) + return "role: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.oneofAccess === 1) + return "oneofAccess: multiple values"; + properties.oneofAccess = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access(); + if (object.role != null) + message.role = String(object.role); + if (object.permission != null) + message.permission = String(object.permission); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Access.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analysisState = null; + if (message.role != null && message.hasOwnProperty("role")) { + object.role = message.role; + if (options.oneofs) + object.oneofAccess = "role"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.oneofAccess = "permission"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Access; + })(); + + IamPolicyAnalysisResult.Identity = (function() { + + /** + * Properties of an Identity. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IIdentity + * @property {string|null} [name] Identity name + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Identity analysisState + */ + + /** + * Constructs a new Identity. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Identity. + * @implements IIdentity + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + */ + function Identity(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]]; + } + + /** + * Identity name. + * @member {string} name + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.name = ""; + + /** + * Identity analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.analysisState = null; + + /** + * Creates a new Identity instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity instance + */ + Identity.create = function create(properties) { + return new Identity(properties); + }; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.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.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.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.asset.v1.IamPolicyAnalysisResult.Identity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Identity message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Identity.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.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + */ + Identity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity(); + if (object.name != null) + message.name = String(object.name); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} message Identity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Identity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.analysisState = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Identity to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + * @returns {Object.} JSON object + */ + Identity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Identity; + })(); + + IamPolicyAnalysisResult.Edge = (function() { + + /** + * Properties of an Edge. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IEdge + * @property {string|null} [sourceNode] Edge sourceNode + * @property {string|null} [targetNode] Edge targetNode + */ + + /** + * Constructs a new Edge. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Edge. + * @implements IEdge + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + */ + function Edge(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]]; + } + + /** + * Edge sourceNode. + * @member {string} sourceNode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.sourceNode = ""; + + /** + * Edge targetNode. + * @member {string} targetNode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.targetNode = ""; + + /** + * Creates a new Edge instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge instance + */ + Edge.create = function create(properties) { + return new Edge(properties); + }; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceNode != null && Object.hasOwnProperty.call(message, "sourceNode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); + if (message.targetNode != null && Object.hasOwnProperty.call(message, "targetNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetNode); + return writer; + }; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.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.asset.v1.IamPolicyAnalysisResult.Edge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceNode = reader.string(); + break; + case 2: + message.targetNode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this ResourceSearchResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.ResourceSearchResult - * @instance - * @returns {Object.} JSON object - */ - ResourceSearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies an Edge message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Edge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + if (!$util.isString(message.sourceNode)) + return "sourceNode: string expected"; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + if (!$util.isString(message.targetNode)) + return "targetNode: string expected"; + return null; + }; - return ResourceSearchResult; - })(); + /** + * Creates an Edge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + */ + Edge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge(); + if (object.sourceNode != null) + message.sourceNode = String(object.sourceNode); + if (object.targetNode != null) + message.targetNode = String(object.targetNode); + return message; + }; - v1.IamPolicySearchResult = (function() { + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} message Edge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Edge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceNode = ""; + object.targetNode = ""; + } + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + object.sourceNode = message.sourceNode; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + object.targetNode = message.targetNode; + return object; + }; - /** - * Properties of an IamPolicySearchResult. - * @memberof google.cloud.asset.v1 - * @interface IIamPolicySearchResult - * @property {string|null} [resource] IamPolicySearchResult resource - * @property {string|null} [project] IamPolicySearchResult project - * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy - * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation - */ + /** + * Converts this Edge to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + * @returns {Object.} JSON object + */ + Edge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new IamPolicySearchResult. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an IamPolicySearchResult. - * @implements IIamPolicySearchResult - * @constructor - * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set - */ - function IamPolicySearchResult(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 Edge; + })(); - /** - * IamPolicySearchResult resource. - * @member {string} resource - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.resource = ""; + IamPolicyAnalysisResult.AccessControlList = (function() { - /** - * IamPolicySearchResult project. - * @member {string} project - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.project = ""; + /** + * Properties of an AccessControlList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IAccessControlList + * @property {Array.|null} [resources] AccessControlList resources + * @property {Array.|null} [accesses] AccessControlList accesses + * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges + */ - /** - * IamPolicySearchResult policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.policy = null; + /** + * Constructs a new AccessControlList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an AccessControlList. + * @implements IAccessControlList + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + */ + function AccessControlList(properties) { + this.resources = []; + this.accesses = []; + this.resourceEdges = []; + 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]]; + } - /** - * IamPolicySearchResult explanation. - * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - */ - IamPolicySearchResult.prototype.explanation = null; + /** + * AccessControlList resources. + * @member {Array.} resources + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resources = $util.emptyArray; - /** - * Creates a new IamPolicySearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance - */ - IamPolicySearchResult.create = function create(properties) { - return new IamPolicySearchResult(properties); - }; + /** + * AccessControlList accesses. + * @member {Array.} accesses + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.accesses = $util.emptyArray; + + /** + * AccessControlList resourceEdges. + * @member {Array.} resourceEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resourceEdges = $util.emptyArray; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList instance + */ + AccessControlList.create = function create(properties) { + return new AccessControlList(properties); + }; - /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicySearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.accesses != null && message.accesses.length) + for (var i = 0; i < message.accesses.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.encode(message.accesses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceEdges != null && message.resourceEdges.length) + for (var i = 0; i < message.resourceEdges.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicySearchResult.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.asset.v1.IamPolicySearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.project = reader.string(); - break; - case 3: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 4: - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an AccessControlList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.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.asset.v1.IamPolicyAnalysisResult.AccessControlList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an IamPolicySearchResult message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IamPolicySearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.explanation != null && message.hasOwnProperty("explanation")) { - var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); - if (error) - return "explanation." + error; - } - return null; - }; + /** + * Verifies an AccessControlList message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessControlList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.asset.v1.IamPolicyAnalysisResult.Resource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.accesses != null && message.hasOwnProperty("accesses")) { + if (!Array.isArray(message.accesses)) + return "accesses: array expected"; + for (var i = 0; i < message.accesses.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.verify(message.accesses[i]); + if (error) + return "accesses." + error; + } + } + if (message.resourceEdges != null && message.hasOwnProperty("resourceEdges")) { + if (!Array.isArray(message.resourceEdges)) + return "resourceEdges: array expected"; + for (var i = 0; i < message.resourceEdges.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify(message.resourceEdges[i]); + if (error) + return "resourceEdges." + error; + } + } + return null; + }; + + /** + * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + */ + AccessControlList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resources: object expected"); + message.resources[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.fromObject(object.resources[i]); + } + } + if (object.accesses) { + if (!Array.isArray(object.accesses)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.accesses: array expected"); + message.accesses = []; + for (var i = 0; i < object.accesses.length; ++i) { + if (typeof object.accesses[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.accesses: object expected"); + message.accesses[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.fromObject(object.accesses[i]); + } + } + if (object.resourceEdges) { + if (!Array.isArray(object.resourceEdges)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: array expected"); + message.resourceEdges = []; + for (var i = 0; i < object.resourceEdges.length; ++i) { + if (typeof object.resourceEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: object expected"); + message.resourceEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); + } + } + return message; + }; - /** - * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult - */ - IamPolicySearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} message AccessControlList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessControlList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accesses = []; + object.resourceEdges = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.toObject(message.resources[j], options); + } + if (message.accesses && message.accesses.length) { + object.accesses = []; + for (var j = 0; j < message.accesses.length; ++j) + object.accesses[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.toObject(message.accesses[j], options); + } + if (message.resourceEdges && message.resourceEdges.length) { + object.resourceEdges = []; + for (var j = 0; j < message.resourceEdges.length; ++j) + object.resourceEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); + } return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.project != null) - message.project = String(object.project); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.explanation != null) { - if (typeof object.explanation !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); - } - return message; - }; + }; - /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IamPolicySearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.project = ""; - object.policy = null; - object.explanation = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); - return object; - }; + /** + * Converts this AccessControlList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + * @returns {Object.} JSON object + */ + AccessControlList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this IamPolicySearchResult to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @instance - * @returns {Object.} JSON object - */ - IamPolicySearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return AccessControlList; + })(); - IamPolicySearchResult.Explanation = (function() { + IamPolicyAnalysisResult.IdentityList = (function() { /** - * Properties of an Explanation. - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @interface IExplanation - * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + * Properties of an IdentityList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IIdentityList + * @property {Array.|null} [identities] IdentityList identities + * @property {Array.|null} [groupEdges] IdentityList groupEdges */ /** - * Constructs a new Explanation. - * @memberof google.cloud.asset.v1.IamPolicySearchResult - * @classdesc Represents an Explanation. - * @implements IExplanation + * Constructs a new IdentityList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an IdentityList. + * @implements IIdentityList * @constructor - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set */ - function Explanation(properties) { - this.matchedPermissions = {}; + function IdentityList(properties) { + this.identities = []; + this.groupEdges = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8009,97 +13396,94 @@ } /** - * Explanation matchedPermissions. - * @member {Object.} matchedPermissions - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * IdentityList identities. + * @member {Array.} identities + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @instance */ - Explanation.prototype.matchedPermissions = $util.emptyObject; + IdentityList.prototype.identities = $util.emptyArray; /** - * Creates a new Explanation instance using the specified properties. + * IdentityList groupEdges. + * @member {Array.} groupEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.groupEdges = $util.emptyArray; + + /** + * Creates a new IdentityList instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList instance */ - Explanation.create = function create(properties) { - return new Explanation(properties); + IdentityList.create = function create(properties) { + return new IdentityList(properties); }; /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Explanation.encode = function encode(message, writer) { + IdentityList.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) - for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.encode(message.identities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupEdges != null && message.groupEdges.length) + for (var i = 0; i < message.groupEdges.length; ++i) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.groupEdges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Explanation.encodeDelimited = function encodeDelimited(message, writer) { + IdentityList.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Explanation message from the specified reader or buffer. + * Decodes an IdentityList message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Explanation.decode = function decode(reader, length) { + IdentityList.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.asset.v1.IamPolicySearchResult.Explanation(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (message.matchedPermissions === $util.emptyObject) - message.matchedPermissions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchedPermissions[key] = value; + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -8110,312 +13494,133 @@ }; /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. + * Decodes an IdentityList message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Explanation.decodeDelimited = function decodeDelimited(reader) { + IdentityList.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Explanation message. + * Verifies an IdentityList message. * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Explanation.verify = function verify(message) { + IdentityList.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { - if (!$util.isObject(message.matchedPermissions)) - return "matchedPermissions: object expected"; - var key = Object.keys(message.matchedPermissions); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); + if (message.identities != null && message.hasOwnProperty("identities")) { + if (!Array.isArray(message.identities)) + return "identities: array expected"; + for (var i = 0; i < message.identities.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.verify(message.identities[i]); if (error) - return "matchedPermissions." + error; + return "identities." + error; + } + } + if (message.groupEdges != null && message.hasOwnProperty("groupEdges")) { + if (!Array.isArray(message.groupEdges)) + return "groupEdges: array expected"; + for (var i = 0; i < message.groupEdges.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.verify(message.groupEdges[i]); + if (error) + return "groupEdges." + error; } } return null; }; - /** - * Creates an Explanation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation - */ - Explanation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); - if (object.matchedPermissions) { - if (typeof object.matchedPermissions !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); - message.matchedPermissions = {}; - for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { - if (typeof object.matchedPermissions[keys[i]] !== "object") - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); - message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); + /** + * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList + */ + IdentityList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) { + if (typeof object.identities[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities: object expected"); + message.identities[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.fromObject(object.identities[i]); + } + } + if (object.groupEdges) { + if (!Array.isArray(object.groupEdges)) + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: array expected"); + message.groupEdges = []; + for (var i = 0; i < object.groupEdges.length; ++i) { + if (typeof object.groupEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: object expected"); + message.groupEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.groupEdges[i]); } } return message; }; /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} message IdentityList * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Explanation.toObject = function toObject(message, options) { + IdentityList.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.matchedPermissions = {}; - var keys2; - if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { - object.matchedPermissions = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + if (options.arrays || options.defaults) { + object.identities = []; + object.groupEdges = []; + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.toObject(message.identities[j], options); + } + if (message.groupEdges && message.groupEdges.length) { + object.groupEdges = []; + for (var j = 0; j < message.groupEdges.length; ++j) + object.groupEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.groupEdges[j], options); } return object; }; /** - * Converts this Explanation to JSON. + * Converts this IdentityList to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList * @instance * @returns {Object.} JSON object */ - Explanation.prototype.toJSON = function toJSON() { + IdentityList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Explanation.Permissions = (function() { - - /** - * Properties of a Permissions. - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @interface IPermissions - * @property {Array.|null} [permissions] Permissions permissions - */ - - /** - * Constructs a new Permissions. - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation - * @classdesc Represents a Permissions. - * @implements IPermissions - * @constructor - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set - */ - function Permissions(properties) { - this.permissions = []; - 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]]; - } - - /** - * Permissions permissions. - * @member {Array.} permissions - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @instance - */ - Permissions.prototype.permissions = $util.emptyArray; - - /** - * Creates a new Permissions instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance - */ - Permissions.create = function create(properties) { - return new Permissions(properties); - }; - - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Permissions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Permissions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Permissions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Permissions.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.asset.v1.IamPolicySearchResult.Explanation.Permissions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Permissions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Permissions message. - * @function verify - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Permissions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a Permissions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions - */ - Permissions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) - return object; - var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @static - * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Permissions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this Permissions to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions - * @instance - * @returns {Object.} JSON object - */ - Permissions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Permissions; - })(); - - return Explanation; + return IdentityList; })(); - return IamPolicySearchResult; + return IamPolicyAnalysisResult; })(); return v1; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index d982a76543b..c06f4f4afaf 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -97,6 +97,23 @@ "(google.api.http).get": "/v1/{scope=*/*}:searchAllIamPolicies", "(google.api.method_signature)": "scope,query" } + }, + "AnalyzeIamPolicy": { + "requestType": "AnalyzeIamPolicyRequest", + "responseType": "AnalyzeIamPolicyResponse", + "options": { + "(google.api.http).get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + } + }, + "AnalyzeIamPolicyLongrunning": { + "requestType": "AnalyzeIamPolicyLongrunningRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" + } } } }, @@ -555,6 +572,285 @@ } } }, + "IamPolicyAnalysisQuery": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceSelector": { + "type": "ResourceSelector", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identitySelector": { + "type": "IdentitySelector", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessSelector": { + "type": "AccessSelector", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "options": { + "type": "Options", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ResourceSelector": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IdentitySelector": { + "fields": { + "identity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AccessSelector": { + "fields": { + "roles": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Options": { + "fields": { + "expandGroups": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandRoles": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputResourceEdges": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputGroupEdges": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "analyzeServiceAccountImpersonation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AnalyzeIamPolicyRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AnalyzeIamPolicyResponse": { + "fields": { + "mainAnalysis": { + "type": "IamPolicyAnalysis", + "id": 1 + }, + "serviceAccountImpersonationAnalysis": { + "rule": "repeated", + "type": "IamPolicyAnalysis", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "IamPolicyAnalysis": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + }, + "analysisResults": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + }, + "nonCriticalErrors": { + "rule": "repeated", + "type": "IamPolicyAnalysisState", + "id": 5 + } + } + } + } + }, + "IamPolicyAnalysisOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + }, + "nested": { + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tablePrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partitionKey": { + "type": "PartitionKey", + "id": 3 + }, + "writeDisposition": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PartitionKey": { + "values": { + "PARTITION_KEY_UNSPECIFIED": 0, + "REQUEST_TIME": 1 + } + } + } + } + } + }, + "AnalyzeIamPolicyLongrunningRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnalyzeIamPolicyLongrunningResponse": { + "fields": {} + }, "ContentType": { "values": { "CONTENT_TYPE_UNSPECIFIED": 0, @@ -785,6 +1081,138 @@ } } } + }, + "IamPolicyAnalysisState": { + "fields": { + "code": { + "type": "google.rpc.Code", + "id": 1 + }, + "cause": { + "type": "string", + "id": 2 + } + } + }, + "IamPolicyAnalysisResult": { + "fields": { + "attachedResourceFullName": { + "type": "string", + "id": 1 + }, + "iamBinding": { + "type": "google.iam.v1.Binding", + "id": 2 + }, + "accessControlLists": { + "rule": "repeated", + "type": "AccessControlList", + "id": 3 + }, + "identityList": { + "type": "IdentityList", + "id": 4 + }, + "fullyExplored": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "Resource": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 2 + } + } + }, + "Access": { + "oneofs": { + "oneofAccess": { + "oneof": [ + "role", + "permission" + ] + } + }, + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 3 + } + } + }, + "Identity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 2 + } + } + }, + "Edge": { + "fields": { + "sourceNode": { + "type": "string", + "id": 1 + }, + "targetNode": { + "type": "string", + "id": 2 + } + } + }, + "AccessControlList": { + "fields": { + "resources": { + "rule": "repeated", + "type": "Resource", + "id": 1 + }, + "accesses": { + "rule": "repeated", + "type": "Access", + "id": 2 + }, + "resourceEdges": { + "rule": "repeated", + "type": "Edge", + "id": 3 + } + } + }, + "IdentityList": { + "fields": { + "identities": { + "rule": "repeated", + "type": "Identity", + "id": 1 + }, + "groupEdges": { + "rule": "repeated", + "type": "Edge", + "id": 2 + } + } + } + } } } }, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index c6827482b5d..edbb4fb0f80 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -211,6 +211,12 @@ export class AssetServiceClient { const exportAssetsMetadata = protoFilesRoot.lookup( '.google.cloud.asset.v1.ExportAssetsRequest' ) as gax.protobuf.Type; + const analyzeIamPolicyLongrunningResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse' + ) as gax.protobuf.Type; + const analyzeIamPolicyLongrunningMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest' + ) as gax.protobuf.Type; this.descriptors.longrunning = { exportAssets: new this._gaxModule.LongrunningDescriptor( @@ -218,6 +224,15 @@ export class AssetServiceClient { exportAssetsResponse.decode.bind(exportAssetsResponse), exportAssetsMetadata.decode.bind(exportAssetsMetadata) ), + analyzeIamPolicyLongrunning: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + analyzeIamPolicyLongrunningResponse.decode.bind( + analyzeIamPolicyLongrunningResponse + ), + analyzeIamPolicyLongrunningMetadata.decode.bind( + analyzeIamPolicyLongrunningMetadata + ) + ), }; // Put together the default options sent with requests. @@ -275,6 +290,8 @@ export class AssetServiceClient { 'deleteFeed', 'searchAllResources', 'searchAllIamPolicies', + 'analyzeIamPolicy', + 'analyzeIamPolicyLongrunning', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -900,6 +917,100 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.deleteFeed(request, options, callback); } + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, + {} | undefined + ] + >; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Analyzes IAM policies to answer which identities have what accesses on + * which resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.protobuf.Duration} [request.executionTimeout] + * Optional. Amount of time executable has to complete. See JSON representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * + * Default is empty. + * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1.AnalyzeIamPolicyResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | 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({ + 'analysis_query.scope': request.analysisQuery!.scope || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeIamPolicy(request, options, callback); + } exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, @@ -1077,6 +1188,154 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest >; } + analyzeIamPolicyLongrunning( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + analyzeIamPolicyLongrunning( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + analyzeIamPolicyLongrunning( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Analyzes IAM policies asynchronously to answer which identities have what + * accesses on which resources, and writes the analysis results to a Google + * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the + * output format is the JSON format that represents a + * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. This method implements the + * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation + * status. We recommend intervals of at least 2 seconds with exponential + * backoff retry to poll the operation result. The metadata contains the + * request to help callers to map responses to requests. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output to. + * @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. + */ + analyzeIamPolicyLongrunning( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >, + 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({ + 'analysis_query.scope': request.analysisQuery!.scope || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeIamPolicyLongrunning( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the analyzeIamPolicyLongrunning() 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 checkAnalyzeIamPolicyLongrunningProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkAnalyzeIamPolicyLongrunningProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.analyzeIamPolicyLongrunning, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + >; + } searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index ac06aea1e81..16565a7fe35 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -64,6 +67,16 @@ "timeout_millis": 15000, "retry_codes_name": "idempotent", "retry_params_name": "default" + }, + "AnalyzeIamPolicy": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "AnalyzeIamPolicyLongrunning": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index de18035618a..e8b0d3bc217 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "10fcb7a234816f801d19edf3bd66c505741273b7" + "sha": "ecbfaaec2c5fa2dd279b3fcda3030ec3a6089aba" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5e53d6b6dde0e72fa9510ec1d796176d128afa40", - "internalRef": "331912851" + "sha": "00bbad4dfd6633cf4b5f9596c1f93b756bb5c776", + "internalRef": "339708980" } }, { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 40976e91e77..6f21e754476 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -900,6 +900,121 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('analyzeIamPolicy', () => { + it('invokes analyzeIamPolicy without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicy without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeIamPolicy with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('exportAssets', () => { it('invokes exportAssets without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ @@ -1091,6 +1206,209 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('analyzeIamPolicyLongrunning', () => { + it('invokes analyzeIamPolicyLongrunning without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicyLongrunning( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeIamPolicyLongrunning with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.analyzeIamPolicyLongrunning(request), + expectedError + ); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkAnalyzeIamPolicyLongrunningProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkAnalyzeIamPolicyLongrunningProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('searchAllResources', () => { it('invokes searchAllResources without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ From 4bcc91569e1f1eac6ae99b10bff92846abb72cb3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:58:54 -0800 Subject: [PATCH 278/429] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#414) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9f0ce149-63bd-4aad-917d-44f82c8912a6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index e8b0d3bc217..2e0cf1b5881 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "ecbfaaec2c5fa2dd279b3fcda3030ec3a6089aba" + "sha": "43dde85f123d0716b5c3b5aad3b3d1d8018399a6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From 2497c42cf324866c584596daac29a72911effb48 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2020 11:28:40 -0800 Subject: [PATCH 279/429] chore: release 3.9.0 (#413) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 6b15e3a7d9a..593671a0a16 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.9.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.8.0...v3.9.0) (2020-11-02) + + +### Features + +* add AnalyzeIamPolicy and AnalyzeIamPolicyLongrunning RPCs ([#412](https://www.github.com/googleapis/nodejs-asset/issues/412)) ([43dde85](https://www.github.com/googleapis/nodejs-asset/commit/43dde85f123d0716b5c3b5aad3b3d1d8018399a6)) + ## [3.8.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.7.1...v3.8.0) (2020-09-16) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 80cb06a1ca9..71e7d2be20c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.8.0", + "version": "3.9.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 6fc46a324ec..70cf4673c07 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.8.0", + "@google-cloud/asset": "^3.9.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 11014a42473583146f070e6a8491a3c1c4631146 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 9 Nov 2020 07:42:27 -0800 Subject: [PATCH 280/429] build: add type for AssetServiceClient (#418) --- packages/google-cloud-asset/src/index.ts | 1 + packages/google-cloud-asset/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index c1c252fc3e6..6809b5235ee 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -24,6 +24,7 @@ import * as v1p5beta1 from './v1p5beta1'; import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; +type AssetServiceClient = v1.AssetServiceClient; export { v1beta1, diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 2e0cf1b5881..cfca8a811b5 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "43dde85f123d0716b5c3b5aad3b3d1d8018399a6" + "sha": "3c1cb89c136232bf9b5c8a22e62124f7d48c7303" } }, { From 9dba4fabe7202298d8d6ba00e091fd17f3a65594 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 10 Nov 2020 13:06:55 -0500 Subject: [PATCH 281/429] test: failures appear to be timing related (#422) --- packages/google-cloud-asset/samples/test/sample.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index bdd96c7937b..31b865f39b0 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -68,13 +68,15 @@ describe('quickstart sample tests', () => { await file.delete(); }); - it('should get assets history successfully', async () => { + // The assets returned within 'readTimeWindow' frequently do not include + // the newly created bucket: + it.skip('should get assets history successfully', async () => { const assetName = `//storage.googleapis.com/${bucketName}`; const stdout = execSync(`node getBatchAssetHistory ${assetName}`); assert.include(stdout, assetName); }); - it('should run the quickstart', async () => { + it.skip('should run the quickstart', async () => { const assetName = `//storage.googleapis.com/${bucketName}`; const stdout = execSync(`node quickstart ${assetName}`); assert.include(stdout, assetName); From 00b96f713322a4ec284e0315786db4fb6cf87a07 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 11 Nov 2020 12:58:08 -0800 Subject: [PATCH 282/429] fix: do not modify options object, use defaultScopes (#419) * fix: do not modify options object, use defaultScopes Regenerated the library using gapic-generator-typescript v1.2.1. * fix(deps): require google-gax ^2.9.2 Co-authored-by: Benjamin E. Coe --- packages/google-cloud-asset/package.json | 2 +- .../src/v1/asset_service_client.ts | 278 ++++++++++-------- .../src/v1beta1/asset_service_client.ts | 102 ++++--- .../src/v1p1beta1/asset_service_client.ts | 184 ++++++------ .../src/v1p2beta1/asset_service_client.ts | 100 ++++--- .../src/v1p4beta1/asset_service_client.ts | 102 ++++--- .../src/v1p5beta1/asset_service_client.ts | 127 ++++---- packages/google-cloud-asset/synth.metadata | 4 +- .../system-test/fixtures/sample/src/index.ts | 9 +- .../google-cloud-asset/system-test/install.ts | 18 +- 10 files changed, 520 insertions(+), 406 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 71e7d2be20c..4566e70233e 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -46,7 +46,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index edbb4fb0f80..04c7dca517a 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -62,8 +62,10 @@ export class AssetServiceClient { /** * Construct an instance of AssetServiceClient. * - * @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,42 +85,33 @@ export class AssetServiceClient { * 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 AssetServiceClient; 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 AssetServiceClient 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 AssetServiceClient).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. @@ -127,6 +120,11 @@ export class AssetServiceClient { // 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) { @@ -325,6 +323,7 @@ export class AssetServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloudasset.googleapis.com'; @@ -333,6 +332,7 @@ export class AssetServiceClient { /** * 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 'cloudasset.googleapis.com'; @@ -340,6 +340,7 @@ export class AssetServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -348,6 +349,7 @@ export class AssetServiceClient { /** * 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']; @@ -357,8 +359,7 @@ export class AssetServiceClient { 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 @@ -441,7 +442,11 @@ export class AssetServiceClient { * 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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. - * 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.batchGetAssetsHistory(request); */ batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, @@ -539,7 +544,11 @@ export class AssetServiceClient { * 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 [Feed]{@link google.cloud.asset.v1.Feed}. - * 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.createFeed(request); */ createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, @@ -622,7 +631,11 @@ export class AssetServiceClient { * 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 [Feed]{@link google.cloud.asset.v1.Feed}. - * 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.getFeed(request); */ getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, @@ -704,7 +717,11 @@ export class AssetServiceClient { * 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 [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. - * 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.listFeeds(request); */ listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, @@ -792,7 +809,11 @@ export class AssetServiceClient { * 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 [Feed]{@link google.cloud.asset.v1.Feed}. - * 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.updateFeed(request); */ updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, @@ -875,7 +896,11 @@ export class AssetServiceClient { * 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.deleteFeed(request); */ deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, @@ -967,7 +992,11 @@ export class AssetServiceClient { * 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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1.AnalyzeIamPolicyResponse}. - * 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.analyzeIamPolicy(request); */ analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, @@ -1100,8 +1129,15 @@ export class AssetServiceClient { * @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.exportAssets(request); + * const [response] = await operation.promise(); */ exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, @@ -1153,18 +1189,19 @@ export class AssetServiceClient { return this.innerApiCalls.exportAssets(request, options, callback); } /** - * Check the status of the long running operation returned by the exportAssets() method. + * Check the status of the long running operation returned by `exportAssets()`. * @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 checkExportAssetsProgress(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 checkExportAssetsProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkExportAssetsProgress( name: string @@ -1244,8 +1281,15 @@ export class AssetServiceClient { * @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.analyzeIamPolicyLongrunning(request); + * const [response] = await operation.promise(); */ analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, @@ -1301,18 +1345,19 @@ export class AssetServiceClient { ); } /** - * Check the status of the long running operation returned by the analyzeIamPolicyLongrunning() method. + * Check the status of the long running operation returned by `analyzeIamPolicyLongrunning()`. * @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 checkAnalyzeIamPolicyLongrunningProgress(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 checkAnalyzeIamPolicyLongrunningProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkAnalyzeIamPolicyLongrunningProgress( name: string @@ -1450,19 +1495,14 @@ export class AssetServiceClient { * 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 [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult}. - * 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 [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult} 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 [SearchAllResourcesRequest]{@link google.cloud.asset.v1.SearchAllResourcesRequest} - * 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 - * [SearchAllResourcesResponse]{@link google.cloud.asset.v1.SearchAllResourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `searchAllResourcesAsync()` + * 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. */ searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, @@ -1510,18 +1550,7 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllResources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchAllResources} 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.scope @@ -1599,6 +1628,13 @@ export class AssetServiceClient { * 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 [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult} 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 `searchAllResourcesAsync()` + * 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. */ searchAllResourcesStream( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, @@ -1623,10 +1659,9 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllResources}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `searchAllResources`, 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.scope @@ -1703,7 +1738,18 @@ export class AssetServiceClient { * @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 + * [ResourceSearchResult]{@link google.cloud.asset.v1.ResourceSearchResult}. 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.searchAllResourcesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, @@ -1820,19 +1866,14 @@ export class AssetServiceClient { * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult}. - * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult} 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 [SearchAllIamPoliciesRequest]{@link google.cloud.asset.v1.SearchAllIamPoliciesRequest} - * 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 - * [SearchAllIamPoliciesResponse]{@link google.cloud.asset.v1.SearchAllIamPoliciesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `searchAllIamPoliciesAsync()` + * 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. */ searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, @@ -1880,18 +1921,7 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllIamPolicies}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchAllIamPolicies} 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.scope @@ -1948,6 +1978,13 @@ export class AssetServiceClient { * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult} 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 `searchAllIamPoliciesAsync()` + * 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. */ searchAllIamPoliciesStream( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, @@ -1972,10 +2009,9 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllIamPolicies}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `searchAllIamPolicies`, 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.scope @@ -2031,7 +2067,18 @@ export class AssetServiceClient { * @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 + * [IamPolicySearchResult]{@link google.cloud.asset.v1.IamPolicySearchResult}. 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.searchAllIamPoliciesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, @@ -2175,9 +2222,10 @@ export class AssetServiceClient { } /** - * 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-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index bd554294b9d..bc32ce5a590 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -57,8 +57,10 @@ export class AssetServiceClient { /** * Construct an instance of AssetServiceClient. * - * @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] @@ -78,42 +80,33 @@ export class AssetServiceClient { * 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 AssetServiceClient; 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?.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 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 AssetServiceClient 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 AssetServiceClient).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. @@ -122,6 +115,11 @@ export class AssetServiceClient { // 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) { @@ -259,6 +257,7 @@ export class AssetServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloudasset.googleapis.com'; @@ -267,6 +266,7 @@ export class AssetServiceClient { /** * 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 'cloudasset.googleapis.com'; @@ -274,6 +274,7 @@ export class AssetServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -282,6 +283,7 @@ export class AssetServiceClient { /** * 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']; @@ -291,8 +293,7 @@ export class AssetServiceClient { 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 @@ -378,7 +379,11 @@ export class AssetServiceClient { * 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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. - * 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.batchGetAssetsHistory(request); */ batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, @@ -499,8 +504,15 @@ export class AssetServiceClient { * @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.exportAssets(request); + * const [response] = await operation.promise(); */ exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, @@ -552,18 +564,19 @@ export class AssetServiceClient { return this.innerApiCalls.exportAssets(request, options, callback); } /** - * Check the status of the long running operation returned by the exportAssets() method. + * Check the status of the long running operation returned by `exportAssets()`. * @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 checkExportAssetsProgress(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 checkExportAssetsProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkExportAssetsProgress( name: string @@ -589,9 +602,10 @@ export class AssetServiceClient { } /** - * 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-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index f91f50ceac5..27fe5891a24 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -59,8 +59,10 @@ export class AssetServiceClient { /** * Construct an instance of AssetServiceClient. * - * @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] @@ -80,42 +82,33 @@ export class AssetServiceClient { * 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 AssetServiceClient; 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?.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 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 AssetServiceClient 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 AssetServiceClient).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. @@ -124,6 +117,11 @@ export class AssetServiceClient { // 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) { @@ -249,6 +247,7 @@ export class AssetServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloudasset.googleapis.com'; @@ -257,6 +256,7 @@ export class AssetServiceClient { /** * 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 'cloudasset.googleapis.com'; @@ -264,6 +264,7 @@ export class AssetServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -272,6 +273,7 @@ export class AssetServiceClient { /** * 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']; @@ -281,8 +283,7 @@ export class AssetServiceClient { 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 @@ -370,19 +371,14 @@ export class AssetServiceClient { * 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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. - * 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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} 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 [SearchAllResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} - * 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 - * [SearchAllResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `searchAllResourcesAsync()` + * 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. */ searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, @@ -430,18 +426,7 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllResources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchAllResources} 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.scope @@ -475,6 +460,13 @@ export class AssetServiceClient { * 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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} 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 `searchAllResourcesAsync()` + * 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. */ searchAllResourcesStream( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, @@ -499,10 +491,9 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllResources}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `searchAllResources`, 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.scope @@ -535,7 +526,18 @@ export class AssetServiceClient { * @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 + * [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. 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.searchAllResourcesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, @@ -630,19 +632,14 @@ export class AssetServiceClient { * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. - * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} 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 [SearchAllIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} - * 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 - * [SearchAllIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `searchAllIamPoliciesAsync()` + * 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. */ searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, @@ -690,18 +687,7 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllIamPolicies}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchAllIamPolicies} 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.scope @@ -730,6 +716,13 @@ export class AssetServiceClient { * 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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} 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 `searchAllIamPoliciesAsync()` + * 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. */ searchAllIamPoliciesStream( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, @@ -754,10 +747,9 @@ export class AssetServiceClient { } /** - * Equivalent to {@link searchAllIamPolicies}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `searchAllIamPolicies`, 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.scope @@ -785,7 +777,18 @@ export class AssetServiceClient { * @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 + * [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. 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.searchAllIamPoliciesAsync(request); + * for await (const response of iterable) { + * // process response + * } */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, @@ -813,9 +816,10 @@ export class AssetServiceClient { } /** - * 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-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 955d9fede69..f06289a9209 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -51,8 +51,10 @@ export class AssetServiceClient { /** * Construct an instance of AssetServiceClient. * - * @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] @@ -72,42 +74,33 @@ export class AssetServiceClient { * 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 AssetServiceClient; 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?.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 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 AssetServiceClient 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 AssetServiceClient).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. @@ -116,6 +109,11 @@ export class AssetServiceClient { // 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) { @@ -243,6 +241,7 @@ export class AssetServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloudasset.googleapis.com'; @@ -251,6 +250,7 @@ export class AssetServiceClient { /** * 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 'cloudasset.googleapis.com'; @@ -258,6 +258,7 @@ export class AssetServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -266,6 +267,7 @@ export class AssetServiceClient { /** * 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']; @@ -275,8 +277,7 @@ export class AssetServiceClient { 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 @@ -343,7 +344,11 @@ export class AssetServiceClient { * 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * 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.createFeed(request); */ createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, @@ -428,7 +433,11 @@ export class AssetServiceClient { * 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * 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.getFeed(request); */ getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, @@ -512,7 +521,11 @@ export class AssetServiceClient { * 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 [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. - * 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.listFeeds(request); */ listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, @@ -602,7 +615,11 @@ export class AssetServiceClient { * 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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * 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.updateFeed(request); */ updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, @@ -687,7 +704,11 @@ export class AssetServiceClient { * 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.deleteFeed(request); */ deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, @@ -852,9 +873,10 @@ export class AssetServiceClient { } /** - * 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-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 0246454c843..6380744f67b 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -57,8 +57,10 @@ export class AssetServiceClient { /** * Construct an instance of AssetServiceClient. * - * @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] @@ -78,42 +80,33 @@ export class AssetServiceClient { * 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 AssetServiceClient; 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?.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 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 AssetServiceClient 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 AssetServiceClient).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. @@ -122,6 +115,11 @@ export class AssetServiceClient { // 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) { @@ -266,6 +264,7 @@ export class AssetServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloudasset.googleapis.com'; @@ -274,6 +273,7 @@ export class AssetServiceClient { /** * 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 'cloudasset.googleapis.com'; @@ -281,6 +281,7 @@ export class AssetServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -289,6 +290,7 @@ export class AssetServiceClient { /** * 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']; @@ -298,8 +300,7 @@ export class AssetServiceClient { 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 @@ -359,7 +360,11 @@ export class AssetServiceClient { * 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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse}. - * 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.analyzeIamPolicy(request); */ analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, @@ -459,8 +464,15 @@ export class AssetServiceClient { * @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.exportIamPolicyAnalysis(request); + * const [response] = await operation.promise(); */ exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, @@ -516,18 +528,19 @@ export class AssetServiceClient { ); } /** - * Check the status of the long running operation returned by the exportIamPolicyAnalysis() method. + * Check the status of the long running operation returned by `exportIamPolicyAnalysis()`. * @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 checkExportIamPolicyAnalysisProgress(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 checkExportIamPolicyAnalysisProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkExportIamPolicyAnalysisProgress( name: string @@ -553,9 +566,10 @@ export class AssetServiceClient { } /** - * 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-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 12b511edabc..3072e67d686 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -59,8 +59,10 @@ export class AssetServiceClient { /** * Construct an instance of AssetServiceClient. * - * @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] @@ -80,42 +82,33 @@ export class AssetServiceClient { * 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 AssetServiceClient; 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?.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 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 AssetServiceClient 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 AssetServiceClient).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. @@ -124,6 +117,11 @@ export class AssetServiceClient { // 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) { @@ -241,6 +239,7 @@ export class AssetServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloudasset.googleapis.com'; @@ -249,6 +248,7 @@ export class AssetServiceClient { /** * 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 'cloudasset.googleapis.com'; @@ -256,6 +256,7 @@ export class AssetServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -264,6 +265,7 @@ export class AssetServiceClient { /** * 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']; @@ -273,8 +275,7 @@ export class AssetServiceClient { 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 @@ -358,19 +359,14 @@ export class AssetServiceClient { * 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 [Asset]{@link google.cloud.asset.v1p5beta1.Asset}. - * 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 [Asset]{@link google.cloud.asset.v1p5beta1.Asset} 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 [ListAssetsRequest]{@link google.cloud.asset.v1p5beta1.ListAssetsRequest} - * 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 - * [ListAssetsResponse]{@link google.cloud.asset.v1p5beta1.ListAssetsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * 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. */ listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, @@ -418,18 +414,7 @@ export class AssetServiceClient { } /** - * Equivalent to {@link listAssets}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssets} 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 @@ -463,6 +448,13 @@ export class AssetServiceClient { * 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 [Asset]{@link google.cloud.asset.v1p5beta1.Asset} 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 `listAssetsAsync()` + * 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. */ listAssetsStream( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, @@ -487,10 +479,9 @@ export class AssetServiceClient { } /** - * Equivalent to {@link listAssets}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listAssets`, 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 @@ -523,7 +514,18 @@ export class AssetServiceClient { * @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 + * [Asset]{@link google.cloud.asset.v1p5beta1.Asset}. 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.listAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listAssetsAsync( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, @@ -549,9 +551,10 @@ export class AssetServiceClient { } /** - * 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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index cfca8a811b5..ff6c0fcf8fe 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -132,6 +132,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.160311084", "protos/google/cloud/asset/v1/asset_service.proto", "protos/google/cloud/asset/v1/assets.proto", "protos/google/cloud/asset/v1beta1/asset_service.proto", @@ -149,6 +150,7 @@ "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.2464353656", "src/index.ts", "src/v1/asset_service_client.ts", "src/v1/asset_service_client_config.json", diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index f1056a37fb9..b551d6664dc 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,15 @@ import {AssetServiceClient} from '@google-cloud/asset'; +// check that the client class type name can be used +function doStuffWithAssetServiceClient(client: AssetServiceClient) { + client.close(); +} + function main() { - new AssetServiceClient(); + // check that the client instance can be created + const assetServiceClient = new AssetServiceClient(); + doStuffWithAssetServiceClient(assetServiceClient); } main(); diff --git a/packages/google-cloud-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-asset/system-test/install.ts +++ b/packages/google-cloud-asset/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 c54ef4f4f97dadde2f96fa6df2a0594c3115ca45 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 12 Nov 2020 14:23:17 -0800 Subject: [PATCH 283/429] build: sync metadata --- packages/google-cloud-asset/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index ff6c0fcf8fe..35de023dd3c 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "3c1cb89c136232bf9b5c8a22e62124f7d48c7303" + "sha": "4a0c817c0fd0cbbbdda9a8c874a6076ab3660162" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "00bbad4dfd6633cf4b5f9596c1f93b756bb5c776", - "internalRef": "339708980" + "sha": "b759c563bacf9cd15749be4d2bdd276d3f48ee29", + "internalRef": "341102751" } }, { From 608ee1beca656cc3a93eacbc3140906cffb2b425 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2020 14:50:31 -0800 Subject: [PATCH 284/429] chore: release 3.9.1 (#425) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 593671a0a16..1fb46542f3c 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.9.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.9.0...v3.9.1) (2020-11-12) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#419](https://www.github.com/googleapis/nodejs-asset/issues/419)) ([790ffd3](https://www.github.com/googleapis/nodejs-asset/commit/790ffd374b3bad580c2ba5dc5a7fd608d590cf32)) + ## [3.9.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.8.0...v3.9.0) (2020-11-02) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 4566e70233e..0e215e77ae8 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.9.0", + "version": "3.9.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 70cf4673c07..9de361fdb4e 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.9.0", + "@google-cloud/asset": "^3.9.1", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 5143db79bb631515f1c991e2bc00abcd6201acae Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 13 Nov 2020 11:18:14 -0500 Subject: [PATCH 285/429] test: turn on some test, turn off others (#426) --- packages/google-cloud-asset/samples/test/sample.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 31b865f39b0..30be671a8d9 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -70,19 +70,19 @@ describe('quickstart sample tests', () => { // The assets returned within 'readTimeWindow' frequently do not include // the newly created bucket: - it.skip('should get assets history successfully', async () => { + it('should get assets history successfully', async () => { const assetName = `//storage.googleapis.com/${bucketName}`; const stdout = execSync(`node getBatchAssetHistory ${assetName}`); assert.include(stdout, assetName); }); - it.skip('should run the quickstart', async () => { + it('should run the quickstart', async () => { const assetName = `//storage.googleapis.com/${bucketName}`; const stdout = execSync(`node quickstart ${assetName}`); assert.include(stdout, assetName); }); - it('should search all resources successfully', async () => { + it.skip('should search all resources successfully', async () => { const query = `name:${vmName}`; const stdout = execSync(`node searchAllResources '' ${query}`); assert.include(stdout, vmName); From 05c4df298911f5953f8bd3988f383d8e6a91dfd6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 19 Nov 2020 11:43:32 -0800 Subject: [PATCH 286/429] build: update to protos.json --- .../google-cloud-asset/protos/protos.json | 343 ++++++++++++++++-- packages/google-cloud-asset/synth.metadata | 4 +- 2 files changed, 317 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index c06f4f4afaf..cbdc8c237fc 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -31,14 +31,35 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.ExportAssetsResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.ExportAssetsRequest" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}:exportAssets", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1.ExportAssetsResponse", + "metadata_type": "google.cloud.asset.v1.ExportAssetsRequest" + } + } + ] }, "BatchGetAssetsHistory": { "requestType": "BatchGetAssetsHistoryRequest", "responseType": "BatchGetAssetsHistoryResponse", "options": { "(google.api.http).get": "/v1/{parent=*/*}:batchGetAssetsHistory" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}:batchGetAssetsHistory" + } + } + ] }, "CreateFeed": { "requestType": "CreateFeedRequest", @@ -47,7 +68,18 @@ "(google.api.http).post": "/v1/{parent=*/*}/feeds", "(google.api.http).body": "*", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}/feeds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetFeed": { "requestType": "GetFeedRequest", @@ -55,7 +87,17 @@ "options": { "(google.api.http).get": "/v1/{name=*/*/feeds/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListFeeds": { "requestType": "ListFeedsRequest", @@ -63,7 +105,17 @@ "options": { "(google.api.http).get": "/v1/{parent=*/*}/feeds", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/feeds" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "UpdateFeed": { "requestType": "UpdateFeedRequest", @@ -72,7 +124,18 @@ "(google.api.http).patch": "/v1/{feed.name=*/*/feeds/*}", "(google.api.http).body": "*", "(google.api.method_signature)": "feed" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{feed.name=*/*/feeds/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "feed" + } + ] }, "DeleteFeed": { "requestType": "DeleteFeedRequest", @@ -80,7 +143,17 @@ "options": { "(google.api.http).delete": "/v1/{name=*/*/feeds/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "SearchAllResources": { "requestType": "SearchAllResourcesRequest", @@ -88,7 +161,17 @@ "options": { "(google.api.http).get": "/v1/{scope=*/*}:searchAllResources", "(google.api.method_signature)": "scope,query,asset_types" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:searchAllResources" + } + }, + { + "(google.api.method_signature)": "scope,query,asset_types" + } + ] }, "SearchAllIamPolicies": { "requestType": "SearchAllIamPoliciesRequest", @@ -96,14 +179,31 @@ "options": { "(google.api.http).get": "/v1/{scope=*/*}:searchAllIamPolicies", "(google.api.method_signature)": "scope,query" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:searchAllIamPolicies" + } + }, + { + "(google.api.method_signature)": "scope,query" + } + ] }, "AnalyzeIamPolicy": { "requestType": "AnalyzeIamPolicyRequest", "responseType": "AnalyzeIamPolicyResponse", "options": { "(google.api.http).get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + } + } + ] }, "AnalyzeIamPolicyLongrunning": { "requestType": "AnalyzeIamPolicyLongrunningRequest", @@ -113,7 +213,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", + "metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" + } + } + ] } } }, @@ -1243,7 +1357,31 @@ "(google.api.http).additional_bindings.body": "*", "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1beta1.ExportAssetsResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1beta1.ExportAssetsRequest" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}:exportAssets", + "body": "*", + "additional_bindings": [ + { + "post": "/v1beta1/{parent=folders/*}:exportAssets", + "body": "*" + }, + { + "post": "/v1beta1/{parent=organizations/*}:exportAssets", + "body": "*" + } + ] + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1beta1.ExportAssetsResponse", + "metadata_type": "google.cloud.asset.v1beta1.ExportAssetsRequest" + } + } + ] }, "BatchGetAssetsHistory": { "requestType": "BatchGetAssetsHistoryRequest", @@ -1251,7 +1389,17 @@ "options": { "(google.api.http).get": "/v1beta1/{parent=projects/*}:batchGetAssetsHistory", "(google.api.http).additional_bindings.get": "/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}:batchGetAssetsHistory", + "additional_bindings": { + "get": "/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" + } + } + } + ] } } }, @@ -1486,7 +1634,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{scope=*/*}/resources:searchAll", "(google.api.method_signature)": "scope,query,asset_types" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{scope=*/*}/resources:searchAll" + } + }, + { + "(google.api.method_signature)": "scope,query,asset_types" + } + ] }, "SearchAllIamPolicies": { "requestType": "SearchAllIamPoliciesRequest", @@ -1494,7 +1652,17 @@ "options": { "(google.api.http).get": "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll", "(google.api.method_signature)": "scope,query" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll" + } + }, + { + "(google.api.method_signature)": "scope,query" + } + ] } } }, @@ -1712,7 +1880,18 @@ "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", "(google.api.http).body": "*", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p2beta1/{parent=*/*}/feeds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetFeed": { "requestType": "GetFeedRequest", @@ -1720,7 +1899,17 @@ "options": { "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p2beta1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListFeeds": { "requestType": "ListFeedsRequest", @@ -1728,7 +1917,17 @@ "options": { "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p2beta1/{parent=*/*}/feeds" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "UpdateFeed": { "requestType": "UpdateFeedRequest", @@ -1737,7 +1936,18 @@ "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", "(google.api.http).body": "*", "(google.api.method_signature)": "feed" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "feed" + } + ] }, "DeleteFeed": { "requestType": "DeleteFeedRequest", @@ -1745,7 +1955,17 @@ "options": { "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1p2beta1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -2038,7 +2258,14 @@ "responseType": "AnalyzeIamPolicyResponse", "options": { "(google.api.http).get": "/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy" + } + } + ] }, "ExportIamPolicyAnalysis": { "requestType": "ExportIamPolicyAnalysisRequest", @@ -2048,7 +2275,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse", + "metadata_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest" + } + } + ] } } }, @@ -2507,7 +2748,14 @@ "responseType": "ListAssetsResponse", "options": { "(google.api.http).get": "/v1p5beta1/{parent=*/*}/assets" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p5beta1/{parent=*/*}/assets" + } + } + ] } } }, @@ -4524,7 +4772,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", @@ -4532,7 +4790,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", @@ -4540,7 +4808,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", @@ -4549,7 +4827,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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 35de023dd3c..1412d329ff8 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "4a0c817c0fd0cbbbdda9a8c874a6076ab3660162" + "sha": "e05a3168955f8590db9581766530ef546d61a363" } }, { @@ -132,7 +132,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.160311084", "protos/google/cloud/asset/v1/asset_service.proto", "protos/google/cloud/asset/v1/assets.proto", "protos/google/cloud/asset/v1beta1/asset_service.proto", @@ -150,7 +149,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.2464353656", "src/index.ts", "src/v1/asset_service_client.ts", "src/v1/asset_service_client_config.json", From c70c48f8d116b6cd7513d2bf3e5bbb33815694ff Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 11:09:38 -0800 Subject: [PATCH 287/429] chore: address linting issues --- .../src/v1p1beta1/asset_service_client.ts | 12 +++--------- packages/google-cloud-asset/synth.metadata | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 27fe5891a24..1f40241c597 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -542,9 +542,7 @@ export class AssetServiceClient { searchAllResourcesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options?: gax.CallOptions - ): AsyncIterable< - protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata - > { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -561,9 +559,7 @@ export class AssetServiceClient { this.innerApiCalls['searchAllResources'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata - >; + ) as AsyncIterable; } searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, @@ -810,9 +806,7 @@ export class AssetServiceClient { this.innerApiCalls['searchAllIamPolicies'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult - >; + ) as AsyncIterable; } /** diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 1412d329ff8..7f0cb5d1473 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "e05a3168955f8590db9581766530ef546d61a363" + "sha": "678ce5433f478b81698c68e0ffc52ff7a21ce692" } }, { From db70da88c694512050119f79dacb53218b9eaf79 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:34:32 -0800 Subject: [PATCH 288/429] docs: spelling correction for "targetting" (#435) 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 --- packages/google-cloud-asset/README.md | 2 +- packages/google-cloud-asset/synth.metadata | 111 +-------------------- 2 files changed, 3 insertions(+), 110 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 6585cd39ea1..7f8d7e4e1e4 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -119,7 +119,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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 7f0cb5d1473..a9684364814 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "678ce5433f478b81698c68e0ffc52ff7a21ce692" + "sha": "3d6d4cea05c0f87f9780a63ec59d4f17cf5667d1" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -78,112 +78,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/asset/v1/asset_service.proto", - "protos/google/cloud/asset/v1/assets.proto", - "protos/google/cloud/asset/v1beta1/asset_service.proto", - "protos/google/cloud/asset/v1beta1/assets.proto", - "protos/google/cloud/asset/v1p1beta1/asset_service.proto", - "protos/google/cloud/asset/v1p1beta1/assets.proto", - "protos/google/cloud/asset/v1p2beta1/asset_service.proto", - "protos/google/cloud/asset/v1p2beta1/assets.proto", - "protos/google/cloud/asset/v1p4beta1/asset_service.proto", - "protos/google/cloud/asset/v1p4beta1/assets.proto", - "protos/google/cloud/asset/v1p5beta1/asset_service.proto", - "protos/google/cloud/asset/v1p5beta1/assets.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1/asset_service_client.ts", - "src/v1/asset_service_client_config.json", - "src/v1/asset_service_proto_list.json", - "src/v1/index.ts", - "src/v1beta1/asset_service_client.ts", - "src/v1beta1/asset_service_client_config.json", - "src/v1beta1/asset_service_proto_list.json", - "src/v1beta1/index.ts", - "src/v1p1beta1/asset_service_client.ts", - "src/v1p1beta1/asset_service_client_config.json", - "src/v1p1beta1/asset_service_proto_list.json", - "src/v1p1beta1/index.ts", - "src/v1p2beta1/asset_service_client.ts", - "src/v1p2beta1/asset_service_client_config.json", - "src/v1p2beta1/asset_service_proto_list.json", - "src/v1p2beta1/index.ts", - "src/v1p4beta1/asset_service_client.ts", - "src/v1p4beta1/asset_service_client_config.json", - "src/v1p4beta1/asset_service_proto_list.json", - "src/v1p4beta1/index.ts", - "src/v1p5beta1/asset_service_client.ts", - "src/v1p5beta1/asset_service_client_config.json", - "src/v1p5beta1/asset_service_proto_list.json", - "src/v1p5beta1/index.ts", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_asset_service_v1.ts", - "test/gapic_asset_service_v1beta1.ts", - "test/gapic_asset_service_v1p1beta1.ts", - "test/gapic_asset_service_v1p2beta1.ts", - "test/gapic_asset_service_v1p4beta1.ts", - "test/gapic_asset_service_v1p5beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 50375cf3f6a75eaa0d8ada176490ac1d5c61acd0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 1 Dec 2020 09:30:24 -0800 Subject: [PATCH 289/429] feat: added support OSInventory in Assets (#436) * feat: added support OSInventory in Assets. docs: updated existing docs. Clients receive detailed OSInventory in Assets. PiperOrigin-RevId: 342689216 Source-Author: Google APIs Source-Date: Mon Nov 16 12:04:29 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb Source-Link: https://github.com/googleapis/googleapis/commit/1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb * 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 * build: use gapic-generator-typescript v1.2.6 Committer: @alexander-fenster PiperOrigin-RevId: 343202295 Source-Author: Google APIs Source-Date: Wed Nov 18 18:55:28 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 2f019bf70bfe06f1e2af1b04011b0a2405190e43 Source-Link: https://github.com/googleapis/googleapis/commit/2f019bf70bfe06f1e2af1b04011b0a2405190e43 * build: include osconfig v1 protos into asset v1 Node.js package. PiperOrigin-RevId: 344904496 Source-Author: Google APIs Source-Date: Mon Nov 30 15:48:16 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: a578b42319ca0e3c7b6fec600a4ee9ec57443598 Source-Link: https://github.com/googleapis/googleapis/commit/a578b42319ca0e3c7b6fec600a4ee9ec57443598 --- .../google/cloud/asset/v1/asset_service.proto | 3 + .../protos/google/cloud/asset/v1/assets.proto | 6 + .../google/cloud/osconfig/v1/inventory.proto | 258 ++ .../cloud/osconfig/v1/osconfig_common.proto | 38 + .../cloud/osconfig/v1/osconfig_service.proto | 119 + .../cloud/osconfig/v1/patch_deployments.proto | 274 ++ .../google/cloud/osconfig/v1/patch_jobs.proto | 739 +++++ .../google-cloud-asset/protos/protos.d.ts | 1083 +++++- packages/google-cloud-asset/protos/protos.js | 2923 +++++++++++++++++ .../google-cloud-asset/protos/protos.json | 293 +- .../src/v1/asset_service_client.ts | 134 +- .../src/v1beta1/asset_service_client.ts | 36 +- .../src/v1p1beta1/asset_service_client.ts | 44 +- .../src/v1p2beta1/asset_service_client.ts | 66 +- .../src/v1p4beta1/asset_service_client.ts | 36 +- .../src/v1p5beta1/asset_service_client.ts | 30 +- packages/google-cloud-asset/synth.metadata | 6 +- 17 files changed, 5934 insertions(+), 154 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index c5873958ad4..ee8c4129d16 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -1046,4 +1046,7 @@ enum ContentType { // The Cloud Access context manager Policy set on an asset. ACCESS_POLICY = 5; + + // The runtime OS Inventory information. + OS_INVENTORY = 6; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index c06caf71a7d..f7e2432fcc7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -21,6 +21,7 @@ import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; @@ -153,6 +154,11 @@ message Asset { google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } + // A representation of runtime OS Inventory information. See [this + // topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + // for more information. + google.cloud.osconfig.v1.Inventory os_inventory = 12; + // The ancestry path of an asset in Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // represented as a list of relative resource names. An ancestry path starts diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto new file mode 100644 index 00000000000..ba3318e70e4 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto @@ -0,0 +1,258 @@ +// 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.osconfig.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS Config Inventory is a service for collecting and reporting operating +// system and package information on VM instances. + +// The inventory details of a VM. +message Inventory { + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // Details related to a Windows Update package. + // Field data and names are taken from Windows Update API IUpdate Interface: + // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + google.protobuf.Timestamp last_deployment_change_time = 10; + } + + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + + // Information related to a Quick Fix Engineering package. + // Fields are taken from Windows QuickFixEngineering Interface and match + // the source names: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Base level operating system information for the VM. + OsInfo os_info = 1; + + // Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto new file mode 100644 index 00000000000..43059e9a62e --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -0,0 +1,38 @@ +// 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.osconfig.v1; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 2; + } +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto new file mode 100644 index 00000000000..2a654eaa2a4 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -0,0 +1,119 @@ +// 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_deployments.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "OsConfigProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" +}; + +// OS Config API +// +// The OS Config service is a server-side component that you can use to +// manage package installations and patch jobs for virtual machine instances. +service OsConfigService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Patch VM instances by creating and running a patch job. + rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchJobs:execute" + body: "*" + }; + } + + // Get the patch job. This can be used to track the progress of an + // ongoing patch job or review the details of completed jobs. + rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel a patch job. The patch job must be active. Canceled patch jobs + // cannot be restarted. + rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchJobs/*}:cancel" + body: "*" + }; + } + + // Get a list of patch jobs. + rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get a list of instance details for a given patch job. + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) returns (ListPatchJobInstanceDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Create an OS Config patch deployment. + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchDeployments" + body: "patch_deployment" + }; + option (google.api.method_signature) = "parent,patch_deployment,patch_deployment_id"; + } + + // Get an OS Config patch deployment. + rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a page of OS Config patch deployments. + rpc ListPatchDeployments(ListPatchDeploymentsRequest) returns (ListPatchDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete an OS Config patch deployment. + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto new file mode 100644 index 00000000000..d8bb84a91e5 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -0,0 +1,274 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "PatchDeployments"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Patch deployments are configurations that individual patch jobs use to +// complete a patch. These configurations include instance filter, package +// repository settings, and a schedule. For more information about creating and +// managing patch deployments, see [Scheduling patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs). +message PatchDeployment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchDeployment" + pattern: "projects/{project}/patchDeployments/{patch_deployment}" + }; + + // Unique name for the patch deployment resource in a project. The patch + // deployment name is in the form: + // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. + // This field is ignored when you create a new patch deployment. + string name = 1; + + // Optional. Description of the patch deployment. Length of the description is + // limited to 1024 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. VM instances to patch. + PatchInstanceFilter instance_filter = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Patch configuration that is applied. + PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Duration of the patch. After the duration ends, the patch times + // out. + google.protobuf.Duration duration = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Schedule for the patch. + oneof schedule { + // Required. Schedule a one-time execution. + OneTimeSchedule one_time_schedule = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule recurring executions. + RecurringSchedule recurring_schedule = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. Time the patch deployment was created. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the patch deployment was last updated. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time a patch job was started by this deployment. + // Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text + // format. + google.protobuf.Timestamp last_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Rollout strategy of the patch job. + PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Sets the time for a one time patch deployment. Timestamp is in +// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. +message OneTimeSchedule { + // Required. The desired patch job execution time. + google.protobuf.Timestamp execute_time = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Sets the time for recurring patch deployments. +message RecurringSchedule { + // Specifies the frequency of the recurring patch deployments. + enum Frequency { + // Invalid. A frequency must be specified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates that the frequency should be expressed in terms of + // weeks. + WEEKLY = 1; + + // Indicates that the frequency should be expressed in terms of + // months. + MONTHLY = 2; + } + + // Required. Defines the time zone that `time_of_day` is relative to. + // The rules for daylight saving time are determined by the chosen time zone. + google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The time that the recurring schedule becomes effective. + // Defaults to `create_time` of the patch deployment. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end time at which a recurring patch deployment schedule is no + // longer active. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time of the day to run a recurring deployment. + google.type.TimeOfDay time_of_day = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The frequency unit of this recurring schedule. + Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for this recurring schedule. + // Configurations must match frequency. + oneof schedule_config { + // Required. Schedule with weekly executions. + WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule with monthly executions. + MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The time the last patch job ran successfully. + google.protobuf.Timestamp last_execute_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the next patch job is scheduled to run. + google.protobuf.Timestamp next_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a weekly schedule. +message WeeklySchedule { + // Required. Day of the week. + google.type.DayOfWeek day_of_week = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a monthly schedule. An example of a valid monthly schedule is +// "on the third Tuesday of the month" or "on the 15th of the month". +message MonthlySchedule { + // One day in a month. + oneof day_of_month { + // Required. Week day in a month. + WeekDayOfMonth week_day_of_month = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. One day of the month. 1-31 indicates the 1st to the 31st day. + // -1 indicates the last day of the month. Months without the target day + // will be skipped. For example, a schedule to run "every month on the 31st" + // will not run in February, April, June, etc. + int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Represents one week day in a month. An example is "the 4th Sunday". +message WeekDayOfMonth { + // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the + // month. -1 indicates the last week of the month. + int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for creating a patch deployment. +message CreatePatchDeploymentRequest { + // Required. The project to apply this patch deployment to in the form + // `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. A name for the patch deployment in the project. When creating a + // name the following rules apply: + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The patch deployment to create. + PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for retrieving a patch deployment. +message GetPatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for listing patch deployments. +message ListPatchDeploymentsRequest { + // Required. The resource name of the parent in the form `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of patch deployments to return. Default is + // 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to + // ListPatchDeployments that indicates where this listing should continue + // from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for listing patch deployments. +message ListPatchDeploymentsResponse { + // The list of patch deployments. + repeated PatchDeployment patch_deployments = 1; + + // A pagination token that can be used to get the next page of patch + // deployments. + string next_page_token = 2; +} + +// A request message for deleting a patch deployment. +message DeletePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto new file mode 100644 index 00000000000..1fffb532a11 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -0,0 +1,739 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_outer_classname = "PatchJobs"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// A request message to initiate patching across Compute Engine +// instances. +message ExecutePatchJobRequest { + // Required. The project in which to run this patch in the form `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Required. Instances to patch, either explicitly or filtered by some + // criteria such as zone or labels. + PatchInstanceFilter instance_filter = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Patch configuration being applied. If omitted, instances are + // patched using the default configurations. + PatchConfig patch_config = 4; + + // Duration of the patch job. After the duration ends, the patch job + // times out. + google.protobuf.Duration duration = 5; + + // If this patch is a dry-run only, instances are contacted but + // will do nothing. + bool dry_run = 6; + + // Display name for this patch job. This does not have to be unique. + string display_name = 8; + + // Rollout strategy of the patch job. + PatchRollout rollout = 9; +} + +// Request to get an active or completed patch job. +message GetPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Request to list details for all instances that are part of a patch job. +message ListPatchJobInstanceDetailsRequest { + // Required. The parent for the instances are in the form of + // `projects/*/patchJobs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; + + // The maximum number of instance details records to return. Default is 100. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // A filter expression that filters results listed in the response. This + // field supports filtering results by instance zone, name, state, or + // `failure_reason`. + string filter = 4; +} + +// A response message for listing the instances details for a patch job. +message ListPatchJobInstanceDetailsResponse { + // A list of instance status. + repeated PatchJobInstanceDetails patch_job_instance_details = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// Patch details for a VM instance. For more information about reviewing VM +// instance details, see +// [Listing all VM instance details for a specific patch +// job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details). +message PatchJobInstanceDetails { + // The instance name in the form `projects/*/zones/*/instances/*` + string name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The unique identifier for the instance. This identifier is + // defined by the server. + string instance_system_id = 2; + + // Current state of instance patch. + Instance.PatchState state = 3; + + // If the patch fails, this field provides the reason. + string failure_reason = 4; + + // The number of times the agent that the agent attempts to apply the patch. + int64 attempt_count = 5; +} + +// A request message for listing patch jobs. +message ListPatchJobsRequest { + // Required. In the form of `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of instance status to return. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by patch + // jobs to be included in the response. + // Currently, filtering is only available on the patch_deployment field. + string filter = 4; +} + +// A response message for listing patch jobs. +message ListPatchJobsResponse { + // The list of patch jobs. + repeated PatchJob patch_jobs = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// A high level representation of a patch job that is either in progress +// or has completed. +// +// Instance details are not included in the job. To paginate through instance +// details, use ListPatchJobInstanceDetails. +// +// For more information about patch jobs, see +// [Creating patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job). +message PatchJob { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchJob" + pattern: "projects/{project}/patchJobs/{patch_job}" + }; + + // A summary of the current patch state across all instances that this patch + // job affects. Contains counts of instances in different states. These states + // map to `InstancePatchState`. List patch job instance details to see the + // specific states of each instance. + message InstanceDetailsSummary { + // Number of instances pending patch job. + int64 pending_instance_count = 1; + + // Number of instances that are inactive. + int64 inactive_instance_count = 2; + + // Number of instances notified about patch job. + int64 notified_instance_count = 3; + + // Number of instances that have started. + int64 started_instance_count = 4; + + // Number of instances that are downloading patches. + int64 downloading_patches_instance_count = 5; + + // Number of instances that are applying patches. + int64 applying_patches_instance_count = 6; + + // Number of instances rebooting. + int64 rebooting_instance_count = 7; + + // Number of instances that have completed successfully. + int64 succeeded_instance_count = 8; + + // Number of instances that require reboot. + int64 succeeded_reboot_required_instance_count = 9; + + // Number of instances that failed. + int64 failed_instance_count = 10; + + // Number of instances that have acked and will start shortly. + int64 acked_instance_count = 11; + + // Number of instances that exceeded the time out while applying the patch. + int64 timed_out_instance_count = 12; + + // Number of instances that are running the pre-patch step. + int64 pre_patch_step_instance_count = 13; + + // Number of instances that are running the post-patch step. + int64 post_patch_step_instance_count = 14; + + // Number of instances that do not appear to be running the agent. Check to + // ensure that the agent is installed, running, and able to communicate with + // the service. + int64 no_agent_detected_instance_count = 15; + } + + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + + // Unique identifier for this patch job in the form + // `projects/*/patchJobs/*` + string name = 1; + + // Display name for this patch job. This is not a unique identifier. + string display_name = 14; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Time this patch job was created. + google.protobuf.Timestamp create_time = 3; + + // Last time this patch job was updated. + google.protobuf.Timestamp update_time = 4; + + // The current state of the PatchJob. + State state = 5; + + // Instances to patch. + PatchInstanceFilter instance_filter = 13; + + // Patch configuration being applied. + PatchConfig patch_config = 7; + + // Duration of the patch job. After the duration ends, the + // patch job times out. + google.protobuf.Duration duration = 8; + + // Summary of instance details. + InstanceDetailsSummary instance_details_summary = 9; + + // If this patch job is a dry run, the agent reports that it has + // finished without running any updates on the VM instance. + bool dry_run = 10; + + // If this patch job failed, this message provides information about the + // failure. + string error_message = 11; + + // Reflects the overall progress of the patch job in the range of + // 0.0 being no progress to 100.0 being complete. + double percent_complete = 12; + + // Output only. Name of the patch deployment that created this patch job. + string patch_deployment = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; + + // Rollout strategy being applied. + PatchRollout rollout = 16; +} + +// Patch configuration specifications. Contains details on how to apply the +// patch(es) to a VM instance. +message PatchConfig { + // Post-patch reboot settings. + enum RebootConfig { + // The default behavior is DEFAULT. + REBOOT_CONFIG_UNSPECIFIED = 0; + + // The agent decides if a reboot is necessary by checking signals such as + // registry keys on Windows or `/var/run/reboot-required` on APT based + // systems. On RPM based systems, a set of core system package install times + // are compared with system boot time. + DEFAULT = 1; + + // Always reboot the machine after the update completes. + ALWAYS = 2; + + // Never reboot the machine after the update completes. + NEVER = 3; + } + + // Post-patch reboot settings. + RebootConfig reboot_config = 1; + + // Apt update settings. Use this setting to override the default `apt` patch + // rules. + AptSettings apt = 3; + + // Yum update settings. Use this setting to override the default `yum` patch + // rules. + YumSettings yum = 4; + + // Goo update settings. Use this setting to override the default `goo` patch + // rules. + GooSettings goo = 5; + + // Zypper update settings. Use this setting to override the default `zypper` + // patch rules. + ZypperSettings zypper = 6; + + // Windows update settings. Use this override the default windows patch rules. + WindowsUpdateSettings windows_update = 7; + + // The `ExecStep` to run before the patch update. + ExecStep pre_step = 8; + + // The `ExecStep` to run after the patch update. + ExecStep post_step = 9; +} + +// Namespace for instance state enums. +message Instance { + // Patch state of an instance. + enum PatchState { + // Unspecified. + PATCH_STATE_UNSPECIFIED = 0; + + // The instance is not yet notified. + PENDING = 1; + + // Instance is inactive and cannot be patched. + INACTIVE = 2; + + // The instance is notified that it should be patched. + NOTIFIED = 3; + + // The instance has started the patching process. + STARTED = 4; + + // The instance is downloading patches. + DOWNLOADING_PATCHES = 5; + + // The instance is applying patches. + APPLYING_PATCHES = 6; + + // The instance is rebooting. + REBOOTING = 7; + + // The instance has completed applying patches. + SUCCEEDED = 8; + + // The instance has completed applying patches but a reboot is required. + SUCCEEDED_REBOOT_REQUIRED = 9; + + // The instance has failed to apply the patch. + FAILED = 10; + + // The instance acked the notification and will start shortly. + ACKED = 11; + + // The instance exceeded the time out while applying the patch. + TIMED_OUT = 12; + + // The instance is running the pre-patch step. + RUNNING_PRE_PATCH_STEP = 13; + + // The instance is running the post-patch step. + RUNNING_POST_PATCH_STEP = 14; + + // The service could not detect the presence of the agent. Check to ensure + // that the agent is installed, running, and able to communicate with the + // service. + NO_AGENT_DETECTED = 15; + } +} + +// Message for canceling a patch job. +message CancelPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Apt patching is completed by executing `apt-get update && apt-get +// upgrade`. Additional options can be set to control how this is executed. +message AptSettings { + // Apt patch type. + enum Type { + // By default, upgrade will be performed. + TYPE_UNSPECIFIED = 0; + + // Runs `apt-get dist-upgrade`. + DIST = 1; + + // Runs `apt-get upgrade`. + UPGRADE = 2; + } + + // By changing the type to DIST, the patching is performed + // using `apt-get dist-upgrade` instead. + Type type = 1; + + // List of packages to exclude from update. These packages will be excluded + repeated string excludes = 2; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field cannot be specified with any other patch configuration + // fields. + repeated string exclusive_packages = 3; +} + +// Yum patching is performed by executing `yum update`. Additional options +// can be set to control how this is executed. +// +// Note that not all settings are supported on all platforms. +message YumSettings { + // Adds the `--security` flag to `yum update`. Not supported on + // all platforms. + bool security = 1; + + // Will cause patch to run `yum update-minimal` instead. + bool minimal = 2; + + // List of packages to exclude from update. These packages are excluded by + // using the yum `--exclude` flag. + repeated string excludes = 3; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field must not be specified with any other patch + // configuration fields. + repeated string exclusive_packages = 4; +} + +// Googet patching is performed by running `googet update`. +message GooSettings {} + +// Zypper patching is performed by running `zypper patch`. +// See also https://en.opensuse.org/SDB:Zypper_manual. +message ZypperSettings { + // Adds the `--with-optional` flag to `zypper patch`. + bool with_optional = 1; + + // Adds the `--with-update` flag, to `zypper patch`. + bool with_update = 2; + + // Install only patches with these categories. + // Common categories include security, recommended, and feature. + repeated string categories = 3; + + // Install only patches with these severities. + // Common severities include critical, important, moderate, and low. + repeated string severities = 4; + + // List of patches to exclude from update. + repeated string excludes = 5; + + // An exclusive list of patches to be updated. These are the only patches + // that will be installed using 'zypper patch patch:' command. + // This field must not be used with any other patch configuration fields. + repeated string exclusive_patches = 6; +} + +// Windows patching is performed using the Windows Update Agent. +message WindowsUpdateSettings { + // Microsoft Windows update classifications as defined in + // [1] + // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro + enum Classification { + // Invalid. If classifications are included, they must be specified. + CLASSIFICATION_UNSPECIFIED = 0; + + // "A widely released fix for a specific problem that addresses a critical, + // non-security-related bug." [1] + CRITICAL = 1; + + // "A widely released fix for a product-specific, security-related + // vulnerability. Security vulnerabilities are rated by their severity. The + // severity rating is indicated in the Microsoft security bulletin as + // critical, important, moderate, or low." [1] + SECURITY = 2; + + // "A widely released and frequent software update that contains additions + // to a product's definition database. Definition databases are often used + // to detect objects that have specific attributes, such as malicious code, + // phishing websites, or junk mail." [1] + DEFINITION = 3; + + // "Software that controls the input and output of a device." [1] + DRIVER = 4; + + // "New product functionality that is first distributed outside the context + // of a product release and that is typically included in the next full + // product release." [1] + FEATURE_PACK = 5; + + // "A tested, cumulative set of all hotfixes, security updates, critical + // updates, and updates. Additionally, service packs may contain additional + // fixes for problems that are found internally since the release of the + // product. Service packs my also contain a limited number of + // customer-requested design changes or features." [1] + SERVICE_PACK = 6; + + // "A utility or feature that helps complete a task or set of tasks." [1] + TOOL = 7; + + // "A tested, cumulative set of hotfixes, security updates, critical + // updates, and updates that are packaged together for easy deployment. A + // rollup generally targets a specific area, such as security, or a + // component of a product, such as Internet Information Services (IIS)." [1] + UPDATE_ROLLUP = 8; + + // "A widely released fix for a specific problem. An update addresses a + // noncritical, non-security-related bug." [1] + UPDATE = 9; + } + + // Only apply updates of these windows update classifications. If empty, all + // updates are applied. + repeated Classification classifications = 1; + + // List of KBs to exclude from update. + repeated string excludes = 2; + + // An exclusive list of kbs to be updated. These are the only patches + // that will be updated. This field must not be used with other + // patch configurations. + repeated string exclusive_patches = 3; +} + +// A step that runs an executable for a PatchJob. +message ExecStep { + // The ExecStepConfig for all Linux VMs targeted by the PatchJob. + ExecStepConfig linux_exec_step_config = 1; + + // The ExecStepConfig for all Windows VMs targeted by the PatchJob. + ExecStepConfig windows_exec_step_config = 2; +} + +// Common configurations for an ExecStep. +message ExecStepConfig { + // The interpreter used to execute the a file. + enum Interpreter { + // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the + // interpreter will be parsed from the shebang line of the script if + // unspecified. + INTERPRETER_UNSPECIFIED = 0; + + // Indicates that the script is run with `/bin/sh` on Linux and `cmd` + // on Windows. + SHELL = 1; + + // Indicates that the file is run with PowerShell flags + // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`. + POWERSHELL = 2; + } + + // Location of the executable. + oneof executable { + // An absolute path to the executable on the VM. + string local_path = 1; + + // A Cloud Storage object containing the executable. + GcsObject gcs_object = 2; + } + + // Defaults to [0]. A list of possible return values that the + // execution can return to indicate a success. + repeated int32 allowed_success_codes = 3; + + // The script interpreter to use to run the script. If no interpreter is + // specified the script will be executed directly, which will likely + // only succeed for scripts with [shebang lines] + // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)). + Interpreter interpreter = 4; +} + +// Cloud Storage object representation. +message GcsObject { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Generation number of the Cloud Storage object. This is used to + // ensure that the ExecStep specified by this PatchJob does not change. + int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A filter to target VM instances for patching. The targeted +// VMs must meet all criteria specified. So if both labels and zones are +// specified, the patch job targets only VMs with those labels and in those +// zones. +message PatchInstanceFilter { + // Targets a group of VM instances by using their [assigned + // labels](https://cloud.google.com/compute/docs/labeling-resources). Labels + // are key-value pairs. A `GroupLabel` is a combination of labels + // that is used to target VMs for a patch job. + // + // For example, a patch job can target VMs that have the following + // `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job + // is applied to VMs that have both the labels `env=test` and `app=web`. + message GroupLabel { + // Compute Engine instance labels that must be present for a VM + // instance to be targeted by this filter. + map labels = 1; + } + + // Target all VM instances in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Targets VM instances matching ANY of these GroupLabels. This allows + // targeting of disparate groups of VM instances. + repeated GroupLabel group_labels = 2; + + // Targets VM instances in ANY of these zones. Leave empty to target VM + // instances in any zone. + repeated string zones = 3; + + // Targets any of the VM instances specified. Instances are specified by their + // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`, + // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or + // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]` + repeated string instances = 4; + + // Targets VMs whose name starts with one of these prefixes. Similar to + // labels, this is another way to group VMs when targeting configs, for + // example prefix="prod-". + repeated string instance_name_prefixes = 5; +} + +// Patch rollout configuration specifications. Contains details on the +// concurrency control when applying patch(es) to all targeted VMs. +message PatchRollout { + // Type of the rollout. + enum Mode { + // Mode must be specified. + MODE_UNSPECIFIED = 0; + + // Patches are applied one zone at a time. The patch job begins in the + // region with the lowest number of targeted VMs. Within the region, + // patching begins in the zone with the lowest number of targeted VMs. If + // multiple regions (or zones within a region) have the same number of + // targeted VMs, a tie-breaker is achieved by sorting the regions or zones + // in alphabetical order. + ZONE_BY_ZONE = 1; + + // Patches are applied to VMs in all zones at the same time. + CONCURRENT_ZONES = 2; + } + + // Mode of the patch rollout. + Mode mode = 1; + + // The maximum number (or percentage) of VMs per zone to disrupt at any given + // moment. The number of VMs calculated from multiplying the percentage by the + // total number of VMs in a zone is rounded up. + // + // During patching, a VM is considered disrupted from the time the agent is + // notified to begin until patching has completed. This disruption time + // includes the time to complete reboot and any post-patch steps. + // + // A VM contributes to the disruption budget if its patching operation fails + // either when applying the patches, running pre or post patch steps, or if it + // fails to respond with a success notification before timing out. VMs that + // are not running or do not have an active agent do not count toward this + // disruption budget. + // + // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded, + // the patch job stops, because continuing to the next zone requires + // completion of the patch process in the previous zone. + // + // For example, if the disruption budget has a fixed value of `10`, and 8 VMs + // fail to patch in the current zone, the patch job continues to patch 2 VMs + // at a time until the zone is completed. When that zone is completed + // successfully, patching begins with 10 VMs at a time in the next zone. If 10 + // VMs in the next zone fail to patch, the patch job stops. + FixedOrPercent disruption_budget = 2; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 7ed21b94829..dc57ee03015 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -3888,7 +3888,8 @@ export namespace google { RESOURCE = 1, IAM_POLICY = 2, ORG_POLICY = 4, - ACCESS_POLICY = 5 + ACCESS_POLICY = 5, + OS_INVENTORY = 6 } /** Properties of a TemporalAsset. */ @@ -4143,6 +4144,9 @@ export namespace google { /** Asset servicePerimeter */ servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** Asset osInventory */ + osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset ancestors */ ancestors?: (string[]|null); } @@ -4183,6 +4187,9 @@ export namespace google { /** Asset servicePerimeter. */ public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** Asset osInventory. */ + public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset ancestors. */ public ancestors: string[]; @@ -12437,6 +12444,1080 @@ export namespace google { } } } + + /** Namespace osconfig. */ + namespace osconfig { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory osInfo */ + osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items */ + items?: ({ [k: string]: google.cloud.osconfig.v1.Inventory.IItem }|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IInventory); + + /** Inventory osInfo. */ + public osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items. */ + public items: { [k: string]: google.cloud.osconfig.v1.Inventory.IItem }; + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1.IInventory): google.cloud.osconfig.v1.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @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.osconfig.v1.Inventory; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @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.osconfig.v1.Inventory; + + /** + * Verifies an Inventory 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 Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Inventory { + + /** Properties of an OsInfo. */ + interface IOsInfo { + + /** OsInfo hostname */ + hostname?: (string|null); + + /** OsInfo longName */ + longName?: (string|null); + + /** OsInfo shortName */ + shortName?: (string|null); + + /** OsInfo version */ + version?: (string|null); + + /** OsInfo architecture */ + architecture?: (string|null); + + /** OsInfo kernelVersion */ + kernelVersion?: (string|null); + + /** OsInfo kernelRelease */ + kernelRelease?: (string|null); + + /** OsInfo osconfigAgentVersion */ + osconfigAgentVersion?: (string|null); + } + + /** Represents an OsInfo. */ + class OsInfo implements IOsInfo { + + /** + * Constructs a new OsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo); + + /** OsInfo hostname. */ + public hostname: string; + + /** OsInfo longName. */ + public longName: string; + + /** OsInfo shortName. */ + public shortName: string; + + /** OsInfo version. */ + public version: string; + + /** OsInfo architecture. */ + public architecture: string; + + /** OsInfo kernelVersion. */ + public kernelVersion: string; + + /** OsInfo kernelRelease. */ + public kernelRelease: string; + + /** OsInfo osconfigAgentVersion. */ + public osconfigAgentVersion: string; + + /** + * Creates a new OsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OsInfo instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsInfo + * @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.osconfig.v1.Inventory.OsInfo; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsInfo + * @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.osconfig.v1.Inventory.OsInfo; + + /** + * Verifies an OsInfo 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 OsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @param message OsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.OsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item id */ + id?: (string|null); + + /** Item originType */ + originType?: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType|null); + + /** Item createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type */ + type?: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type|null); + + /** Item installedPackage */ + installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage */ + availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IItem); + + /** Item id. */ + public id: string; + + /** Item originType. */ + public originType: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType); + + /** Item createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type. */ + public type: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type); + + /** Item installedPackage. */ + public installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage. */ + public availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item details. */ + public details?: ("installedPackage"|"availablePackage"); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IItem): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @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.osconfig.v1.Inventory.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @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.osconfig.v1.Inventory.Item; + + /** + * Verifies an Item 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 Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Item { + + /** OriginType enum. */ + enum OriginType { + ORIGIN_TYPE_UNSPECIFIED = 0, + INVENTORY_REPORT = 1 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INSTALLED_PACKAGE = 1, + AVAILABLE_PACKAGE = 2 + } + } + + /** Properties of a SoftwarePackage. */ + interface ISoftwarePackage { + + /** SoftwarePackage yumPackage */ + yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage */ + aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage */ + zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage */ + googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch */ + zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage */ + wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage */ + qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage */ + cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + } + + /** Represents a SoftwarePackage. */ + class SoftwarePackage implements ISoftwarePackage { + + /** + * Constructs a new SoftwarePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage); + + /** SoftwarePackage yumPackage. */ + public yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage. */ + public aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage. */ + public zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage. */ + public googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch. */ + public zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage. */ + public wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage. */ + public qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage. */ + public cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage details. */ + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwarePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwarePackage + * @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.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwarePackage + * @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.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Verifies a SoftwarePackage 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 SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwarePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @param message SoftwarePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.SoftwarePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwarePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VersionedPackage. */ + interface IVersionedPackage { + + /** VersionedPackage packageName */ + packageName?: (string|null); + + /** VersionedPackage architecture */ + architecture?: (string|null); + + /** VersionedPackage version */ + version?: (string|null); + } + + /** Represents a VersionedPackage. */ + class VersionedPackage implements IVersionedPackage { + + /** + * Constructs a new VersionedPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage); + + /** VersionedPackage packageName. */ + public packageName: string; + + /** VersionedPackage architecture. */ + public architecture: string; + + /** VersionedPackage version. */ + public version: string; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedPackage + * @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.osconfig.v1.Inventory.VersionedPackage; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedPackage + * @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.osconfig.v1.Inventory.VersionedPackage; + + /** + * Verifies a VersionedPackage 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 VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @param message VersionedPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.VersionedPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WindowsUpdatePackage. */ + interface IWindowsUpdatePackage { + + /** WindowsUpdatePackage title */ + title?: (string|null); + + /** WindowsUpdatePackage description */ + description?: (string|null); + + /** WindowsUpdatePackage categories */ + categories?: (google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]|null); + + /** WindowsUpdatePackage kbArticleIds */ + kbArticleIds?: (string[]|null); + + /** WindowsUpdatePackage supportUrl */ + supportUrl?: (string|null); + + /** WindowsUpdatePackage moreInfoUrls */ + moreInfoUrls?: (string[]|null); + + /** WindowsUpdatePackage updateId */ + updateId?: (string|null); + + /** WindowsUpdatePackage revisionNumber */ + revisionNumber?: (number|null); + + /** WindowsUpdatePackage lastDeploymentChangeTime */ + lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsUpdatePackage. */ + class WindowsUpdatePackage implements IWindowsUpdatePackage { + + /** + * Constructs a new WindowsUpdatePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage); + + /** WindowsUpdatePackage title. */ + public title: string; + + /** WindowsUpdatePackage description. */ + public description: string; + + /** WindowsUpdatePackage categories. */ + public categories: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]; + + /** WindowsUpdatePackage kbArticleIds. */ + public kbArticleIds: string[]; + + /** WindowsUpdatePackage supportUrl. */ + public supportUrl: string; + + /** WindowsUpdatePackage moreInfoUrls. */ + public moreInfoUrls: string[]; + + /** WindowsUpdatePackage updateId. */ + public updateId: string; + + /** WindowsUpdatePackage revisionNumber. */ + public revisionNumber: number; + + /** WindowsUpdatePackage lastDeploymentChangeTime. */ + public lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdatePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdatePackage + * @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.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdatePackage + * @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.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Verifies a WindowsUpdatePackage 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 WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdatePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @param message WindowsUpdatePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WindowsUpdatePackage { + + /** Properties of a WindowsUpdateCategory. */ + interface IWindowsUpdateCategory { + + /** WindowsUpdateCategory id */ + id?: (string|null); + + /** WindowsUpdateCategory name */ + name?: (string|null); + } + + /** Represents a WindowsUpdateCategory. */ + class WindowsUpdateCategory implements IWindowsUpdateCategory { + + /** + * Constructs a new WindowsUpdateCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory); + + /** WindowsUpdateCategory id. */ + public id: string; + + /** WindowsUpdateCategory name. */ + public name: string; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdateCategory instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdateCategory + * @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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdateCategory + * @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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Verifies a WindowsUpdateCategory 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 WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdateCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @param message WindowsUpdateCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ZypperPatch. */ + interface IZypperPatch { + + /** ZypperPatch patchName */ + patchName?: (string|null); + + /** ZypperPatch category */ + category?: (string|null); + + /** ZypperPatch severity */ + severity?: (string|null); + + /** ZypperPatch summary */ + summary?: (string|null); + } + + /** Represents a ZypperPatch. */ + class ZypperPatch implements IZypperPatch { + + /** + * Constructs a new ZypperPatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); + + /** ZypperPatch patchName. */ + public patchName: string; + + /** ZypperPatch category. */ + public category: string; + + /** ZypperPatch severity. */ + public severity: string; + + /** ZypperPatch summary. */ + public summary: string; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperPatch instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperPatch + * @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.osconfig.v1.Inventory.ZypperPatch; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperPatch + * @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.osconfig.v1.Inventory.ZypperPatch; + + /** + * Verifies a ZypperPatch 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 ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperPatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @param message ZypperPatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperPatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WindowsQuickFixEngineeringPackage. */ + interface IWindowsQuickFixEngineeringPackage { + + /** WindowsQuickFixEngineeringPackage caption */ + caption?: (string|null); + + /** WindowsQuickFixEngineeringPackage description */ + description?: (string|null); + + /** WindowsQuickFixEngineeringPackage hotFixId */ + hotFixId?: (string|null); + + /** WindowsQuickFixEngineeringPackage installTime */ + installTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsQuickFixEngineeringPackage. */ + class WindowsQuickFixEngineeringPackage implements IWindowsQuickFixEngineeringPackage { + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage); + + /** WindowsQuickFixEngineeringPackage caption. */ + public caption: string; + + /** WindowsQuickFixEngineeringPackage description. */ + public description: string; + + /** WindowsQuickFixEngineeringPackage hotFixId. */ + public hotFixId: string; + + /** WindowsQuickFixEngineeringPackage installTime. */ + public installTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsQuickFixEngineeringPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsQuickFixEngineeringPackage + * @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.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsQuickFixEngineeringPackage + * @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.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Verifies a WindowsQuickFixEngineeringPackage 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 WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsQuickFixEngineeringPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @param message WindowsQuickFixEngineeringPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } } /** Namespace api. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index c77b139d6f5..1bfa136dfc5 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -678,6 +678,7 @@ case 2: case 4: case 5: + case 6: break; } if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { @@ -735,6 +736,10 @@ case 5: message.contentType = 5; break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; } if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") @@ -1237,6 +1242,7 @@ case 2: case 4: case 5: + case 6: break; } if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { @@ -1289,6 +1295,10 @@ case 5: message.contentType = 5; break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; } if (object.readTimeWindow != null) { if (typeof object.readTimeWindow !== "object") @@ -4806,6 +4816,7 @@ case 2: case 4: case 5: + case 6: break; } if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { @@ -4870,6 +4881,10 @@ case 5: message.contentType = 5; break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; } if (object.feedOutputConfig != null) { if (typeof object.feedOutputConfig !== "object") @@ -9067,6 +9082,7 @@ * @property {number} IAM_POLICY=2 IAM_POLICY value * @property {number} ORG_POLICY=4 ORG_POLICY value * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} OS_INVENTORY=6 OS_INVENTORY value */ v1.ContentType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -9075,6 +9091,7 @@ values[valuesById[2] = "IAM_POLICY"] = 2; values[valuesById[4] = "ORG_POLICY"] = 4; values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[6] = "OS_INVENTORY"] = 6; return values; })(); @@ -9652,6 +9669,7 @@ * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory * @property {Array.|null} [ancestors] Asset ancestors */ @@ -9744,6 +9762,14 @@ */ Asset.prototype.servicePerimeter = null; + /** + * Asset osInventory. + * @member {google.cloud.osconfig.v1.IInventory|null|undefined} osInventory + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.osInventory = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -9812,6 +9838,8 @@ writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.osInventory != null && Object.hasOwnProperty.call(message, "osInventory")) + $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -9875,6 +9903,9 @@ case 9: message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); break; + case 12: + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -9974,6 +10005,11 @@ return "servicePerimeter." + error; } } + if (message.osInventory != null && message.hasOwnProperty("osInventory")) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.osInventory); + if (error) + return "osInventory." + error; + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -10040,6 +10076,11 @@ throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); } + if (object.osInventory != null) { + if (typeof object.osInventory !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.osInventory: object expected"); + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.osInventory); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -10073,6 +10114,7 @@ object.resource = null; object.iamPolicy = null; object.updateTime = null; + object.osInventory = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -10109,6 +10151,8 @@ } if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.osInventory != null && message.hasOwnProperty("osInventory")) + object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); return object; }; @@ -30081,6 +30125,2885 @@ return orgpolicy; })(); + cloud.osconfig = (function() { + + /** + * Namespace osconfig. + * @memberof google.cloud + * @namespace + */ + var osconfig = {}; + + osconfig.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.osconfig + * @namespace + */ + var v1 = {}; + + v1.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1 + * @interface IInventory + * @property {google.cloud.osconfig.v1.Inventory.IOsInfo|null} [osInfo] Inventory osInfo + * @property {Object.|null} [items] Inventory items + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + this.items = {}; + 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]]; + } + + /** + * Inventory osInfo. + * @member {google.cloud.osconfig.v1.Inventory.IOsInfo|null|undefined} osInfo + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.osInfo = null; + + /** + * Inventory items. + * @member {Object.} items + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.items = $util.emptyObject; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osInfo != null && Object.hasOwnProperty.call(message, "osInfo")) + $root.google.cloud.osconfig.v1.Inventory.OsInfo.encode(message.osInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.osconfig.v1.Inventory.Item.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.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.osconfig.v1.Inventory(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); + break; + case 2: + if (message.items === $util.emptyObject) + message.items = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.osconfig.v1.Inventory.Item.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osInfo != null && message.hasOwnProperty("osInfo")) { + var error = $root.google.cloud.osconfig.v1.Inventory.OsInfo.verify(message.osInfo); + if (error) + return "osInfo." + error; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.Item.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory(); + if (object.osInfo != null) { + if (typeof object.osInfo !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.osInfo: object expected"); + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.fromObject(object.osInfo); + } + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items[keys[i]] = $root.google.cloud.osconfig.v1.Inventory.Item.fromObject(object.items[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + if (options.defaults) + object.osInfo = null; + if (message.osInfo != null && message.hasOwnProperty("osInfo")) + object.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.toObject(message.osInfo, options); + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.osconfig.v1.Inventory.Item.toObject(message.items[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Inventory.OsInfo = (function() { + + /** + * Properties of an OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IOsInfo + * @property {string|null} [hostname] OsInfo hostname + * @property {string|null} [longName] OsInfo longName + * @property {string|null} [shortName] OsInfo shortName + * @property {string|null} [version] OsInfo version + * @property {string|null} [architecture] OsInfo architecture + * @property {string|null} [kernelVersion] OsInfo kernelVersion + * @property {string|null} [kernelRelease] OsInfo kernelRelease + * @property {string|null} [osconfigAgentVersion] OsInfo osconfigAgentVersion + */ + + /** + * Constructs a new OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an OsInfo. + * @implements IOsInfo + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + */ + function OsInfo(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]]; + } + + /** + * OsInfo hostname. + * @member {string} hostname + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.hostname = ""; + + /** + * OsInfo longName. + * @member {string} longName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.longName = ""; + + /** + * OsInfo shortName. + * @member {string} shortName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.shortName = ""; + + /** + * OsInfo version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.version = ""; + + /** + * OsInfo architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.architecture = ""; + + /** + * OsInfo kernelVersion. + * @member {string} kernelVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelVersion = ""; + + /** + * OsInfo kernelRelease. + * @member {string} kernelRelease + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelRelease = ""; + + /** + * OsInfo osconfigAgentVersion. + * @member {string} osconfigAgentVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.osconfigAgentVersion = ""; + + /** + * Creates a new OsInfo instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo instance + */ + OsInfo.create = function create(properties) { + return new OsInfo(properties); + }; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.longName != null && Object.hasOwnProperty.call(message, "longName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.longName); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.architecture); + if (message.kernelVersion != null && Object.hasOwnProperty.call(message, "kernelVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kernelVersion); + if (message.kernelRelease != null && Object.hasOwnProperty.call(message, "kernelRelease")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kernelRelease); + if (message.osconfigAgentVersion != null && Object.hasOwnProperty.call(message, "osconfigAgentVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.osconfigAgentVersion); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.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.osconfig.v1.Inventory.OsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: + message.hostname = reader.string(); + break; + case 2: + message.longName = reader.string(); + break; + case 3: + message.shortName = reader.string(); + break; + case 4: + message.version = reader.string(); + break; + case 5: + message.architecture = reader.string(); + break; + case 6: + message.kernelVersion = reader.string(); + break; + case 7: + message.kernelRelease = reader.string(); + break; + case 8: + message.osconfigAgentVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsInfo message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.longName != null && message.hasOwnProperty("longName")) + if (!$util.isString(message.longName)) + return "longName: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + if (!$util.isString(message.kernelVersion)) + return "kernelVersion: string expected"; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + if (!$util.isString(message.kernelRelease)) + return "kernelRelease: string expected"; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + if (!$util.isString(message.osconfigAgentVersion)) + return "osconfigAgentVersion: string expected"; + return null; + }; + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + */ + OsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.OsInfo) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.OsInfo(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.longName != null) + message.longName = String(object.longName); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.version != null) + message.version = String(object.version); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.kernelVersion != null) + message.kernelVersion = String(object.kernelVersion); + if (object.kernelRelease != null) + message.kernelRelease = String(object.kernelRelease); + if (object.osconfigAgentVersion != null) + message.osconfigAgentVersion = String(object.osconfigAgentVersion); + return message; + }; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.OsInfo} message OsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.longName = ""; + object.shortName = ""; + object.version = ""; + object.architecture = ""; + object.kernelVersion = ""; + object.kernelRelease = ""; + object.osconfigAgentVersion = ""; + object.hostname = ""; + } + if (message.longName != null && message.hasOwnProperty("longName")) + object.longName = message.longName; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + object.kernelVersion = message.kernelVersion; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + object.kernelRelease = message.kernelRelease; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + object.osconfigAgentVersion = message.osconfigAgentVersion; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this OsInfo to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + * @returns {Object.} JSON object + */ + OsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OsInfo; + })(); + + Inventory.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IItem + * @property {string|null} [id] Item id + * @property {google.cloud.osconfig.v1.Inventory.Item.OriginType|null} [originType] Item originType + * @property {google.protobuf.ITimestamp|null} [createTime] Item createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Item updateTime + * @property {google.cloud.osconfig.v1.Inventory.Item.Type|null} [type] Item type + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [installedPackage] Item installedPackage + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [availablePackage] Item availablePackage + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + */ + function Item(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]]; + } + + /** + * Item id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.id = ""; + + /** + * Item originType. + * @member {google.cloud.osconfig.v1.Inventory.Item.OriginType} originType + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.originType = 0; + + /** + * Item createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.createTime = null; + + /** + * Item updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.updateTime = null; + + /** + * Item type. + * @member {google.cloud.osconfig.v1.Inventory.Item.Type} type + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.type = 0; + + /** + * Item installedPackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} installedPackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.installedPackage = null; + + /** + * Item availablePackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} availablePackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.availablePackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Item details. + * @member {"installedPackage"|"availablePackage"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Object.defineProperty(Item.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["installedPackage", "availablePackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.originType != null && Object.hasOwnProperty.call(message, "originType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.originType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.installedPackage != null && Object.hasOwnProperty.call(message, "installedPackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.installedPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.availablePackage != null && Object.hasOwnProperty.call(message, "availablePackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.availablePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.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.osconfig.v1.Inventory.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.originType = reader.int32(); + break; + case 8: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + case 7: + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.originType != null && message.hasOwnProperty("originType")) + switch (message.originType) { + default: + return "originType: enum value expected"; + case 0: + case 1: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.installedPackage); + if (error) + return "installedPackage." + error; + } + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.availablePackage); + if (error) + return "availablePackage." + error; + } + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.Item) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.Item(); + if (object.id != null) + message.id = String(object.id); + switch (object.originType) { + case "ORIGIN_TYPE_UNSPECIFIED": + case 0: + message.originType = 0; + break; + case "INVENTORY_REPORT": + case 1: + message.originType = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTALLED_PACKAGE": + case 1: + message.type = 1; + break; + case "AVAILABLE_PACKAGE": + case 2: + message.type = 2; + break; + } + if (object.installedPackage != null) { + if (typeof object.installedPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.installedPackage: object expected"); + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.installedPackage); + } + if (object.availablePackage != null) { + if (typeof object.availablePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.availablePackage: object expected"); + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.availablePackage); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.originType = options.enums === String ? "ORIGIN_TYPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.originType != null && message.hasOwnProperty("originType")) + object.originType = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] : message.originType; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] : message.type; + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + object.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.installedPackage, options); + if (options.oneofs) + object.details = "installedPackage"; + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + object.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.availablePackage, options); + if (options.oneofs) + object.details = "availablePackage"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OriginType enum. + * @name google.cloud.osconfig.v1.Inventory.Item.OriginType + * @enum {number} + * @property {number} ORIGIN_TYPE_UNSPECIFIED=0 ORIGIN_TYPE_UNSPECIFIED value + * @property {number} INVENTORY_REPORT=1 INVENTORY_REPORT value + */ + Item.OriginType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGIN_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVENTORY_REPORT"] = 1; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.osconfig.v1.Inventory.Item.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INSTALLED_PACKAGE=1 INSTALLED_PACKAGE value + * @property {number} AVAILABLE_PACKAGE=2 AVAILABLE_PACKAGE value + */ + Item.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED_PACKAGE"] = 1; + values[valuesById[2] = "AVAILABLE_PACKAGE"] = 2; + return values; + })(); + + return Item; + })(); + + Inventory.SoftwarePackage = (function() { + + /** + * Properties of a SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface ISoftwarePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [yumPackage] SoftwarePackage yumPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [aptPackage] SoftwarePackage aptPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [zypperPackage] SoftwarePackage zypperPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [googetPackage] SoftwarePackage googetPackage + * @property {google.cloud.osconfig.v1.Inventory.IZypperPatch|null} [zypperPatch] SoftwarePackage zypperPatch + * @property {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + */ + + /** + * Constructs a new SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a SoftwarePackage. + * @implements ISoftwarePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + */ + function SoftwarePackage(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]]; + } + + /** + * SoftwarePackage yumPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} yumPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.yumPackage = null; + + /** + * SoftwarePackage aptPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} aptPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.aptPackage = null; + + /** + * SoftwarePackage zypperPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} zypperPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPackage = null; + + /** + * SoftwarePackage googetPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} googetPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.googetPackage = null; + + /** + * SoftwarePackage zypperPatch. + * @member {google.cloud.osconfig.v1.Inventory.IZypperPatch|null|undefined} zypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPatch = null; + + /** + * SoftwarePackage wuaPackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null|undefined} wuaPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.wuaPackage = null; + + /** + * SoftwarePackage qfePackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null|undefined} qfePackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.qfePackage = null; + + /** + * SoftwarePackage cosPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} cosPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.cosPackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SoftwarePackage details. + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + Object.defineProperty(SoftwarePackage.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage instance + */ + SoftwarePackage.create = function create(properties) { + return new SoftwarePackage(properties); + }; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yumPackage != null && Object.hasOwnProperty.call(message, "yumPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.yumPackage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aptPackage != null && Object.hasOwnProperty.call(message, "aptPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.aptPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypperPackage != null && Object.hasOwnProperty.call(message, "zypperPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.zypperPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googetPackage != null && Object.hasOwnProperty.call(message, "googetPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.googetPackage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypperPatch != null && Object.hasOwnProperty.call(message, "zypperPatch")) + $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.encode(message.zypperPatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.wuaPackage != null && Object.hasOwnProperty.call(message, "wuaPackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.encode(message.wuaPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.qfePackage != null && Object.hasOwnProperty.call(message, "qfePackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.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.osconfig.v1.Inventory.SoftwarePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 2: + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 3: + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 4: + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + case 5: + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.decode(reader, reader.uint32()); + break; + case 6: + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); + break; + case 7: + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); + break; + case 8: + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwarePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwarePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.yumPackage); + if (error) + return "yumPackage." + error; + } + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.aptPackage); + if (error) + return "aptPackage." + error; + } + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.zypperPackage); + if (error) + return "zypperPackage." + error; + } + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.googetPackage); + if (error) + return "googetPackage." + error; + } + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.verify(message.zypperPatch); + if (error) + return "zypperPatch." + error; + } + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify(message.wuaPackage); + if (error) + return "wuaPackage." + error; + } + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify(message.qfePackage); + if (error) + return "qfePackage." + error; + } + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.cosPackage); + if (error) + return "cosPackage." + error; + } + } + return null; + }; + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + */ + SoftwarePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage(); + if (object.yumPackage != null) { + if (typeof object.yumPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.yumPackage: object expected"); + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.yumPackage); + } + if (object.aptPackage != null) { + if (typeof object.aptPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.aptPackage: object expected"); + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.aptPackage); + } + if (object.zypperPackage != null) { + if (typeof object.zypperPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPackage: object expected"); + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.zypperPackage); + } + if (object.googetPackage != null) { + if (typeof object.googetPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.googetPackage: object expected"); + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.googetPackage); + } + if (object.zypperPatch != null) { + if (typeof object.zypperPatch !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPatch: object expected"); + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.fromObject(object.zypperPatch); + } + if (object.wuaPackage != null) { + if (typeof object.wuaPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.wuaPackage: object expected"); + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.fromObject(object.wuaPackage); + } + if (object.qfePackage != null) { + if (typeof object.qfePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.qfePackage: object expected"); + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.fromObject(object.qfePackage); + } + if (object.cosPackage != null) { + if (typeof object.cosPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.cosPackage: object expected"); + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.cosPackage); + } + return message; + }; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.SoftwarePackage} message SoftwarePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwarePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + object.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.yumPackage, options); + if (options.oneofs) + object.details = "yumPackage"; + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + object.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.aptPackage, options); + if (options.oneofs) + object.details = "aptPackage"; + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + object.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.zypperPackage, options); + if (options.oneofs) + object.details = "zypperPackage"; + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + object.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.googetPackage, options); + if (options.oneofs) + object.details = "googetPackage"; + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + object.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.toObject(message.zypperPatch, options); + if (options.oneofs) + object.details = "zypperPatch"; + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + object.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.toObject(message.wuaPackage, options); + if (options.oneofs) + object.details = "wuaPackage"; + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + object.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.toObject(message.qfePackage, options); + if (options.oneofs) + object.details = "qfePackage"; + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + object.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.cosPackage, options); + if (options.oneofs) + object.details = "cosPackage"; + } + return object; + }; + + /** + * Converts this SoftwarePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + * @returns {Object.} JSON object + */ + SoftwarePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SoftwarePackage; + })(); + + Inventory.VersionedPackage = (function() { + + /** + * Properties of a VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IVersionedPackage + * @property {string|null} [packageName] VersionedPackage packageName + * @property {string|null} [architecture] VersionedPackage architecture + * @property {string|null} [version] VersionedPackage version + */ + + /** + * Constructs a new VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a VersionedPackage. + * @implements IVersionedPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + */ + function VersionedPackage(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]]; + } + + /** + * VersionedPackage packageName. + * @member {string} packageName + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.packageName = ""; + + /** + * VersionedPackage architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.architecture = ""; + + /** + * VersionedPackage version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.version = ""; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage instance + */ + VersionedPackage.create = function create(properties) { + return new VersionedPackage(properties); + }; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.architecture); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageName); + return writer; + }; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.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.osconfig.v1.Inventory.VersionedPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.packageName = reader.string(); + break; + case 2: + message.architecture = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + */ + VersionedPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.VersionedPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.VersionedPackage(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.VersionedPackage} message VersionedPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.architecture = ""; + object.version = ""; + object.packageName = ""; + } + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + return object; + }; + + /** + * Converts this VersionedPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + * @returns {Object.} JSON object + */ + VersionedPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionedPackage; + })(); + + Inventory.WindowsUpdatePackage = (function() { + + /** + * Properties of a WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsUpdatePackage + * @property {string|null} [title] WindowsUpdatePackage title + * @property {string|null} [description] WindowsUpdatePackage description + * @property {Array.|null} [categories] WindowsUpdatePackage categories + * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds + * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl + * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls + * @property {string|null} [updateId] WindowsUpdatePackage updateId + * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber + * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + */ + + /** + * Constructs a new WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsUpdatePackage. + * @implements IWindowsUpdatePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + */ + function WindowsUpdatePackage(properties) { + this.categories = []; + this.kbArticleIds = []; + this.moreInfoUrls = []; + 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]]; + } + + /** + * WindowsUpdatePackage title. + * @member {string} title + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.title = ""; + + /** + * WindowsUpdatePackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.description = ""; + + /** + * WindowsUpdatePackage categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.categories = $util.emptyArray; + + /** + * WindowsUpdatePackage kbArticleIds. + * @member {Array.} kbArticleIds + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; + + /** + * WindowsUpdatePackage supportUrl. + * @member {string} supportUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.supportUrl = ""; + + /** + * WindowsUpdatePackage moreInfoUrls. + * @member {Array.} moreInfoUrls + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + + /** + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.updateId = ""; + + /** + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.revisionNumber = 0; + + /** + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + */ + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); + }; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kbArticleIds != null && message.kbArticleIds.length) + for (var i = 0; i < message.kbArticleIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); + if (message.moreInfoUrls != null && message.moreInfoUrls.length) + for (var i = 0; i < message.moreInfoUrls.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); + if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); + if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) + $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); + return writer; + }; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.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.osconfig.v1.Inventory.WindowsUpdatePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + case 11: + message.supportUrl = reader.string(); + break; + case 5: + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + case 6: + message.updateId = reader.string(); + break; + case 7: + message.revisionNumber = reader.int32(); + break; + case 10: + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdatePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdatePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { + if (!Array.isArray(message.kbArticleIds)) + return "kbArticleIds: array expected"; + for (var i = 0; i < message.kbArticleIds.length; ++i) + if (!$util.isString(message.kbArticleIds[i])) + return "kbArticleIds: string[] expected"; + } + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + if (!$util.isString(message.supportUrl)) + return "supportUrl: string expected"; + if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { + if (!Array.isArray(message.moreInfoUrls)) + return "moreInfoUrls: array expected"; + for (var i = 0; i < message.moreInfoUrls.length; ++i) + if (!$util.isString(message.moreInfoUrls[i])) + return "moreInfoUrls: string[] expected"; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + if (!$util.isString(message.updateId)) + return "updateId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); + if (error) + return "lastDeploymentChangeTime." + error; + } + return null; + }; + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + */ + WindowsUpdatePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); + message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); + } + } + if (object.kbArticleIds) { + if (!Array.isArray(object.kbArticleIds)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); + message.kbArticleIds = []; + for (var i = 0; i < object.kbArticleIds.length; ++i) + message.kbArticleIds[i] = String(object.kbArticleIds[i]); + } + if (object.supportUrl != null) + message.supportUrl = String(object.supportUrl); + if (object.moreInfoUrls) { + if (!Array.isArray(object.moreInfoUrls)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); + message.moreInfoUrls = []; + for (var i = 0; i < object.moreInfoUrls.length; ++i) + message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); + } + if (object.updateId != null) + message.updateId = String(object.updateId); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; + if (object.lastDeploymentChangeTime != null) { + if (typeof object.lastDeploymentChangeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdatePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.kbArticleIds = []; + object.moreInfoUrls = []; + } + if (options.defaults) { + object.title = ""; + object.description = ""; + object.updateId = ""; + object.revisionNumber = 0; + object.lastDeploymentChangeTime = null; + object.supportUrl = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); + } + if (message.kbArticleIds && message.kbArticleIds.length) { + object.kbArticleIds = []; + for (var j = 0; j < message.kbArticleIds.length; ++j) + object.kbArticleIds[j] = message.kbArticleIds[j]; + } + if (message.moreInfoUrls && message.moreInfoUrls.length) { + object.moreInfoUrls = []; + for (var j = 0; j < message.moreInfoUrls.length; ++j) + object.moreInfoUrls[j] = message.moreInfoUrls[j]; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + object.updateId = message.updateId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) + object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + object.supportUrl = message.supportUrl; + return object; + }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdatePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WindowsUpdatePackage.WindowsUpdateCategory = (function() { + + /** + * Properties of a WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @interface IWindowsUpdateCategory + * @property {string|null} [id] WindowsUpdateCategory id + * @property {string|null} [name] WindowsUpdateCategory name + */ + + /** + * Constructs a new WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @classdesc Represents a WindowsUpdateCategory. + * @implements IWindowsUpdateCategory + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + */ + function WindowsUpdateCategory(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]]; + } + + /** + * WindowsUpdateCategory id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.id = ""; + + /** + * WindowsUpdateCategory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.name = ""; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance + */ + WindowsUpdateCategory.create = function create(properties) { + return new WindowsUpdateCategory(properties); + }; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateCategory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateCategory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + */ + WindowsUpdateCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsUpdateCategory; + })(); + + return WindowsUpdatePackage; + })(); + + Inventory.ZypperPatch = (function() { + + /** + * Properties of a ZypperPatch. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IZypperPatch + * @property {string|null} [patchName] ZypperPatch patchName + * @property {string|null} [category] ZypperPatch category + * @property {string|null} [severity] ZypperPatch severity + * @property {string|null} [summary] ZypperPatch summary + */ + + /** + * Constructs a new ZypperPatch. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a ZypperPatch. + * @implements IZypperPatch + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + */ + function ZypperPatch(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]]; + } + + /** + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.patchName = ""; + + /** + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.category = ""; + + /** + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.severity = ""; + + /** + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.summary = ""; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance + */ + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); + }; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); + return writer; + }; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.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.osconfig.v1.Inventory.ZypperPatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.patchName = reader.string(); + break; + case 2: + message.category = reader.string(); + break; + case 3: + message.severity = reader.string(); + break; + case 4: + message.summary = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperPatch message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperPatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchName != null && message.hasOwnProperty("patchName")) + if (!$util.isString(message.patchName)) + return "patchName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + return null; + }; + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + */ + ZypperPatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + if (object.patchName != null) + message.patchName = String(object.patchName); + if (object.category != null) + message.category = String(object.category); + if (object.severity != null) + message.severity = String(object.severity); + if (object.summary != null) + message.summary = String(object.summary); + return message; + }; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperPatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.patchName != null && message.hasOwnProperty("patchName")) + object.patchName = message.patchName; + return object; + }; + + /** + * Converts this ZypperPatch to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + * @returns {Object.} JSON object + */ + ZypperPatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZypperPatch; + })(); + + Inventory.WindowsQuickFixEngineeringPackage = (function() { + + /** + * Properties of a WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsQuickFixEngineeringPackage + * @property {string|null} [caption] WindowsQuickFixEngineeringPackage caption + * @property {string|null} [description] WindowsQuickFixEngineeringPackage description + * @property {string|null} [hotFixId] WindowsQuickFixEngineeringPackage hotFixId + * @property {google.protobuf.ITimestamp|null} [installTime] WindowsQuickFixEngineeringPackage installTime + */ + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsQuickFixEngineeringPackage. + * @implements IWindowsQuickFixEngineeringPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + */ + function WindowsQuickFixEngineeringPackage(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]]; + } + + /** + * WindowsQuickFixEngineeringPackage caption. + * @member {string} caption + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.caption = ""; + + /** + * WindowsQuickFixEngineeringPackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.description = ""; + + /** + * WindowsQuickFixEngineeringPackage hotFixId. + * @member {string} hotFixId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.hotFixId = ""; + + /** + * WindowsQuickFixEngineeringPackage installTime. + * @member {google.protobuf.ITimestamp|null|undefined} installTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.installTime = null; + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage instance + */ + WindowsQuickFixEngineeringPackage.create = function create(properties) { + return new WindowsQuickFixEngineeringPackage(properties); + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caption); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.hotFixId != null && Object.hasOwnProperty.call(message, "hotFixId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hotFixId); + if (message.installTime != null && Object.hasOwnProperty.call(message, "installTime")) + $root.google.protobuf.Timestamp.encode(message.installTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.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.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.caption = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.hotFixId = reader.string(); + break; + case 5: + message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsQuickFixEngineeringPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + if (!$util.isString(message.hotFixId)) + return "hotFixId: string expected"; + if (message.installTime != null && message.hasOwnProperty("installTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.installTime); + if (error) + return "installTime." + error; + } + return null; + }; + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + */ + WindowsQuickFixEngineeringPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + if (object.caption != null) + message.caption = String(object.caption); + if (object.description != null) + message.description = String(object.description); + if (object.hotFixId != null) + message.hotFixId = String(object.hotFixId); + if (object.installTime != null) { + if (typeof object.installTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.installTime: object expected"); + message.installTime = $root.google.protobuf.Timestamp.fromObject(object.installTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsQuickFixEngineeringPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caption = ""; + object.description = ""; + object.hotFixId = ""; + object.installTime = null; + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + object.hotFixId = message.hotFixId; + if (message.installTime != null && message.hasOwnProperty("installTime")) + object.installTime = $root.google.protobuf.Timestamp.toObject(message.installTime, options); + return object; + }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + * @returns {Object.} JSON object + */ + WindowsQuickFixEngineeringPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsQuickFixEngineeringPackage; + })(); + + return Inventory; + })(); + + return v1; + })(); + + return osconfig; + })(); + return cloud; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index cbdc8c237fc..3a4fbe31000 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -971,7 +971,8 @@ "RESOURCE": 1, "IAM_POLICY": 2, "ORG_POLICY": 4, - "ACCESS_POLICY": 5 + "ACCESS_POLICY": 5, + "OS_INVENTORY": 6 } }, "TemporalAsset": { @@ -1073,6 +1074,10 @@ "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", "id": 9 }, + "osInventory": { + "type": "google.cloud.osconfig.v1.Inventory", + "id": 12 + }, "ancestors": { "rule": "repeated", "type": "string", @@ -3009,6 +3014,292 @@ } } } + }, + "osconfig": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OsConfig.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig", + "java_multiple_files": true, + "java_outer_classname": "Inventories", + "java_package": "com.google.cloud.osconfig.v1", + "php_namespace": "Google\\Cloud\\OsConfig\\V1", + "ruby_package": "Google::Cloud::OsConfig::V1" + }, + "nested": { + "Inventory": { + "fields": { + "osInfo": { + "type": "OsInfo", + "id": 1 + }, + "items": { + "keyType": "string", + "type": "Item", + "id": 2 + } + }, + "nested": { + "OsInfo": { + "fields": { + "hostname": { + "type": "string", + "id": 9 + }, + "longName": { + "type": "string", + "id": 2 + }, + "shortName": { + "type": "string", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 5 + }, + "kernelVersion": { + "type": "string", + "id": 6 + }, + "kernelRelease": { + "type": "string", + "id": 7 + }, + "osconfigAgentVersion": { + "type": "string", + "id": 8 + } + } + }, + "Item": { + "oneofs": { + "details": { + "oneof": [ + "installedPackage", + "availablePackage" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "originType": { + "type": "OriginType", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "type": { + "type": "Type", + "id": 5 + }, + "installedPackage": { + "type": "SoftwarePackage", + "id": 6 + }, + "availablePackage": { + "type": "SoftwarePackage", + "id": 7 + } + }, + "nested": { + "OriginType": { + "values": { + "ORIGIN_TYPE_UNSPECIFIED": 0, + "INVENTORY_REPORT": 1 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INSTALLED_PACKAGE": 1, + "AVAILABLE_PACKAGE": 2 + } + } + } + }, + "SoftwarePackage": { + "oneofs": { + "details": { + "oneof": [ + "yumPackage", + "aptPackage", + "zypperPackage", + "googetPackage", + "zypperPatch", + "wuaPackage", + "qfePackage", + "cosPackage" + ] + } + }, + "fields": { + "yumPackage": { + "type": "VersionedPackage", + "id": 1 + }, + "aptPackage": { + "type": "VersionedPackage", + "id": 2 + }, + "zypperPackage": { + "type": "VersionedPackage", + "id": 3 + }, + "googetPackage": { + "type": "VersionedPackage", + "id": 4 + }, + "zypperPatch": { + "type": "ZypperPatch", + "id": 5 + }, + "wuaPackage": { + "type": "WindowsUpdatePackage", + "id": 6 + }, + "qfePackage": { + "type": "WindowsQuickFixEngineeringPackage", + "id": 7 + }, + "cosPackage": { + "type": "VersionedPackage", + "id": 8 + } + } + }, + "VersionedPackage": { + "fields": { + "packageName": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 3 + } + } + }, + "WindowsUpdatePackage": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "categories": { + "rule": "repeated", + "type": "WindowsUpdateCategory", + "id": 3 + }, + "kbArticleIds": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "supportUrl": { + "type": "string", + "id": 11 + }, + "moreInfoUrls": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "updateId": { + "type": "string", + "id": 6 + }, + "revisionNumber": { + "type": "int32", + "id": 7 + }, + "lastDeploymentChangeTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "WindowsUpdateCategory": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ZypperPatch": { + "fields": { + "patchName": { + "type": "string", + "id": 5 + }, + "category": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "string", + "id": 3 + }, + "summary": { + "type": "string", + "id": 4 + } + } + }, + "WindowsQuickFixEngineeringPackage": { + "fields": { + "caption": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "hotFixId": { + "type": "string", + "id": 3 + }, + "installTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + } + } + } + } + } + } } } }, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 04c7dca517a..e21378ae23c 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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/v1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class AssetServiceClient { * 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` @@ -100,7 +106,9 @@ export class AssetServiceClient { 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. @@ -376,7 +384,7 @@ export class AssetServiceClient { // ------------------- batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, @@ -386,7 +394,7 @@ export class AssetServiceClient { >; batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest @@ -451,7 +459,7 @@ export class AssetServiceClient { batchGetAssetsHistory( request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest @@ -474,12 +482,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -494,7 +502,7 @@ export class AssetServiceClient { } createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IFeed, @@ -504,7 +512,7 @@ export class AssetServiceClient { >; createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, @@ -553,7 +561,7 @@ export class AssetServiceClient { createFeed( request: protos.google.cloud.asset.v1.ICreateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, @@ -572,12 +580,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -592,7 +600,7 @@ export class AssetServiceClient { } getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IFeed, @@ -602,7 +610,7 @@ export class AssetServiceClient { >; getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, @@ -640,7 +648,7 @@ export class AssetServiceClient { getFeed( request: protos.google.cloud.asset.v1.IGetFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, @@ -659,12 +667,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -679,7 +687,7 @@ export class AssetServiceClient { } listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IListFeedsResponse, @@ -689,7 +697,7 @@ export class AssetServiceClient { >; listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, @@ -726,7 +734,7 @@ export class AssetServiceClient { listFeeds( request: protos.google.cloud.asset.v1.IListFeedsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IListFeedsResponse, protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, @@ -745,12 +753,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -765,7 +773,7 @@ export class AssetServiceClient { } updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IFeed, @@ -775,7 +783,7 @@ export class AssetServiceClient { >; updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, @@ -818,7 +826,7 @@ export class AssetServiceClient { updateFeed( request: protos.google.cloud.asset.v1.IUpdateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IFeed, protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, @@ -837,12 +845,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -857,7 +865,7 @@ export class AssetServiceClient { } deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -867,7 +875,7 @@ export class AssetServiceClient { >; deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, @@ -905,7 +913,7 @@ export class AssetServiceClient { deleteFeed( request: protos.google.cloud.asset.v1.IDeleteFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, @@ -924,12 +932,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -944,7 +952,7 @@ export class AssetServiceClient { } analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, @@ -954,7 +962,7 @@ export class AssetServiceClient { >; analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, @@ -1001,7 +1009,7 @@ export class AssetServiceClient { analyzeIamPolicy( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, | protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest @@ -1022,12 +1030,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -1043,7 +1051,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1056,7 +1064,7 @@ export class AssetServiceClient { >; exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1.IExportAssetsResponse, @@ -1142,7 +1150,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1.IExportAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1.IExportAssetsResponse, @@ -1170,12 +1178,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -1227,7 +1235,7 @@ export class AssetServiceClient { } analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1240,7 +1248,7 @@ export class AssetServiceClient { >; analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, @@ -1294,7 +1302,7 @@ export class AssetServiceClient { analyzeIamPolicyLongrunning( request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, @@ -1322,12 +1330,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -1383,7 +1391,7 @@ export class AssetServiceClient { } searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IResourceSearchResult[], @@ -1393,7 +1401,7 @@ export class AssetServiceClient { >; searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1.ISearchAllResourcesResponse @@ -1507,7 +1515,7 @@ export class AssetServiceClient { searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1.ISearchAllResourcesResponse @@ -1530,12 +1538,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -1638,7 +1646,7 @@ export class AssetServiceClient { */ searchAllResourcesStream( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1753,7 +1761,7 @@ export class AssetServiceClient { */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -1775,7 +1783,7 @@ export class AssetServiceClient { } searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1.IIamPolicySearchResult[], @@ -1785,7 +1793,7 @@ export class AssetServiceClient { >; searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse @@ -1878,7 +1886,7 @@ export class AssetServiceClient { searchAllIamPolicies( request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse @@ -1901,12 +1909,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -1988,7 +1996,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesStream( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2082,7 +2090,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index bc32ce5a590..6138a67083b 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1beta1/asset_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, @@ -27,6 +28,11 @@ import { import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -80,9 +86,9 @@ export class AssetServiceClient { * 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` @@ -95,7 +101,9 @@ export class AssetServiceClient { 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. @@ -310,7 +318,7 @@ export class AssetServiceClient { // ------------------- batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, @@ -323,7 +331,7 @@ export class AssetServiceClient { >; batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest @@ -388,7 +396,7 @@ export class AssetServiceClient { batchGetAssetsHistory( request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest @@ -414,12 +422,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -435,7 +443,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -448,7 +456,7 @@ export class AssetServiceClient { >; exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1beta1.IExportAssetsResponse, @@ -517,7 +525,7 @@ export class AssetServiceClient { exportAssets( request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1beta1.IExportAssetsResponse, @@ -545,12 +553,12 @@ export class AssetServiceClient { ] > | 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 || {}; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 1f40241c597..f352accc24a 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_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, @@ -30,6 +31,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/v1p1beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -82,9 +88,9 @@ export class AssetServiceClient { * 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` @@ -97,7 +103,9 @@ export class AssetServiceClient { 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. @@ -301,7 +309,7 @@ export class AssetServiceClient { searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], @@ -311,7 +319,7 @@ export class AssetServiceClient { >; searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse @@ -383,7 +391,7 @@ export class AssetServiceClient { searchAllResources( request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse @@ -406,12 +414,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -470,7 +478,7 @@ export class AssetServiceClient { */ searchAllResourcesStream( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -541,7 +549,7 @@ export class AssetServiceClient { */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -563,7 +571,7 @@ export class AssetServiceClient { } searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], @@ -573,7 +581,7 @@ export class AssetServiceClient { >; searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse @@ -640,7 +648,7 @@ export class AssetServiceClient { searchAllIamPolicies( request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse @@ -663,12 +671,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -722,7 +730,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesStream( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -788,7 +796,7 @@ export class AssetServiceClient { */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index f06289a9209..6cb8aca1662 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -16,11 +16,17 @@ // ** 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} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p2beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -74,9 +80,9 @@ export class AssetServiceClient { * 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` @@ -89,7 +95,9 @@ export class AssetServiceClient { 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. @@ -294,7 +302,7 @@ export class AssetServiceClient { // ------------------- createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IFeed, @@ -304,7 +312,7 @@ export class AssetServiceClient { >; createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, @@ -353,7 +361,7 @@ export class AssetServiceClient { createFeed( request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IFeed, | protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest @@ -374,12 +382,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -394,7 +402,7 @@ export class AssetServiceClient { } getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IFeed, @@ -404,7 +412,7 @@ export class AssetServiceClient { >; getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | null | undefined, @@ -442,7 +450,7 @@ export class AssetServiceClient { getFeed( request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IFeed, | protos.google.cloud.asset.v1p2beta1.IGetFeedRequest @@ -463,12 +471,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -483,7 +491,7 @@ export class AssetServiceClient { } listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, @@ -493,7 +501,7 @@ export class AssetServiceClient { >; listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | null | undefined, @@ -530,7 +538,7 @@ export class AssetServiceClient { listFeeds( request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, | protos.google.cloud.asset.v1p2beta1.IListFeedsRequest @@ -551,12 +559,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -571,7 +579,7 @@ export class AssetServiceClient { } updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p2beta1.IFeed, @@ -581,7 +589,7 @@ export class AssetServiceClient { >; updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p2beta1.IFeed, protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | null | undefined, @@ -624,7 +632,7 @@ export class AssetServiceClient { updateFeed( request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p2beta1.IFeed, | protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest @@ -645,12 +653,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -665,7 +673,7 @@ export class AssetServiceClient { } deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -675,7 +683,7 @@ export class AssetServiceClient { >; deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | null | undefined, @@ -713,7 +721,7 @@ export class AssetServiceClient { deleteFeed( request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest @@ -734,12 +742,12 @@ export class AssetServiceClient { ] > | 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 || {}; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 6380744f67b..a54fea9a2fd 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_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, @@ -27,6 +28,11 @@ import { import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1p4beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -80,9 +86,9 @@ export class AssetServiceClient { * 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` @@ -95,7 +101,9 @@ export class AssetServiceClient { 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. @@ -317,7 +325,7 @@ export class AssetServiceClient { // ------------------- analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, @@ -327,7 +335,7 @@ export class AssetServiceClient { >; analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest @@ -369,7 +377,7 @@ export class AssetServiceClient { analyzeIamPolicy( request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, | protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest @@ -392,12 +400,12 @@ export class AssetServiceClient { ] > | 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 || {}; @@ -413,7 +421,7 @@ export class AssetServiceClient { exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -426,7 +434,7 @@ export class AssetServiceClient { >; exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, @@ -477,7 +485,7 @@ export class AssetServiceClient { exportIamPolicyAnalysis( request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, @@ -505,12 +513,12 @@ export class AssetServiceClient { ] > | 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 || {}; diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 3072e67d686..d42164a70e5 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_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, @@ -30,6 +31,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/v1p5beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './asset_service_client_config.json'; const version = require('../../../package.json').version; @@ -82,9 +88,9 @@ export class AssetServiceClient { * 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` @@ -97,7 +103,9 @@ export class AssetServiceClient { 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. @@ -293,7 +301,7 @@ export class AssetServiceClient { listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.asset.v1p5beta1.IAsset[], @@ -303,7 +311,7 @@ export class AssetServiceClient { >; listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse @@ -371,7 +379,7 @@ export class AssetServiceClient { listAssets( request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse @@ -394,12 +402,12 @@ export class AssetServiceClient { ] > | 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 AssetServiceClient { */ listAssetsStream( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -529,7 +537,7 @@ export class AssetServiceClient { */ listAssetsAsync( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a9684364814..d27ce42d660 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "3d6d4cea05c0f87f9780a63ec59d4f17cf5667d1" + "sha": "c2f5a16b062667889e3dfe66f5bf1335e1704420" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b759c563bacf9cd15749be4d2bdd276d3f48ee29", - "internalRef": "341102751" + "sha": "a578b42319ca0e3c7b6fec600a4ee9ec57443598", + "internalRef": "344904496" } }, { From b5bdf822fe8c36d62ec5674766b4ab8897cb50bb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 2 Dec 2020 04:25:02 -0800 Subject: [PATCH 290/429] chore: fix typo 'partion_key' in comments (#438) PiperOrigin-RevId: 345062127 Source-Author: Google APIs Source-Date: Tue Dec 1 11:26:19 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 50831e68c56081dc5908f99158450de5c1c13d1c Source-Link: https://github.com/googleapis/googleapis/commit/50831e68c56081dc5908f99158450de5c1c13d1c --- .../protos/google/cloud/asset/v1/asset_service.proto | 2 +- packages/google-cloud-asset/synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index ee8c4129d16..d7d22fee960 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -425,7 +425,7 @@ message BigQueryDestination { // [partition_spec] determines whether to export to partitioned table(s) and // how to partition the data. // - // If [partition_spec] is unset or [partition_spec.partion_key] is unset or + // If [partition_spec] is unset or [partition_spec.partition_key] is unset or // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to // non-partitioned table(s). [force] will decide whether to overwrite existing // table(s). diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index d27ce42d660..a2637702ea6 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "c2f5a16b062667889e3dfe66f5bf1335e1704420" + "sha": "68298fd9ebee3ae119bdb7dc6b848276804e2cda" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a578b42319ca0e3c7b6fec600a4ee9ec57443598", - "internalRef": "344904496" + "sha": "50831e68c56081dc5908f99158450de5c1c13d1c", + "internalRef": "345062127" } }, { From 8cc0b84390c3776642c6d30eb4014e5e6e7efd1b 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:40:31 +0000 Subject: [PATCH 291/429] chore: release 3.10.0 (#437) :robot: I have created a release \*beep\* \*boop\* --- ## [3.10.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.9.1...v3.10.0) (2020-12-02) ### Features * added support OSInventory in Assets ([#436](https://www.github.com/googleapis/nodejs-asset/issues/436)) ([68298fd](https://www.github.com/googleapis/nodejs-asset/commit/68298fd9ebee3ae119bdb7dc6b848276804e2cda)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 1fb46542f3c..e48cfb4bc04 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.10.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.9.1...v3.10.0) (2020-12-02) + + +### Features + +* added support OSInventory in Assets ([#436](https://www.github.com/googleapis/nodejs-asset/issues/436)) ([68298fd](https://www.github.com/googleapis/nodejs-asset/commit/68298fd9ebee3ae119bdb7dc6b848276804e2cda)) + ### [3.9.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.9.0...v3.9.1) (2020-11-12) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 0e215e77ae8..ba26d6cb65b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.9.1", + "version": "3.10.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 9de361fdb4e..310004b2b01 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.9.1", + "@google-cloud/asset": "^3.10.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 38d20c31953eb3e3789c7b8314be1f8772f380f3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:02 -0800 Subject: [PATCH 292/429] chore: generate GAPIC metadata JSON file (#439) 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/v1/gapic_metadata.json | 141 ++++++++++++++++++ .../src/v1beta1/gapic_metadata.json | 43 ++++++ .../src/v1p1beta1/gapic_metadata.json | 42 ++++++ .../src/v1p2beta1/gapic_metadata.json | 73 +++++++++ .../src/v1p4beta1/gapic_metadata.json | 43 ++++++ .../src/v1p5beta1/gapic_metadata.json | 30 ++++ packages/google-cloud-asset/synth.metadata | 6 +- 7 files changed, 375 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-asset/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-asset/src/v1beta1/gapic_metadata.json create mode 100644 packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json create mode 100644 packages/google-cloud-asset/src/v1p2beta1/gapic_metadata.json create mode 100644 packages/google-cloud-asset/src/v1p4beta1/gapic_metadata.json create mode 100644 packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json diff --git a/packages/google-cloud-asset/src/v1/gapic_metadata.json b/packages/google-cloud-asset/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..46df80bec8f --- /dev/null +++ b/packages/google-cloud-asset/src/v1/gapic_metadata.json @@ -0,0 +1,141 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + }, + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + }, + "AnalyzeIamPolicyLongrunning": { + "methods": [ + "analyzeIamPolicyLongrunning" + ] + }, + "SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + }, + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + }, + "AnalyzeIamPolicyLongrunning": { + "methods": [ + "analyzeIamPolicyLongrunning" + ] + }, + "SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..db5151e8c8d --- /dev/null +++ b/packages/google-cloud-asset/src/v1beta1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1beta1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..20e643ff3fb --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p1beta1", + "libraryPackage": "@google-cloud/asset", + "services": {"AssetService": {"clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": {"SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + },"SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + }} + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": {,"SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + },"SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + }} + } + } + }} +} diff --git a/packages/google-cloud-asset/src/v1p2beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1p2beta1/gapic_metadata.json new file mode 100644 index 00000000000..5e7034b0ae1 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p2beta1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p4beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1p4beta1/gapic_metadata.json new file mode 100644 index 00000000000..0c3780215f9 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p4beta1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "ExportIamPolicyAnalysis": { + "methods": [ + "exportIamPolicyAnalysis" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "ExportIamPolicyAnalysis": { + "methods": [ + "exportIamPolicyAnalysis" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json new file mode 100644 index 00000000000..d08e20479d5 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json @@ -0,0 +1,30 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p5beta1", + "libraryPackage": "asset", + "services": {"AssetService": {"clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": {"ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }} + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": {,"ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }} + } + } + }} +} diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a2637702ea6..d6f5566c8d9 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "68298fd9ebee3ae119bdb7dc6b848276804e2cda" + "sha": "86029ac8f7660ee6df3fb307d2b1bf41f3369762" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "50831e68c56081dc5908f99158450de5c1c13d1c", - "internalRef": "345062127" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From 0422b2c3a6aab1d2f92ef0bb8d788e213b0e2263 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 7 Dec 2020 09:11:17 -0800 Subject: [PATCH 293/429] chore: fixing syntax error in the GAPIC metadata JSON file (#440) Use gapic-generator-typescript v1.2.8. Committer: @alexander-fenster PiperOrigin-RevId: 345712055 Source-Author: Google APIs Source-Date: Fri Dec 4 10:54:47 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 16dd59787d6ce130ab66066c02eeea9dac0c8f0e Source-Link: https://github.com/googleapis/googleapis/commit/16dd59787d6ce130ab66066c02eeea9dac0c8f0e --- .../src/v1p1beta1/gapic_metadata.json | 49 +++++++++++-------- .../src/v1p5beta1/gapic_metadata.json | 31 +++++++----- packages/google-cloud-asset/synth.metadata | 6 +-- 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json index 20e643ff3fb..4376c4982d1 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1p1beta1/gapic_metadata.json @@ -4,39 +4,48 @@ "language": "typescript", "protoPackage": "google.cloud.asset.v1p1beta1", "libraryPackage": "@google-cloud/asset", - "services": {"AssetService": {"clients": { + "services": { + "AssetService": { + "clients": { "grpc": { "libraryClient": "AssetServiceClient", - "rpcs": {"SearchAllResources": { + "rpcs": { + "SearchAllResources": { "methods": [ - "searchAllResources", - "searchAllResourcesStream", - "searchAllResourcesAsync" + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" ] - },"SearchAllIamPolicies": { + }, + "SearchAllIamPolicies": { "methods": [ - "searchAllIamPolicies", - "searchAllIamPoliciesStream", - "searchAllIamPoliciesAsync" + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" ] - }} + } + } }, "grpc-fallback": { "libraryClient": "AssetServiceClient", - "rpcs": {,"SearchAllResources": { + "rpcs": { + "SearchAllResources": { "methods": [ - "searchAllResources", - "searchAllResourcesStream", - "searchAllResourcesAsync" + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" ] - },"SearchAllIamPolicies": { + }, + "SearchAllIamPolicies": { "methods": [ - "searchAllIamPolicies", - "searchAllIamPoliciesStream", - "searchAllIamPoliciesAsync" + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" ] - }} + } + } } } - }} + } + } } diff --git a/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json index d08e20479d5..cd06433c8d0 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1p5beta1/gapic_metadata.json @@ -4,27 +4,34 @@ "language": "typescript", "protoPackage": "google.cloud.asset.v1p5beta1", "libraryPackage": "asset", - "services": {"AssetService": {"clients": { + "services": { + "AssetService": { + "clients": { "grpc": { "libraryClient": "AssetServiceClient", - "rpcs": {"ListAssets": { + "rpcs": { + "ListAssets": { "methods": [ - "listAssets", - "listAssetsStream", - "listAssetsAsync" + "listAssets", + "listAssetsStream", + "listAssetsAsync" ] - }} + } + } }, "grpc-fallback": { "libraryClient": "AssetServiceClient", - "rpcs": {,"ListAssets": { + "rpcs": { + "ListAssets": { "methods": [ - "listAssets", - "listAssetsStream", - "listAssetsAsync" + "listAssets", + "listAssetsStream", + "listAssetsAsync" ] - }} + } + } } } - }} + } + } } diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index d6f5566c8d9..06eef3f347d 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "86029ac8f7660ee6df3fb307d2b1bf41f3369762" + "sha": "1bc50dda51aff1e5846a83b8464b0ec084b9dfe3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "16dd59787d6ce130ab66066c02eeea9dac0c8f0e", + "internalRef": "345712055" } }, { From 2221522c6640d46471d9998e77016ca079382049 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:56:26 -0800 Subject: [PATCH 294/429] refactor: remove retired API surface v1beta1 (#442) --- .../google-cloud-asset/protos/protos.d.ts | 1103 ------- packages/google-cloud-asset/protos/protos.js | 2645 ----------------- .../google-cloud-asset/protos/protos.json | 281 -- packages/google-cloud-asset/src/index.ts | 12 +- .../src/v1beta1/asset_service_client.ts | 628 ---- .../v1beta1/asset_service_client_config.json | 36 - .../src/v1beta1/asset_service_proto_list.json | 4 - .../src/v1beta1/gapic_metadata.json | 43 - .../google-cloud-asset/src/v1beta1/index.ts | 19 - packages/google-cloud-asset/synth.metadata | 19 +- packages/google-cloud-asset/synth.py | 2 +- .../test/gapic_asset_service_v1beta1.ts | 475 --- 12 files changed, 7 insertions(+), 5260 deletions(-) delete mode 100644 packages/google-cloud-asset/src/v1beta1/asset_service_client.ts delete mode 100644 packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json delete mode 100644 packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json delete mode 100644 packages/google-cloud-asset/src/v1beta1/gapic_metadata.json delete mode 100644 packages/google-cloud-asset/src/v1beta1/index.ts delete mode 100644 packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index dc57ee03015..38c7d0474a6 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -5630,1109 +5630,6 @@ export namespace google { } } - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { - - /** - * Constructs a new AssetService 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 AssetService 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): AssetService; - - /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; - - /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise - */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; - - /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; - - /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise - */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; - } - - namespace AssetService { - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse - */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; - } - - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { - - /** ExportAssetsRequest parent */ - parent?: (string|null); - - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); - - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); - - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); - } - - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { - - /** - * Constructs a new ExportAssetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - - /** ExportAssetsRequest parent. */ - public parent: string; - - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; - - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); - - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); - - /** - * Creates a new ExportAssetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAssetsRequest instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; - - /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest - * @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.asset.v1beta1.ExportAssetsRequest; - - /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest - * @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.asset.v1beta1.ExportAssetsRequest; - - /** - * Verifies an ExportAssetsRequest 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAssetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; - - /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportAssetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { - - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); - } - - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { - - /** - * Constructs a new ExportAssetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); - - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); - - /** - * Creates a new ExportAssetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAssetsResponse instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; - - /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse - * @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.asset.v1beta1.ExportAssetsResponse; - - /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse - * @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.asset.v1beta1.ExportAssetsResponse; - - /** - * Verifies an ExportAssetsResponse 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAssetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; - - /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportAssetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { - - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); - - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); - - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); - - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); - } - - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { - - /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); - - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; - - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; - - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); - - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; - - /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest - * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; - - /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest - * @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.asset.v1beta1.BatchGetAssetsHistoryRequest; - - /** - * Verifies a BatchGetAssetsHistoryRequest 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetAssetsHistoryRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; - - /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetAssetsHistoryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { - - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); - } - - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { - - /** - * Constructs a new BatchGetAssetsHistoryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); - - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; - - /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; - - /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse - * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; - - /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse - * @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.asset.v1beta1.BatchGetAssetsHistoryResponse; - - /** - * Verifies a BatchGetAssetsHistoryResponse 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 BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetAssetsHistoryResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; - - /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetAssetsHistoryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an OutputConfig. */ - interface IOutputConfig { - - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); - } - - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { - - /** - * Constructs a new OutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); - - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); - - /** OutputConfig destination. */ - public destination?: "gcsDestination"; - - /** - * Creates a new OutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OutputConfig instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; - - /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OutputConfig - * @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.asset.v1beta1.OutputConfig; - - /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OutputConfig - * @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.asset.v1beta1.OutputConfig; - - /** - * Verifies an OutputConfig 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 OutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; - - /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); - - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); - } - - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { - - /** - * Constructs a new GcsDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** GcsDestination uriPrefix. */ - public uriPrefix: string; - - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); - - /** - * Creates a new GcsDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDestination instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDestination - * @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.asset.v1beta1.GcsDestination; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDestination - * @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.asset.v1beta1.GcsDestination; - - /** - * Verifies a GcsDestination 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 GcsDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); - - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1beta1.IAsset|null); - } - - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { - - /** - * Constructs a new TemporalAsset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1beta1.IAsset|null); - - /** - * Creates a new TemporalAsset instance using the specified properties. - * @param [properties] Properties to set - * @returns TemporalAsset instance - */ - public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; - - /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TemporalAsset - * @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.asset.v1beta1.TemporalAsset; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TemporalAsset - * @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.asset.v1beta1.TemporalAsset; - - /** - * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TemporalAsset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; - - /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TemporalAsset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** 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.asset.v1beta1.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.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; - - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1beta1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { - - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IAsset); - - /** Asset name. */ - public name: string; - - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1beta1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @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.asset.v1beta1.Asset; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @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.asset.v1beta1.Asset; - - /** - * Verifies an Asset 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 Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Asset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); - - /** Resource discoveryName */ - discoveryName?: (string|null); - - /** Resource resourceUrl */ - resourceUrl?: (string|null); - - /** Resource parent */ - parent?: (string|null); - - /** Resource data */ - data?: (google.protobuf.IStruct|null); - } - - /** Represents a Resource. */ - class Resource implements IResource { - - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1beta1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; - - /** Resource discoveryName. */ - public discoveryName: string; - - /** Resource resourceUrl. */ - public resourceUrl: string; - - /** Resource parent. */ - public parent: string; - - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); - - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Resource - * @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.asset.v1beta1.Resource; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Resource - * @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.asset.v1beta1.Resource; - - /** - * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Resource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - /** Namespace v1p1beta1. */ namespace v1p1beta1 { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 1bfa136dfc5..50cc8725569 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -13670,2651 +13670,6 @@ return v1; })(); - asset.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1beta1 = {}; - - v1beta1.AssetService = (function() { - - /** - * Constructs a new AssetService service. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an AssetService - * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; - - /** - * Creates new AssetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.asset.v1beta1.AssetService - * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. - */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. - * @memberof google.cloud.asset.v1beta1.AssetService - * @typedef ExportAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @param {google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { - return this.rpcCall(exportAssets, $root.google.cloud.asset.v1beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportAssets" }); - - /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. - * @memberof google.cloud.asset.v1beta1.AssetService - * @typedef BatchGetAssetsHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse - */ - - /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @param {google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { - return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, request, callback); - }, "name", { value: "BatchGetAssetsHistory" }); - - /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AssetService; - })(); - - v1beta1.ExportAssetsRequest = (function() { - - /** - * Properties of an ExportAssetsRequest. - * @memberof google.cloud.asset.v1beta1 - * @interface IExportAssetsRequest - * @property {string|null} [parent] ExportAssetsRequest parent - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime - * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes - * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] ExportAssetsRequest contentType - * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig - */ - - /** - * Constructs a new ExportAssetsRequest. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an ExportAssetsRequest. - * @implements IExportAssetsRequest - * @constructor - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set - */ - function ExportAssetsRequest(properties) { - this.assetTypes = []; - 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]]; - } - - /** - * ExportAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.parent = ""; - - /** - * ExportAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.readTime = null; - - /** - * ExportAssetsRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; - - /** - * ExportAssetsRequest contentType. - * @member {google.cloud.asset.v1beta1.ContentType} contentType - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.contentType = 0; - - /** - * ExportAssetsRequest outputConfig. - * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - */ - ExportAssetsRequest.prototype.outputConfig = null; - - /** - * Creates a new ExportAssetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest instance - */ - ExportAssetsRequest.create = function create(properties) { - return new ExportAssetsRequest(properties); - }; - - /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAssetsRequest.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAssetsRequest.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.asset.v1beta1.ExportAssetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportAssetsRequest message. - * @function verify - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } - return null; - }; - - /** - * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.ExportAssetsRequest} ExportAssetsRequest - */ - ExportAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsRequest) - return object; - var message = new $root.google.cloud.asset.v1beta1.ExportAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); - } - return message; - }; - - /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @static - * @param {google.cloud.asset.v1beta1.ExportAssetsRequest} message ExportAssetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportAssetsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; - if (options.defaults) { - object.parent = ""; - object.readTime = null; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.outputConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); - return object; - }; - - /** - * Converts this ExportAssetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.ExportAssetsRequest - * @instance - * @returns {Object.} JSON object - */ - ExportAssetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExportAssetsRequest; - })(); - - v1beta1.ExportAssetsResponse = (function() { - - /** - * Properties of an ExportAssetsResponse. - * @memberof google.cloud.asset.v1beta1 - * @interface IExportAssetsResponse - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime - * @property {google.cloud.asset.v1beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig - */ - - /** - * Constructs a new ExportAssetsResponse. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an ExportAssetsResponse. - * @implements IExportAssetsResponse - * @constructor - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set - */ - function ExportAssetsResponse(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]]; - } - - /** - * ExportAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @instance - */ - ExportAssetsResponse.prototype.readTime = null; - - /** - * ExportAssetsResponse outputConfig. - * @member {google.cloud.asset.v1beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @instance - */ - ExportAssetsResponse.prototype.outputConfig = null; - - /** - * Creates a new ExportAssetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse instance - */ - ExportAssetsResponse.create = function create(properties) { - return new ExportAssetsResponse(properties); - }; - - /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAssetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.asset.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {google.cloud.asset.v1beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAssetsResponse.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.asset.v1beta1.ExportAssetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportAssetsResponse message. - * @function verify - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAssetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } - return null; - }; - - /** - * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.ExportAssetsResponse} ExportAssetsResponse - */ - ExportAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.ExportAssetsResponse) - return object; - var message = new $root.google.cloud.asset.v1beta1.ExportAssetsResponse(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1beta1.ExportAssetsResponse.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.fromObject(object.outputConfig); - } - return message; - }; - - /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @static - * @param {google.cloud.asset.v1beta1.ExportAssetsResponse} message ExportAssetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportAssetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.readTime = null; - object.outputConfig = null; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1beta1.OutputConfig.toObject(message.outputConfig, options); - return object; - }; - - /** - * Converts this ExportAssetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.ExportAssetsResponse - * @instance - * @returns {Object.} JSON object - */ - ExportAssetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExportAssetsResponse; - })(); - - v1beta1.BatchGetAssetsHistoryRequest = (function() { - - /** - * Properties of a BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1beta1 - * @interface IBatchGetAssetsHistoryRequest - * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent - * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames - * @property {google.cloud.asset.v1beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType - * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow - */ - - /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a BatchGetAssetsHistoryRequest. - * @implements IBatchGetAssetsHistoryRequest - * @constructor - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - */ - function BatchGetAssetsHistoryRequest(properties) { - this.assetNames = []; - 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]]; - } - - /** - * BatchGetAssetsHistoryRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.parent = ""; - - /** - * BatchGetAssetsHistoryRequest assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; - - /** - * BatchGetAssetsHistoryRequest contentType. - * @member {google.cloud.asset.v1beta1.ContentType} contentType - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.contentType = 0; - - /** - * BatchGetAssetsHistoryRequest readTimeWindow. - * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} readTimeWindow - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - */ - BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; - - /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance - */ - BatchGetAssetsHistoryRequest.create = function create(properties) { - return new BatchGetAssetsHistoryRequest(properties); - }; - - /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchGetAssetsHistoryRequest.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.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) - $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchGetAssetsHistoryRequest.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.asset.v1beta1.BatchGetAssetsHistoryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - message.contentType = reader.int32(); - break; - case 4: - message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchGetAssetsHistoryRequest message. - * @function verify - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchGetAssetsHistoryRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { - var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.readTimeWindow); - if (error) - return "readTimeWindow." + error; - } - return null; - }; - - /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest - */ - BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) - return object; - var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - } - if (object.readTimeWindow != null) { - if (typeof object.readTimeWindow !== "object") - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); - message.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.readTimeWindow); - } - return message; - }; - - /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @static - * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.assetNames = []; - if (options.defaults) { - object.parent = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.readTimeWindow = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1beta1.ContentType[message.contentType] : message.contentType; - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - object.readTimeWindow = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.readTimeWindow, options); - return object; - }; - - /** - * Converts this BatchGetAssetsHistoryRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest - * @instance - * @returns {Object.} JSON object - */ - BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BatchGetAssetsHistoryRequest; - })(); - - v1beta1.BatchGetAssetsHistoryResponse = (function() { - - /** - * Properties of a BatchGetAssetsHistoryResponse. - * @memberof google.cloud.asset.v1beta1 - * @interface IBatchGetAssetsHistoryResponse - * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets - */ - - /** - * Constructs a new BatchGetAssetsHistoryResponse. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a BatchGetAssetsHistoryResponse. - * @implements IBatchGetAssetsHistoryResponse - * @constructor - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set - */ - function BatchGetAssetsHistoryResponse(properties) { - this.assets = []; - 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]]; - } - - /** - * BatchGetAssetsHistoryResponse assets. - * @member {Array.} assets - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @instance - */ - BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; - - /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance - */ - BatchGetAssetsHistoryResponse.create = function create(properties) { - return new BatchGetAssetsHistoryResponse(properties); - }; - - /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.assets != null && message.assets.length) - for (var i = 0; i < message.assets.length; ++i) - $root.google.cloud.asset.v1beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchGetAssetsHistoryResponse.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.asset.v1beta1.BatchGetAssetsHistoryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1beta1.TemporalAsset.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchGetAssetsHistoryResponse message. - * @function verify - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchGetAssetsHistoryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.assets != null && message.hasOwnProperty("assets")) { - if (!Array.isArray(message.assets)) - return "assets: array expected"; - for (var i = 0; i < message.assets.length; ++i) { - var error = $root.google.cloud.asset.v1beta1.TemporalAsset.verify(message.assets[i]); - if (error) - return "assets." + error; - } - } - return null; - }; - - /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse - */ - BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) - return object; - var message = new $root.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse(); - if (object.assets) { - if (!Array.isArray(object.assets)) - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: array expected"); - message.assets = []; - for (var i = 0; i < object.assets.length; ++i) { - if (typeof object.assets[i] !== "object") - throw TypeError(".google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.assets: object expected"); - message.assets[i] = $root.google.cloud.asset.v1beta1.TemporalAsset.fromObject(object.assets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @static - * @param {google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.assets = []; - if (message.assets && message.assets.length) { - object.assets = []; - for (var j = 0; j < message.assets.length; ++j) - object.assets[j] = $root.google.cloud.asset.v1beta1.TemporalAsset.toObject(message.assets[j], options); - } - return object; - }; - - /** - * Converts this BatchGetAssetsHistoryResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse - * @instance - * @returns {Object.} JSON object - */ - BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BatchGetAssetsHistoryResponse; - })(); - - v1beta1.OutputConfig = (function() { - - /** - * Properties of an OutputConfig. - * @memberof google.cloud.asset.v1beta1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination - */ - - /** - * Constructs a new OutputConfig. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig - * @constructor - * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set - */ - function OutputConfig(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]]; - } - - /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1beta1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @instance - */ - OutputConfig.prototype.gcsDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OutputConfig destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @instance - */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OutputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {google.cloud.asset.v1beta1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig instance - */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); - }; - - /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.asset.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {google.cloud.asset.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OutputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutputConfig.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.asset.v1beta1.OutputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OutputConfig message. - * @function verify - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OutputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1beta1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - return null; - }; - - /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.OutputConfig} OutputConfig - */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.OutputConfig) - return object; - var message = new $root.google.cloud.asset.v1beta1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1beta1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.fromObject(object.gcsDestination); - } - return message; - }; - - /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @static - * @param {google.cloud.asset.v1beta1.OutputConfig} message OutputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OutputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1beta1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - return object; - }; - - /** - * Converts this OutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.OutputConfig - * @instance - * @returns {Object.} JSON object - */ - OutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OutputConfig; - })(); - - v1beta1.GcsDestination = (function() { - - /** - * Properties of a GcsDestination. - * @memberof google.cloud.asset.v1beta1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - * @property {string|null} [uriPrefix] GcsDestination uriPrefix - */ - - /** - * Constructs a new GcsDestination. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination - * @constructor - * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set - */ - function GcsDestination(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]]; - } - - /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * GcsDestination uriPrefix. - * @member {string} uriPrefix - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @instance - */ - GcsDestination.prototype.uriPrefix = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GcsDestination objectUri. - * @member {"uri"|"uriPrefix"|undefined} objectUri - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @instance - */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GcsDestination instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination instance - */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); - }; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && Object.hasOwnProperty.call(message, "uriPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); - return writer; - }; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.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.asset.v1beta1.GcsDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - case 2: - message.uriPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDestination message. - * @function verify - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - if (properties.objectUri === 1) - return "objectUri: multiple values"; - properties.objectUri = 1; - if (!$util.isString(message.uriPrefix)) - return "uriPrefix: string expected"; - } - return null; - }; - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.GcsDestination} GcsDestination - */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.GcsDestination) - return object; - var message = new $root.google.cloud.asset.v1beta1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.uriPrefix != null) - message.uriPrefix = String(object.uriPrefix); - return message; - }; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @static - * @param {google.cloud.asset.v1beta1.GcsDestination} message GcsDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - object.uriPrefix = message.uriPrefix; - if (options.oneofs) - object.objectUri = "uriPrefix"; - } - return object; - }; - - /** - * Converts this GcsDestination to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.GcsDestination - * @instance - * @returns {Object.} JSON object - */ - GcsDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GcsDestination; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1beta1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - */ - v1beta1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - return values; - })(); - - v1beta1.TemporalAsset = (function() { - - /** - * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset - */ - - /** - * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset - * @constructor - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set - */ - function TemporalAsset(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]]; - } - - /** - * TemporalAsset window. - * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.window = null; - - /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.deleted = false; - - /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.asset = null; - - /** - * Creates a new TemporalAsset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance - */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); - }; - - /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TemporalAsset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.window != null && Object.hasOwnProperty.call(message, "window")) - $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) - $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TemporalAsset.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.asset.v1beta1.TemporalAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TemporalAsset message. - * @function verify - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TemporalAsset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; - } - return null; - }; - - /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset - */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) - return object; - var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); - } - return message; - }; - - /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @static - * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TemporalAsset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; - } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); - return object; - }; - - /** - * Converts this TemporalAsset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.TemporalAsset - * @instance - * @returns {Object.} JSON object - */ - TemporalAsset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TemporalAsset; - })(); - - v1beta1.TimeWindow = (function() { - - /** - * Properties of a TimeWindow. - * @memberof google.cloud.asset.v1beta1 - * @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.asset.v1beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow - * @constructor - * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow - * @instance - */ - TimeWindow.prototype.startTime = null; - - /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1beta1.TimeWindow - * @instance - */ - TimeWindow.prototype.endTime = null; - - /** - * Creates a new TimeWindow instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.TimeWindow - * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance - */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); - }; - - /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.TimeWindow - * @static - * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow - * @static - * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow - */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) - return object; - var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.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.asset.v1beta1.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.asset.v1beta1.TimeWindow - * @static - * @param {google.cloud.asset.v1beta1.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.asset.v1beta1.TimeWindow - * @instance - * @returns {Object.} JSON object - */ - TimeWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TimeWindow; - })(); - - v1beta1.Asset = (function() { - - /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - */ - - /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset - * @constructor - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set - */ - function Asset(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]]; - } - - /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - */ - Asset.prototype.assetType = ""; - - /** - * Asset resource. - * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - */ - Asset.prototype.resource = null; - - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - */ - Asset.prototype.iamPolicy = null; - - /** - * Creates a new Asset instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Asset} Asset instance - */ - Asset.create = function create(properties) { - return new Asset(properties); - }; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.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.assetType != null && Object.hasOwnProperty.call(message, "assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Asset} Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Asset.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.asset.v1beta1.Asset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Asset} Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Asset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Asset message. - * @function verify - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Asset.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - return null; - }; - - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Asset} Asset - */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Asset) - return object; - var message = new $root.google.cloud.asset.v1beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - return message; - }; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.Asset - * @static - * @param {google.cloud.asset.v1beta1.Asset} message Asset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Asset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - return object; - }; - - /** - * Converts this Asset to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.Asset - * @instance - * @returns {Object.} JSON object - */ - Asset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Asset; - })(); - - v1beta1.Resource = (function() { - - /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - */ - - /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set - */ - function Resource(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]]; - } - - /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; - - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.parent = ""; - - /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.data = null; - - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; - - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.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.asset.v1beta1.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Resource message. - * @function verify - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Resource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; - } - return null; - }; - - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Resource} Resource - */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Resource) - return object; - var message = new $root.google.cloud.asset.v1beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); - } - return message; - }; - - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1beta1.Resource - * @static - * @param {google.cloud.asset.v1beta1.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - return object; - }; - - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Resource; - })(); - - return v1beta1; - })(); - asset.v1p1beta1 = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 3a4fbe31000..6095296ac5f 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1335,287 +1335,6 @@ } } }, - "v1beta1": { - "options": { - "csharp_namespace": "Google.Cloud.Asset.V1Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetProto", - "java_package": "com.google.cloud.asset.v1beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1beta1", - "cc_enable_arenas": true - }, - "nested": { - "AssetService": { - "options": { - "(google.api.default_host)": "cloudasset.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ExportAssets": { - "requestType": "ExportAssetsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{parent=projects/*}:exportAssets", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta1/{parent=organizations/*}:exportAssets", - "(google.api.http).additional_bindings.body": "*", - "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1beta1.ExportAssetsResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1beta1.ExportAssetsRequest" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=projects/*}:exportAssets", - "body": "*", - "additional_bindings": [ - { - "post": "/v1beta1/{parent=folders/*}:exportAssets", - "body": "*" - }, - { - "post": "/v1beta1/{parent=organizations/*}:exportAssets", - "body": "*" - } - ] - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.asset.v1beta1.ExportAssetsResponse", - "metadata_type": "google.cloud.asset.v1beta1.ExportAssetsRequest" - } - } - ] - }, - "BatchGetAssetsHistory": { - "requestType": "BatchGetAssetsHistoryRequest", - "responseType": "BatchGetAssetsHistoryResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=projects/*}:batchGetAssetsHistory", - "(google.api.http).additional_bindings.get": "/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=projects/*}:batchGetAssetsHistory", - "additional_bindings": { - "get": "/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" - } - } - } - ] - } - } - }, - "ExportAssetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" - } - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "assetTypes": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "contentType": { - "type": "ContentType", - "id": 4 - }, - "outputConfig": { - "type": "OutputConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportAssetsResponse": { - "fields": { - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "outputConfig": { - "type": "OutputConfig", - "id": 2 - } - } - }, - "BatchGetAssetsHistoryRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" - } - }, - "assetNames": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "contentType": { - "type": "ContentType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "readTimeWindow": { - "type": "TimeWindow", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchGetAssetsHistoryResponse": { - "fields": { - "assets": { - "rule": "repeated", - "type": "TemporalAsset", - "id": 1 - } - } - }, - "OutputConfig": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 1 - } - } - }, - "GcsDestination": { - "oneofs": { - "objectUri": { - "oneof": [ - "uri", - "uriPrefix" - ] - } - }, - "fields": { - "uri": { - "type": "string", - "id": 1 - }, - "uriPrefix": { - "type": "string", - "id": 2 - } - } - }, - "ContentType": { - "values": { - "CONTENT_TYPE_UNSPECIFIED": 0, - "RESOURCE": 1, - "IAM_POLICY": 2 - } - }, - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { - "options": { - "(google.api.resource).type": "cloudasset.googleapis.com/Asset", - "(google.api.resource).pattern": "*" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "assetType": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - }, - "iamPolicy": { - "type": "google.iam.v1.Policy", - "id": 4 - } - } - }, - "Resource": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { - "type": "string", - "id": 3 - }, - "resourceUrl": { - "type": "string", - "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 - } - } - } - } - }, "v1p1beta1": { "options": { "csharp_namespace": "Google.Cloud.Asset.V1P1Beta1", diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 6809b5235ee..d743efb1eb7 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; import * as v1p4beta1 from './v1p4beta1'; @@ -26,17 +25,8 @@ import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; type AssetServiceClient = v1.AssetServiceClient; -export { - v1beta1, - v1p1beta1, - v1p2beta1, - v1p4beta1, - v1p5beta1, - v1, - AssetServiceClient, -}; +export {v1p1beta1, v1p2beta1, v1p4beta1, v1p5beta1, v1, AssetServiceClient}; export default { - v1beta1, v1p1beta1, v1p2beta1, v1p4beta1, diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts deleted file mode 100644 index 6138a67083b..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts +++ /dev/null @@ -1,628 +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 -// -// 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, -} from 'google-gax'; -import * as path from 'path'; - -import * as protos from '../../protos/protos'; -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/asset_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './asset_service_client_config.json'; -import {operationsProtos} from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Asset service definition. - * @class - * @memberof v1beta1 - */ -export class AssetServiceClient { - 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}; - operationsClient: gax.OperationsClient; - assetServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AssetServiceClient. - * - * @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 AssetServiceClient; - const servicePath = - opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - 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 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}`); - } - 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 "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 exportAssetsResponse = protoFilesRoot.lookup( - '.google.cloud.asset.v1beta1.ExportAssetsResponse' - ) as gax.protobuf.Type; - const exportAssetsMetadata = protoFilesRoot.lookup( - '.google.cloud.asset.v1beta1.ExportAssetsRequest' - ) as gax.protobuf.Type; - - this.descriptors.longrunning = { - exportAssets: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportAssetsResponse.decode.bind(exportAssetsResponse), - exportAssetsMetadata.decode.bind(exportAssetsMetadata) - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.asset.v1beta1.AssetService', - 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.assetServiceStub) { - return this.assetServiceStub; - } - - // Put together the "service stub" for - // google.cloud.asset.v1beta1.AssetService. - this.assetServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.asset.v1beta1.AssetService' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.asset.v1beta1.AssetService, - 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 assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; - for (const methodName of assetServiceStubMethods) { - const callPromise = this.assetServiceStub.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.longrunning[methodName] || undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.assetServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'cloudasset.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 'cloudasset.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 -- - // ------------------- - batchGetAssetsHistory( - request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - ( - | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest - | undefined - ), - {} | undefined - ] - >; - batchGetAssetsHistory( - request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest - | null - | undefined, - {} | null | undefined - > - ): void; - batchGetAssetsHistory( - request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - callback: Callback< - protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Batch gets the update history of assets that overlap a time window. - * For RESOURCE content, this API outputs history with asset in both - * non-delete or deleted status. - * For IAM_POLICY content, this API outputs history when the asset and its - * attached IAM POLICY both exist. This can create gaps in the output history. - * If a specified asset does not exist, this API returns an INVALID_ARGUMENT - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {string[]} request.assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * @param {google.cloud.asset.v1beta1.ContentType} [request.contentType] - * Optional. The content type. - * @param {google.cloud.asset.v1beta1.TimeWindow} [request.readTimeWindow] - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. - * 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.batchGetAssetsHistory(request); - */ - batchGetAssetsHistory( - request: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, - ( - | protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest - | 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.batchGetAssetsHistory(request, options, callback); - } - - exportAssets( - request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - exportAssets( - request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - exportAssets( - request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - callback: Callback< - LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the - * {@link google.longrunning.Operation|google.longrunning.Operation} API allowing - * you to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), a project number (such as "projects/12345"), or - * a folder number (such as "folders/123"). - * @param {google.protobuf.Timestamp} request.readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * @param {string[]} request.assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "google.compute.Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * @param {google.cloud.asset.v1beta1.ContentType} request.contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * @param {google.cloud.asset.v1beta1.OutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * @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.exportAssets(request); - * const [response] = await operation.promise(); - */ - exportAssets( - request: protos.google.cloud.asset.v1beta1.IExportAssetsRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): Promise< - [ - LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >, - 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.exportAssets(request, options, callback); - } - /** - * Check the status of the long running operation returned by `exportAssets()`. - * @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 checkExportAssetsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkExportAssetsProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.asset.v1beta1.ExportAssetsResponse, - protos.google.cloud.asset.v1beta1.ExportAssetsRequest - > - > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( - operation, - this.descriptors.longrunning.exportAssets, - gax.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.cloud.asset.v1beta1.ExportAssetsResponse, - protos.google.cloud.asset.v1beta1.ExportAssetsRequest - >; - } - - /** - * 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.assetServiceStub!.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json deleted file mode 100644 index dc9c90c255f..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "interfaces": { - "google.cloud.asset.v1beta1.AssetService": { - "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": { - "ExportAssets": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchGetAssetsHistory": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json deleted file mode 100644 index 6c8ef83a9be..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/cloud/asset/v1beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1beta1/assets.proto" -] diff --git a/packages/google-cloud-asset/src/v1beta1/gapic_metadata.json b/packages/google-cloud-asset/src/v1beta1/gapic_metadata.json deleted file mode 100644 index db5151e8c8d..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.asset.v1beta1", - "libraryPackage": "@google-cloud/asset", - "services": { - "AssetService": { - "clients": { - "grpc": { - "libraryClient": "AssetServiceClient", - "rpcs": { - "BatchGetAssetsHistory": { - "methods": [ - "batchGetAssetsHistory" - ] - }, - "ExportAssets": { - "methods": [ - "exportAssets" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AssetServiceClient", - "rpcs": { - "BatchGetAssetsHistory": { - "methods": [ - "batchGetAssetsHistory" - ] - }, - "ExportAssets": { - "methods": [ - "exportAssets" - ] - } - } - } - } - } - } -} diff --git a/packages/google-cloud-asset/src/v1beta1/index.ts b/packages/google-cloud-asset/src/v1beta1/index.ts deleted file mode 100644 index 275cf4b6f1b..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +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 -// -// 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 {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 06eef3f347d..6a12a4420f0 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,36 +3,27 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "1bc50dda51aff1e5846a83b8464b0ec084b9dfe3" + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "d6c5141ea9b1f1194dc203829a972ccbeac389fe" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "16dd59787d6ce130ab66066c02eeea9dac0c8f0e", - "internalRef": "345712055" + "sha": "360a0e177316b7e9811f2ccbbef11e5f83377f3f", + "internalRef": "347849179" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "41e998d5afdc2c2143a23c9b044b9931936f7318" } } ], "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "bazel" - } - }, { "client": { "source": "googleapis", diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 386467dced0..ef518e5e8e6 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -25,7 +25,7 @@ gapic = gcp.GAPICBazel() -versions = ['v1beta1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1', 'v1p5beta1', 'v1'] +versions = ['v1p1beta1', 'v1p2beta1', 'v1p4beta1', 'v1p5beta1', 'v1'] name = 'asset' for version in versions: library = gapic.node_library(name, version) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts deleted file mode 100644 index caf32c6fccb..00000000000 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1beta1.ts +++ /dev/null @@ -1,475 +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 -// -// 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 assetserviceModule from '../src'; - -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); -} - -describe('v1beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetserviceModule.v1beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - - it('has close method', () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - 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 assetserviceModule.v1beta1.AssetServiceClient({ - 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('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse() - ); - client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( - expectedResponse - ); - const [response] = await client.batchGetAssetsHistory(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchGetAssetsHistory as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes batchGetAssetsHistory without error using callback', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse() - ); - client.innerApiCalls.batchGetAssetsHistory = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.batchGetAssetsHistory( - request, - ( - err?: Error | null, - result?: protos.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchGetAssetsHistory as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes batchGetAssetsHistory with error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.batchGetAssetsHistory(request), - expectedError - ); - assert( - (client.innerApiCalls.batchGetAssetsHistory as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); - - describe('exportAssets', () => { - it('invokes exportAssets without error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportAssets(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes exportAssets without error using callback', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportAssets = stubLongRunningCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.exportAssets( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - > | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const operation = (await promise) as LROperation< - protos.google.cloud.asset.v1beta1.IExportAssetsResponse, - protos.google.cloud.asset.v1beta1.IExportAssetsRequest - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes exportAssets with call error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportAssets = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(client.exportAssets(request), expectedError); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes exportAssets with LRO error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.asset.v1beta1.ExportAssetsRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportAssets = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.exportAssets(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkExportAssetsProgress without error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - 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.checkExportAssetsProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportAssetsProgress with error', async () => { - const client = new assetserviceModule.v1beta1.AssetServiceClient({ - 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.checkExportAssetsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); -}); From 6f430c10912e4f9f5435026f38fbb65f97f68746 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:44:15 -0800 Subject: [PATCH 295/429] docs: add instructions for authenticating for system tests (#443) 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 --- packages/google-cloud-asset/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-asset/README.md | 3 +-- packages/google-cloud-asset/synth.metadata | 6 +++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CONTRIBUTING.md b/packages/google-cloud-asset/CONTRIBUTING.md index f6c4cf010e3..47be3bfbb42 100644 --- a/packages/google-cloud-asset/CONTRIBUTING.md +++ b/packages/google-cloud-asset/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 Cloud Asset Inventory 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=cloudasset.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 7f8d7e4e1e4..9d91367da32 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -91,8 +91,7 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 6a12a4420f0..a8b32d9b046 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "d6c5141ea9b1f1194dc203829a972ccbeac389fe" + "remote": "https://github.com/googleapis/nodejs-asset.git", + "sha": "f8fca67f82eef7612b62b4ffe30129ca60ea1e1d" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "41e998d5afdc2c2143a23c9b044b9931936f7318" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From e027a29928d1e89226a0f9029d4669dbb8451073 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:42:04 -0800 Subject: [PATCH 296/429] docs: update dates (#444) 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-asset/.jsdoc.js | 4 ++-- packages/google-cloud-asset/protos/protos.d.ts | 2 +- packages/google-cloud-asset/protos/protos.js | 2 +- packages/google-cloud-asset/src/v1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1/index.ts | 2 +- .../google-cloud-asset/src/v1p1beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p1beta1/index.ts | 2 +- .../google-cloud-asset/src/v1p2beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p2beta1/index.ts | 2 +- .../google-cloud-asset/src/v1p4beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p4beta1/index.ts | 2 +- .../google-cloud-asset/src/v1p5beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p5beta1/index.ts | 2 +- packages/google-cloud-asset/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-asset/system-test/install.ts | 2 +- packages/google-cloud-asset/test/gapic_asset_service_v1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 03f79f28b1d..e10d49bd063 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.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/asset', diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 38c7d0474a6..bed92701adc 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 50cc8725569..53833879a04 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/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-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index e21378ae23c..cfb9c1d126a 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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-asset/src/v1/index.ts b/packages/google-cloud-asset/src/v1/index.ts index 275cf4b6f1b..4f605d7da89 100644 --- a/packages/google-cloud-asset/src/v1/index.ts +++ b/packages/google-cloud-asset/src/v1/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-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index f352accc24a..11ca20e3d5b 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_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-asset/src/v1p1beta1/index.ts b/packages/google-cloud-asset/src/v1p1beta1/index.ts index 275cf4b6f1b..4f605d7da89 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/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-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 6cb8aca1662..211169485d0 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_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-asset/src/v1p2beta1/index.ts b/packages/google-cloud-asset/src/v1p2beta1/index.ts index 275cf4b6f1b..4f605d7da89 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/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-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index a54fea9a2fd..3e67e0543f7 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_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-asset/src/v1p4beta1/index.ts b/packages/google-cloud-asset/src/v1p4beta1/index.ts index 275cf4b6f1b..4f605d7da89 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/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-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index d42164a70e5..437c5d3a7ea 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_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-asset/src/v1p5beta1/index.ts b/packages/google-cloud-asset/src/v1p5beta1/index.ts index 275cf4b6f1b..4f605d7da89 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index a8b32d9b046..26f3f2cb125 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "f8fca67f82eef7612b62b4ffe30129ca60ea1e1d" + "sha": "9d705020d43c946254ba29e198ffd297650184aa" } }, { diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js index d987f511fce..2338e58dfd2 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-asset/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-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index b551d6664dc..f682b8c3424 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/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-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-asset/system-test/install.ts +++ b/packages/google-cloud-asset/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-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 6f21e754476..53a1913e6a5 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.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-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index 0036e151588..b1ad49ac34f 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.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-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index 8e340e8bc71..cff6c54b53c 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.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-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index f74979b1200..4b48aa3472c 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.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-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 85fbafbae82..3c610630345 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.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 f0900c3bc0e269f5d74cfa204f273e540f56aeca Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:40:26 -0800 Subject: [PATCH 297/429] feat: adds style enumeration (#445) 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. --- .../google-cloud-asset/protos/protos.d.ts | 12 +++ packages/google-cloud-asset/protos/protos.js | 78 ++++++++++++++++++- .../google-cloud-asset/protos/protos.json | 13 +++- packages/google-cloud-asset/synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index bed92701adc..8cca958d7d3 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -12789,6 +12789,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -12818,6 +12821,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 @@ -12897,6 +12903,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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 53833879a04..1db25221ae1 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -31309,6 +31309,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 */ /** @@ -31321,6 +31322,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) @@ -31375,6 +31377,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 @@ -31412,6 +31422,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; }; @@ -31466,6 +31482,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; @@ -31529,6 +31555,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; }; @@ -31573,6 +31611,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; }; @@ -31589,8 +31644,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 = ""; @@ -31613,6 +31670,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; }; @@ -31643,6 +31705,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-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 6095296ac5f..438b401e070 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3193,6 +3193,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -3202,6 +3207,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -3221,7 +3232,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-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 26f3f2cb125..600af92f977 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "9d705020d43c946254ba29e198ffd297650184aa" + "sha": "6d3d5612f5e1a599cb82be119da070955be56107" } }, { From 3d41b6e494bf1d801ab32aafbfe0c4c2cca8857a 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:36:15 +0000 Subject: [PATCH 298/429] chore: release 3.11.0 (#446) :robot: I have created a release \*beep\* \*boop\* --- ## [3.11.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.10.0...v3.11.0) (2021-01-09) ### Features * adds style enumeration ([#445](https://www.github.com/googleapis/nodejs-asset/issues/445)) ([28c3612](https://www.github.com/googleapis/nodejs-asset/commit/28c361225ab0cdc2d4b141b5ef02cac5f257a85b)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index e48cfb4bc04..95b7b747c0d 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.11.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.10.0...v3.11.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#445](https://www.github.com/googleapis/nodejs-asset/issues/445)) ([28c3612](https://www.github.com/googleapis/nodejs-asset/commit/28c361225ab0cdc2d4b141b5ef02cac5f257a85b)) + ## [3.10.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.9.1...v3.10.0) (2020-12-02) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ba26d6cb65b..91c52639dcb 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.10.0", + "version": "3.11.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 310004b2b01..f761e66f882 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.10.0", + "@google-cloud/asset": "^3.11.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 20ff94134f47355a7004d634fe7cdbb1e7306c7a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 09:42:03 -0800 Subject: [PATCH 299/429] refactor(nodejs): move build cop to flakybot (#449) 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-asset/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 600af92f977..74fd92bdb56 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "6d3d5612f5e1a599cb82be119da070955be56107" + "sha": "1b5d4c8601ede3a8796123c558ee1f65cb4168f5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From 5fff30ff698dbc8c30717e1f617091eb410b3de6 Mon Sep 17 00:00:00 2001 From: donghez-google <74332020+donghez-google@users.noreply.github.com> Date: Thu, 28 Jan 2021 15:01:27 -0800 Subject: [PATCH 300/429] feat(samples): add samples for analyzeIamPolicy and analyzeIamPolicyLongrunning (#433) --- .../google-cloud-asset/samples/package.json | 1 + .../samples/test/sample.test.js | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index f761e66f882..4c6b84b3f6c 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@google-cloud/asset": "^3.11.0", + "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 30be671a8d9..141f2cb2bd8 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -26,6 +26,13 @@ const storage = new Storage(); const bucketName = `asset-nodejs-${uuid.v4()}`; const bucket = storage.bucket(bucketName); +const {BigQuery} = require('@google-cloud/bigquery'); +const bigquery = new BigQuery(); +const options = { + location: 'US', +}; +const datasetId = `asset_nodejs_${uuid.v4()}`.replace(/-/gi, '_'); + const Compute = require('@google-cloud/compute'); const zone = new Compute().zone('us-central1-c'); const vmName = `asset-nodejs-${uuid.v4()}`; @@ -49,11 +56,14 @@ const delay = async test => { describe('quickstart sample tests', () => { before(async () => { await bucket.create(); + await bigquery.createDataset(datasetId, options); + await bigquery.dataset(datasetId).exists(); [vm] = await zone.createVM(vmName, {os: 'ubuntu'}); }); after(async () => { await bucket.delete(); + await bigquery.dataset(datasetId).delete({force: true}).catch(console.warn); await vm.delete(); }); @@ -99,4 +109,41 @@ describe('quickstart sample tests', () => { const stdout = execSync(`node listAssets ${assetType}`); assert.include(stdout, assetType); }); + + it('should analyze iam policy successfully', async () => { + const stdout = execSync('node analyzeIamPolicy'); + assert.include(stdout, '//cloudresourcemanager.googleapis.com/projects'); + }); + + it('should analyze iam policy and write analysis results to gcs successfully', async function () { + this.retries(2); + await delay(this.test); + const uri = `gs://${bucketName}/my-analysis.json`; + execSync(`node analyzeIamPolicyLongrunningGcs ${uri}`); + const file = await bucket.file('my-analysis.json'); + const exists = await file.exists(); + assert.ok(exists); + await file.delete(); + }); + + it('should analyze iam policy and write analysis results to bigquery successfully', async function () { + this.retries(2); + await delay(this.test); + const tablePrefix = 'analysis_nodejs'; + execSync( + `node analyzeIamPolicyLongrunningBigquery ${datasetId} ${tablePrefix}` + ); + const metadataTable = await bigquery + .dataset(datasetId) + .table('analysis_nodejs_analysis'); + const metadataTable_exists = await metadataTable.exists(); + assert.ok(metadataTable_exists); + const resultsTable = await bigquery + .dataset(datasetId) + .table('analysis_nodejs_analysis_result'); + const resultsTable_exists = await resultsTable.exists(); + assert.ok(resultsTable_exists); + await metadataTable.delete(); + await resultsTable.delete(); + }); }); From fc73fc23efdca5d85023bc4d84b43a0218ebe719 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 8 Feb 2021 14:33:45 -0800 Subject: [PATCH 301/429] docs: fix yaml parsing error in comments (#452) --- packages/google-cloud-asset/README.md | 3 + packages/google-cloud-asset/samples/README.md | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 9d91367da32..0ddb14d8a80 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -95,6 +95,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/tree/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Analyze Iam Policy | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) | +| Analyze Iam Policy Longrunning and write results to Bigquery | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) | +| Analyze Iam Policy Longrunning and write results to GCS | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningGcs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) | | Create Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/createFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) | | Delete Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/deleteFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) | | Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index b883ab1c86b..aa7a6640204 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -12,6 +12,9 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Analyze Iam Policy](#analyze-iam-policy) + * [Analyze Iam Policy Longrunning and write results to Bigquery](#analyze-iam-policy-longrunning-and-write-results-to-bigquery) + * [Analyze Iam Policy Longrunning and write results to GCS](#analyze-iam-policy-longrunning-and-write-results-to-gcs) * [Create Feed](#create-feed) * [Delete Feed](#delete-feed) * [Export Assets](#export-assets) @@ -39,6 +42,63 @@ Before running the samples, make sure you've followed the steps outlined in +### Analyze Iam Policy + +Analyzes accessible IAM policies that match a request. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) + +__Usage:__ + + +`node analyzeIamPolicy` + + +----- + + + + +### Analyze Iam Policy Longrunning and write results to Bigquery + +Analyzes accessible IAM policies that match a request. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningBigquery.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) + +__Usage:__ + + +`node analyzeIamPolicyLongrunningBigquery ` + + +----- + + + + +### Analyze Iam Policy Longrunning and write results to GCS + +Analyzes accessible IAM policies that match a request. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningGcs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) + +__Usage:__ + + +`node analyzeIamPolicyLongrunningGcs ` + + +----- + + + + ### Create Feed Create Feed. From 7c95ad3ab386c34756ff9c72a2412690ea92738d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 9 Feb 2021 10:02:44 -0800 Subject: [PATCH 302/429] build: adds UNORDERED_LIST enum --- packages/google-cloud-asset/protos/protos.d.ts | 3 ++- packages/google-cloud-asset/protos/protos.js | 7 +++++++ packages/google-cloud-asset/protos/protos.json | 3 ++- packages/google-cloud-asset/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 8cca958d7d3..c30e22437d1 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -12766,7 +12766,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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 1db25221ae1..87a84853102 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -31285,6 +31285,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); @@ -31294,6 +31295,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; })(); @@ -37461,6 +37463,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -37561,6 +37564,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-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 438b401e070..91be1888f9e 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3148,7 +3148,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 74fd92bdb56..8d974d3f210 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "1b5d4c8601ede3a8796123c558ee1f65cb4168f5" + "sha": "1646a22912439ca5357070e5397cc34e6d8f1ce0" } }, { From f0b74c22517e3618aada82a7ad7e391c77582aa9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:10:04 +0000 Subject: [PATCH 303/429] chore: release 3.12.0 (#450) :robot: I have created a release \*beep\* \*boop\* --- ## [3.12.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.11.0...v3.12.0) (2021-02-09) ### Features * **samples:** add samples for analyzeIamPolicy and analyzeIamPolicyLongrunning ([#433](https://www.github.com/googleapis/nodejs-asset/issues/433)) ([dfbd75c](https://www.github.com/googleapis/nodejs-asset/commit/dfbd75c98f2977d3a9af06e7637c005b82eda973)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 95b7b747c0d..48857ff333a 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.12.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.11.0...v3.12.0) (2021-02-09) + + +### Features + +* **samples:** add samples for analyzeIamPolicy and analyzeIamPolicyLongrunning ([#433](https://www.github.com/googleapis/nodejs-asset/issues/433)) ([dfbd75c](https://www.github.com/googleapis/nodejs-asset/commit/dfbd75c98f2977d3a9af06e7637c005b82eda973)) + ## [3.11.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.10.0...v3.11.0) (2021-01-09) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 91c52639dcb..aec3c6c073f 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.11.0", + "version": "3.12.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 4c6b84b3f6c..b3d78c52bea 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.11.0", + "@google-cloud/asset": "^3.12.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 263166ad81599a37694329a60e1d793c27af0f73 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:29 -0800 Subject: [PATCH 304/429] build: update gapic-generator-typescript to v1.2.10. (#455) 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-asset/synth.metadata | 6 +++--- packages/google-cloud-asset/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 8d974d3f210..883a45c1a09 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "1646a22912439ca5357070e5397cc34e6d8f1ce0" + "sha": "7136b0508adc3b0c419677447e2a9f71b42fc565" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "360a0e177316b7e9811f2ccbbef11e5f83377f3f", - "internalRef": "347849179" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js index e1e2d012941..43b51714f43 100644 --- a/packages/google-cloud-asset/webpack.config.js +++ b/packages/google-cloud-asset/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 33d94eb55f55fbf4c8c3196fe88ead6a42993afd Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Wed, 17 Mar 2021 13:47:33 -0700 Subject: [PATCH 305/429] chore: migrate to owl-bot (#457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owl-bot * feat: Support output transcript to GCS for LongRunningRecognize. PiperOrigin-RevId: 362294447 Source-Link: https://github.com/googleapis/googleapis/commit/b6ebac16c3aecb798d4f25443d96df2f42a965ca Source-Link: https://github.com/googleapis/googleapis-gen/commit/a20b5124fe5bae9b6bbebb8c84450282229f7456 * 🦉 Updates from OwlBot * don't preserve protos because the original synth.py didn't * retrigger checks * update docker image digest * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../google-cloud-asset/.github/.OwlBot.yaml | 25 +++++++ .../google-cloud-asset/.repo-metadata.json | 3 +- packages/google-cloud-asset/synth.metadata | 73 ------------------- packages/google-cloud-asset/synth.py | 44 ----------- 4 files changed, 27 insertions(+), 118 deletions(-) create mode 100644 packages/google-cloud-asset/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-asset/synth.metadata delete mode 100644 packages/google-cloud-asset/synth.py diff --git a/packages/google-cloud-asset/.github/.OwlBot.yaml b/packages/google-cloud-asset/.github/.OwlBot.yaml new file mode 100644 index 00000000000..8661997bd93 --- /dev/null +++ b/packages/google-cloud-asset/.github/.OwlBot.yaml @@ -0,0 +1,25 @@ +# 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-preserve-regex: + - /owl-bot-staging/v1p7beta1 + +deep-copy-regex: + - source: /google/cloud/asset/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 \ No newline at end of file diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index a9c50b76169..139eb06e3ae 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -9,5 +9,6 @@ "repo": "googleapis/nodejs-asset", "distribution_name": "@google-cloud/asset", "api_id": "cloudasset.googleapis.com", - "requires_billing": true + "requires_billing": true, + "default_version": "v1" } diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata deleted file mode 100644 index 883a45c1a09..00000000000 --- a/packages/google-cloud-asset/synth.metadata +++ /dev/null @@ -1,73 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "7136b0508adc3b0c419677447e2a9f71b42fc565" - } - }, - { - "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": "asset", - "apiVersion": "v1p1beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1p2beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1p4beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1p5beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py deleted file mode 100644 index ef518e5e8e6..00000000000 --- a/packages/google-cloud-asset/synth.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2018 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 json -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node as node -import logging - -logging.basicConfig(level=logging.DEBUG) - -AUTOSYNTH_MULTIPLE_COMMITS = True - - -gapic = gcp.GAPICBazel() -versions = ['v1p1beta1', 'v1p2beta1', 'v1p4beta1', 'v1p5beta1', 'v1'] -name = 'asset' -for version in versions: - library = gapic.node_library(name, version) - # skip index, protos, package.json, and README.md - s.copy( - library, - excludes=['package.json', 'README.md'] - ) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library( - source_location='build/src', versions=versions, default_version='v1') -s.copy(templates) - -node.postprocess_gapic_library() From 6421fa74e5d49cdbe3ddea21d9a37908c4a5ff24 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:50:16 +0100 Subject: [PATCH 306/429] chore(deps): update dependency sinon to v10 (#463) [![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.1` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index aec3c6c073f..faaf97070dc 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -62,7 +62,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 14eb02255826b592c1fb006a8c395fb4b3f891cf 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:43:37 -0700 Subject: [PATCH 307/429] build: update .OwlBot.lock with new version of post-processor (#465) Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-asset/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index d743efb1eb7..70a24905289 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -17,20 +17,20 @@ // ** All changes to this file may be overwritten. ** import * as v1p1beta1 from './v1p1beta1'; -import * as v1p2beta1 from './v1p2beta1'; import * as v1p4beta1 from './v1p4beta1'; import * as v1p5beta1 from './v1p5beta1'; +import * as v1p2beta1 from './v1p2beta1'; import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; type AssetServiceClient = v1.AssetServiceClient; -export {v1p1beta1, v1p2beta1, v1p4beta1, v1p5beta1, v1, AssetServiceClient}; +export {v1p1beta1, v1p4beta1, v1p5beta1, v1p2beta1, v1, AssetServiceClient}; export default { v1p1beta1, - v1p2beta1, v1p4beta1, v1p5beta1, + v1p2beta1, v1, AssetServiceClient, }; From 38d94ababd6164b5eaf6d707406be43c875ad654 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:08:33 +0200 Subject: [PATCH 308/429] chore(deps): update dependency @types/sinon to v10 (#470) [![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.0` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index faaf97070dc..fce200bad66 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -51,7 +51,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^13.9.3", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", "gts": "^2.0.0", From ae0ace9243eac41bc8d1f6c1a6162bf8bfbd7f8d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 19:34:06 +0000 Subject: [PATCH 309/429] build: update .OwlBot.lock with new version of post-processor (#473) This PR updates the docker container used for OwlBot. This container performs post-processing tasks when pull-requests are opened on your repository, such as: * copying generated files into place. * generating common files from templates. Version sha256:c3eae37a355402067b97cbeb6f5a7d2dd87aecfd064aeb2d2ea0bde40778cf68 was published at 2021-04-16T19:05:48.244Z. --- packages/google-cloud-asset/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 70a24905289..8240d119eed 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -16,20 +16,20 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1p1beta1 from './v1p1beta1'; import * as v1p4beta1 from './v1p4beta1'; import * as v1p5beta1 from './v1p5beta1'; +import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; type AssetServiceClient = v1.AssetServiceClient; -export {v1p1beta1, v1p4beta1, v1p5beta1, v1p2beta1, v1, AssetServiceClient}; +export {v1p4beta1, v1p5beta1, v1p1beta1, v1p2beta1, v1, AssetServiceClient}; export default { - v1p1beta1, v1p4beta1, v1p5beta1, + v1p1beta1, v1p2beta1, v1, AssetServiceClient, From de91feabce14a6c57420edf54151ebb77b390d38 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:04 +0200 Subject: [PATCH 310/429] chore(deps): update dependency ts-loader to v9 (#474) [![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.0` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index fce200bad66..3928be70ff3 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -63,7 +63,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", "webpack-cli": "^4.0.0", From c3ccdff5f739d83db3a3b06c91816f8c8479d096 Mon Sep 17 00:00:00 2001 From: "google-cloud-policy-bot[bot]" <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com> Date: Thu, 29 Apr 2021 00:18:29 +0000 Subject: [PATCH 311/429] chore: add SECURITY.md (#477) chore: add SECURITY.md --- packages/google-cloud-asset/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 8240d119eed..70a24905289 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -16,20 +16,20 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1p1beta1 from './v1p1beta1'; import * as v1p4beta1 from './v1p4beta1'; import * as v1p5beta1 from './v1p5beta1'; -import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; type AssetServiceClient = v1.AssetServiceClient; -export {v1p4beta1, v1p5beta1, v1p1beta1, v1p2beta1, v1, AssetServiceClient}; +export {v1p1beta1, v1p4beta1, v1p5beta1, v1p2beta1, v1, AssetServiceClient}; export default { + v1p1beta1, v1p4beta1, v1p5beta1, - v1p1beta1, v1p2beta1, v1, AssetServiceClient, From 189b231bd86b1df4b1cd9b89361bd0101ca7d8a3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 5 May 2021 12:12:19 -0700 Subject: [PATCH 312/429] chore: migrate asset to the PHP microgenerator (#479) --- .../protos/google/cloud/asset/v1p2beta1/asset_service.proto | 2 +- .../protos/google/cloud/asset/v1p2beta1/assets.proto | 2 +- packages/google-cloud-asset/protos/protos.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto index 7925bba6878..a19ee75fabd 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -32,7 +32,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1 option java_multiple_files = true; option java_outer_classname = "AssetServiceProto"; option java_package = "com.google.cloud.asset.v1p2beta1"; -option php_namespace = "Google\\Cloud\\Asset\\V1p2Beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p2beta1"; // Asset service definition. service AssetService { diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto index 8fee229bbc3..33d93e1c3b3 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -29,7 +29,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1 option java_multiple_files = true; option java_outer_classname = "AssetProto"; option java_package = "com.google.cloud.asset.v1p2beta1"; -option php_namespace = "Google\\Cloud\\Asset\\v1p2beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p2beta1"; // Temporal asset. In addition to the asset, the temporal asset includes the // status of the asset and valid from and to time of it. diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 91be1888f9e..c3ab1296b93 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1587,7 +1587,7 @@ "java_multiple_files": true, "java_outer_classname": "AssetProto", "java_package": "com.google.cloud.asset.v1p2beta1", - "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p2beta1", "cc_enable_arenas": true }, "nested": { From 6da259b29038b99c93a685b8099dd89e39232275 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:50:19 -0700 Subject: [PATCH 313/429] fix(deps): require google-gax v2.12.0 (#481) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 3928be70ff3..e6a93e3f520 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -46,7 +46,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 2c1ebadb73c918de3b8de42477123673d7fb8cd7 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:07 +0000 Subject: [PATCH 314/429] chore: new owl bot post processor docker image (#483) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../google-cloud-asset/protos/protos.d.ts | 32 +-- packages/google-cloud-asset/protos/protos.js | 64 ++--- .../src/v1/asset_service_client.ts | 154 +++++------ .../src/v1p1beta1/asset_service_client.ts | 73 +++--- .../src/v1p2beta1/asset_service_client.ts | 60 ++--- .../src/v1p4beta1/asset_service_client.ts | 33 ++- .../src/v1p5beta1/asset_service_client.ts | 44 ++-- .../test/gapic_asset_service_v1.ts | 244 ++++++++---------- .../test/gapic_asset_service_v1p1beta1.ts | 171 ++++++------ .../test/gapic_asset_service_v1p2beta1.ts | 43 ++- .../test/gapic_asset_service_v1p4beta1.ts | 29 +-- .../test/gapic_asset_service_v1p5beta1.ts | 22 +- 12 files changed, 448 insertions(+), 521 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index c30e22437d1..1805359ec45 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1555,10 +1555,10 @@ export namespace google { constructor(properties?: google.cloud.asset.v1.IGcsDestination); /** GcsDestination uri. */ - public uri: string; + public uri?: (string|null); /** GcsDestination uriPrefix. */ - public uriPrefix: string; + public uriPrefix?: (string|null); /** GcsDestination objectUri. */ public objectUri?: ("uri"|"uriPrefix"); @@ -5156,10 +5156,10 @@ export namespace google { constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess); /** Access role. */ - public role: string; + public role?: (string|null); /** Access permission. */ - public permission: string; + public permission?: (string|null); /** Access analysisState. */ public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); @@ -7349,7 +7349,7 @@ export namespace google { constructor(properties?: google.cloud.asset.v1p2beta1.IGcsDestination); /** GcsDestination uri. */ - public uri: string; + public uri?: (string|null); /** GcsDestination objectUri. */ public objectUri?: "uri"; @@ -9888,10 +9888,10 @@ export namespace google { constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess); /** Access role. */ - public role: string; + public role?: (string|null); /** Access permission. */ - public permission: string; + public permission?: (string|null); /** Access analysisState. */ public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); @@ -12563,19 +12563,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); @@ -16539,16 +16539,16 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue); + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue. */ - public numberValue: number; + public numberValue?: (number|null); /** Value stringValue. */ - public stringValue: string; + public stringValue?: (string|null); /** Value boolValue. */ - public boolValue: boolean; + public boolValue?: (boolean|null); /** Value structValue. */ public structValue?: (google.protobuf.IStruct|null); diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 87a84853102..948a7f075f3 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -3476,19 +3476,19 @@ /** * GcsDestination uri. - * @member {string} uri + * @member {string|null|undefined} uri * @memberof google.cloud.asset.v1.GcsDestination * @instance */ - GcsDestination.prototype.uri = ""; + GcsDestination.prototype.uri = null; /** * GcsDestination uriPrefix. - * @member {string} uriPrefix + * @member {string|null|undefined} uriPrefix * @memberof google.cloud.asset.v1.GcsDestination * @instance */ - GcsDestination.prototype.uriPrefix = ""; + GcsDestination.prototype.uriPrefix = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -12459,19 +12459,19 @@ /** * Access role. - * @member {string} role + * @member {string|null|undefined} role * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access * @instance */ - Access.prototype.role = ""; + Access.prototype.role = null; /** * Access permission. - * @member {string} permission + * @member {string|null|undefined} permission * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access * @instance */ - Access.prototype.permission = ""; + Access.prototype.permission = null; /** * Access analysisState. @@ -17616,11 +17616,11 @@ /** * GcsDestination uri. - * @member {string} uri + * @member {string|null|undefined} uri * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance */ - GcsDestination.prototype.uri = ""; + GcsDestination.prototype.uri = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -23696,19 +23696,19 @@ /** * Access role. - * @member {string} role + * @member {string|null|undefined} role * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access * @instance */ - Access.prototype.role = ""; + Access.prototype.role = null; /** * Access permission. - * @member {string} permission + * @member {string|null|undefined} permission * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access * @instance */ - Access.prototype.permission = ""; + Access.prototype.permission = null; /** * Access analysisState. @@ -30646,43 +30646,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. @@ -41516,35 +41516,35 @@ /** * Value nullValue. - * @member {google.protobuf.NullValue} nullValue + * @member {google.protobuf.NullValue|null|undefined} nullValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.nullValue = 0; + Value.prototype.nullValue = null; /** * Value numberValue. - * @member {number} numberValue + * @member {number|null|undefined} numberValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.numberValue = 0; + Value.prototype.numberValue = null; /** * Value stringValue. - * @member {string} stringValue + * @member {string|null|undefined} stringValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.stringValue = ""; + Value.prototype.stringValue = null; /** * Value boolValue. - * @member {boolean} boolValue + * @member {boolean|null|undefined} boolValue * @memberof google.protobuf.Value * @instance */ - Value.prototype.boolValue = false; + Value.prototype.boolValue = null; /** * Value structValue. diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index cfb9c1d126a..e79c94cac94 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -301,13 +301,14 @@ export class AssetServiceClient { ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.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; } @@ -492,11 +493,10 @@ export class AssetServiceClient { 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.batchGetAssetsHistory(request, options, callback); } @@ -590,11 +590,10 @@ export class AssetServiceClient { 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.createFeed(request, options, callback); } @@ -677,11 +676,10 @@ export class AssetServiceClient { 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.getFeed(request, options, callback); } @@ -763,11 +761,10 @@ export class AssetServiceClient { 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.listFeeds(request, options, callback); } @@ -855,11 +852,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feed.name': request.feed!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'feed.name': request.feed!.name || '', + }); this.initialize(); return this.innerApiCalls.updateFeed(request, options, callback); } @@ -942,11 +938,10 @@ export class AssetServiceClient { 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.deleteFeed(request, options, callback); } @@ -1040,11 +1035,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'analysis_query.scope': request.analysisQuery!.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'analysis_query.scope': request.analysisQuery!.scope || '', + }); this.initialize(); return this.innerApiCalls.analyzeIamPolicy(request, options, callback); } @@ -1188,11 +1182,10 @@ export class AssetServiceClient { 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.exportAssets(request, options, callback); } @@ -1340,11 +1333,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'analysis_query.scope': request.analysisQuery!.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'analysis_query.scope': request.analysisQuery!.scope || '', + }); this.initialize(); return this.innerApiCalls.analyzeIamPolicyLongrunning( request, @@ -1548,11 +1540,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); this.initialize(); return this.innerApiCalls.searchAllResources(request, options, callback); } @@ -1652,11 +1643,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllResources.createStream( @@ -1767,17 +1757,16 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1919,11 +1908,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); this.initialize(); return this.innerApiCalls.searchAllIamPolicies(request, options, callback); } @@ -2002,11 +1990,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.createStream( @@ -2096,17 +2083,16 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 11ca20e3d5b..b409b71d051 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -228,13 +228,14 @@ export class AssetServiceClient { ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.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; } @@ -424,11 +425,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); this.initialize(); return this.innerApiCalls.searchAllResources(request, options, callback); } @@ -484,11 +484,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllResources.createStream( @@ -555,17 +554,16 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -681,11 +679,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); this.initialize(); return this.innerApiCalls.searchAllIamPolicies(request, options, callback); } @@ -736,11 +733,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.createStream( @@ -802,17 +798,16 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - scope: request.scope || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + scope: request.scope || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 211169485d0..17a6b355472 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -222,13 +222,14 @@ export class AssetServiceClient { ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.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; } @@ -392,11 +393,10 @@ export class AssetServiceClient { 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.createFeed(request, options, callback); } @@ -481,11 +481,10 @@ export class AssetServiceClient { 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.getFeed(request, options, callback); } @@ -569,11 +568,10 @@ export class AssetServiceClient { 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.listFeeds(request, options, callback); } @@ -663,11 +661,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feed.name': request.feed!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'feed.name': request.feed!.name || '', + }); this.initialize(); return this.innerApiCalls.updateFeed(request, options, callback); } @@ -752,11 +749,10 @@ export class AssetServiceClient { 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.deleteFeed(request, options, callback); } diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 3e67e0543f7..1cfe587e733 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -245,13 +245,14 @@ export class AssetServiceClient { ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.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; } @@ -410,11 +411,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'analysis_query.parent': request.analysisQuery!.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'analysis_query.parent': request.analysisQuery!.parent || '', + }); this.initialize(); return this.innerApiCalls.analyzeIamPolicy(request, options, callback); } @@ -523,11 +523,10 @@ export class AssetServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'analysis_query.parent': request.analysisQuery!.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'analysis_query.parent': request.analysisQuery!.parent || '', + }); this.initialize(); return this.innerApiCalls.exportIamPolicyAnalysis( request, diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 437c5d3a7ea..b7f5150806e 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -220,13 +220,14 @@ export class AssetServiceClient { const assetServiceStubMethods = ['listAssets']; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.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; } @@ -412,11 +413,10 @@ export class AssetServiceClient { 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.listAssets(request, options, callback); } @@ -472,11 +472,10 @@ export class AssetServiceClient { 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.listAssets.createStream( @@ -543,17 +542,16 @@ export class AssetServiceClient { 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.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 53a1913e6a5..8bf238571a5 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.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; @@ -248,9 +247,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() ); - client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.batchGetAssetsHistory = + stubSimpleCall(expectedResponse); const [response] = await client.batchGetAssetsHistory(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -281,9 +279,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() ); - client.innerApiCalls.batchGetAssetsHistory = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchGetAssetsHistory = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchGetAssetsHistory( request, @@ -396,9 +393,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); - client.innerApiCalls.createFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createFeed( request, @@ -508,9 +504,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); - client.innerApiCalls.getFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getFeed( request, @@ -617,9 +612,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsResponse() ); - client.innerApiCalls.listFeeds = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listFeeds = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listFeeds( request, @@ -728,9 +722,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); - client.innerApiCalls.updateFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateFeed( request, @@ -841,9 +834,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteFeed( request, @@ -955,9 +947,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() ); - client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.analyzeIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.analyzeIamPolicy( request, @@ -1069,9 +1060,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.exportAssets = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.exportAssets = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.exportAssets( request, @@ -1229,9 +1219,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.analyzeIamPolicyLongrunning = + stubLongRunningCall(expectedResponse); const [operation] = await client.analyzeIamPolicyLongrunning(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1264,9 +1253,8 @@ describe('v1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.analyzeIamPolicyLongrunning = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.analyzeIamPolicyLongrunning( request, @@ -1381,9 +1369,10 @@ describe('v1.AssetServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkAnalyzeIamPolicyLongrunningProgress( - expectedResponse.name - ); + const decodedOperation = + await client.checkAnalyzeIamPolicyLongrunningProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); @@ -1439,9 +1428,8 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.ResourceSearchResult() ), ]; - client.innerApiCalls.searchAllResources = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.searchAllResources = + stubSimpleCall(expectedResponse); const [response] = await client.searchAllResources(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1480,9 +1468,8 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.ResourceSearchResult() ), ]; - client.innerApiCalls.searchAllResources = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchAllResources = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchAllResources( request, @@ -1560,12 +1547,12 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.ResourceSearchResult() ), ]; - client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.searchAllResources.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = []; + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + []; stream.on( 'data', (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { @@ -1587,10 +1574,9 @@ describe('v1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllResources, request) ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1607,13 +1593,12 @@ describe('v1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllResources.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = []; + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + []; stream.on( 'data', (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { @@ -1634,10 +1619,9 @@ describe('v1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllResources, request) ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1664,25 +1648,25 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.ResourceSearchResult() ), ]; - client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = []; + client.descriptors.page.searchAllResources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + []; const iterable = client.searchAllResourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1699,27 +1683,26 @@ describe('v1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllResources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.searchAllResourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = []; + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1755,9 +1738,8 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.searchAllIamPolicies = + stubSimpleCall(expectedResponse); const [response] = await client.searchAllIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1796,9 +1778,8 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchAllIamPolicies = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchAllIamPolicies( request, @@ -1878,12 +1859,12 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.searchAllIamPolicies.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = + []; stream.on( 'data', (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { @@ -1905,10 +1886,9 @@ describe('v1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1925,13 +1905,12 @@ describe('v1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllIamPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = + []; stream.on( 'data', (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { @@ -1952,10 +1931,9 @@ describe('v1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1982,25 +1960,25 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; + client.descriptors.page.searchAllIamPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = + []; const iterable = client.searchAllIamPoliciesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2017,27 +1995,26 @@ describe('v1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllIamPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.searchAllIamPoliciesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2118,17 +2095,18 @@ describe('v1.AssetServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationFeedPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationFeedPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationFeedName', () => { - const result = client.matchOrganizationFromOrganizationFeedName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationFeedName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( (client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index b1ad49ac34f..ffdf6762df3 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} 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; @@ -226,9 +225,8 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() ), ]; - client.innerApiCalls.searchAllResources = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.searchAllResources = + stubSimpleCall(expectedResponse); const [response] = await client.searchAllResources(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -267,9 +265,8 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() ), ]; - client.innerApiCalls.searchAllResources = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchAllResources = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchAllResources( request, @@ -349,12 +346,12 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() ), ]; - client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.searchAllResources.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = []; + const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = + []; stream.on( 'data', ( @@ -378,10 +375,9 @@ describe('v1p1beta1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllResources, request) ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -398,13 +394,12 @@ describe('v1p1beta1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllResources.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = []; + const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = + []; stream.on( 'data', ( @@ -427,10 +422,9 @@ describe('v1p1beta1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllResources, request) ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -457,25 +451,25 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() ), ]; - client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; + client.descriptors.page.searchAllResources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = + []; const iterable = client.searchAllResourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -492,27 +486,26 @@ describe('v1p1beta1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllResources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.searchAllResourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; + const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllResources - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -548,9 +541,8 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.searchAllIamPolicies = + stubSimpleCall(expectedResponse); const [response] = await client.searchAllIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -589,9 +581,8 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchAllIamPolicies = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchAllIamPolicies( request, @@ -671,12 +662,12 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.searchAllIamPolicies.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = []; + const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = + []; stream.on( 'data', ( @@ -700,10 +691,9 @@ describe('v1p1beta1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -720,13 +710,12 @@ describe('v1p1beta1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllIamPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = []; + const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = + []; stream.on( 'data', ( @@ -749,10 +738,9 @@ describe('v1p1beta1.AssetServiceClient', () => { .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -779,25 +767,25 @@ describe('v1p1beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; + client.descriptors.page.searchAllIamPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = + []; const iterable = client.searchAllIamPoliciesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -814,27 +802,26 @@ describe('v1p1beta1.AssetServiceClient', () => { request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.searchAllIamPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.searchAllIamPoliciesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; + const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAllIamPolicies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index cff6c54b53c..2e391e2c83b 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -26,10 +26,9 @@ import * as assetserviceModule from '../src'; import {protobuf} 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; @@ -186,9 +185,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); - client.innerApiCalls.createFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createFeed( request, @@ -298,9 +296,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); - client.innerApiCalls.getFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getFeed( request, @@ -407,9 +404,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() ); - client.innerApiCalls.listFeeds = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listFeeds = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listFeeds( request, @@ -518,9 +514,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); - client.innerApiCalls.updateFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateFeed( request, @@ -631,9 +626,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteFeed = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteFeed = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteFeed( request, @@ -765,17 +759,18 @@ describe('v1p2beta1.AssetServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.organizationFeedPathTemplate - .render as SinonStub) + ( + client.pathTemplates.organizationFeedPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchOrganizationFromOrganizationFeedName', () => { - const result = client.matchOrganizationFromOrganizationFeedName( - fakePath - ); + const result = + client.matchOrganizationFromOrganizationFeedName(fakePath); assert.strictEqual(result, 'organizationValue'); assert( (client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index 4b48aa3472c..a61c35005b6 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts @@ -26,10 +26,9 @@ import * as assetserviceModule from '../src'; 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; @@ -220,9 +219,8 @@ describe('v1p4beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse() ); - client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.analyzeIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.analyzeIamPolicy( request, @@ -303,9 +301,8 @@ describe('v1p4beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.exportIamPolicyAnalysis = + stubLongRunningCall(expectedResponse); const [operation] = await client.exportIamPolicyAnalysis(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -338,9 +335,8 @@ describe('v1p4beta1.AssetServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.exportIamPolicyAnalysis = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.exportIamPolicyAnalysis = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.exportIamPolicyAnalysis( request, @@ -455,9 +451,10 @@ describe('v1p4beta1.AssetServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportIamPolicyAnalysisProgress( - expectedResponse.name - ); + const decodedOperation = + await client.checkExportIamPolicyAnalysisProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 3c610630345..afba2ecd1bb 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} 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; @@ -253,9 +252,8 @@ describe('v1p5beta1.AssetServiceClient', () => { generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), ]; - client.innerApiCalls.listAssets = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listAssets( request, @@ -327,9 +325,8 @@ describe('v1p5beta1.AssetServiceClient', () => { generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), ]; - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listAssetsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.asset.v1p5beta1.Asset[] = []; @@ -423,9 +420,8 @@ describe('v1p5beta1.AssetServiceClient', () => { generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), ]; - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.asset.v1p5beta1.IAsset[] = []; const iterable = client.listAssetsAsync(request); for await (const resource of iterable) { From 364f19d0c950d44d3248485b90a5ccf2bed44279 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 315/429] fix: use require() to load JSON protos (#484) 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 --- .../src/v1/asset_service_client.ts | 26 +++---------------- .../src/v1p1beta1/asset_service_client.ts | 18 ++----------- .../src/v1p2beta1/asset_service_client.ts | 18 ++----------- .../src/v1p4beta1/asset_service_client.ts | 24 +++-------------- .../src/v1p5beta1/asset_service_client.ts | 18 ++----------- 5 files changed, 13 insertions(+), 91 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index e79c94cac94..521bfe052e2 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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/v1/asset_service_client_config.json`. @@ -147,22 +148,7 @@ export class AssetServiceClient { 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. @@ -195,15 +181,11 @@ export class AssetServiceClient { ), }; + 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({ diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index b409b71d051..0e04ae318e7 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -31,6 +31,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/v1p1beta1/asset_service_client_config.json`. @@ -144,22 +145,7 @@ export class AssetServiceClient { 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); // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 17a6b355472..ed52fd1bd1c 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1p2beta1/asset_service_client_config.json`. @@ -136,22 +137,7 @@ export class AssetServiceClient { 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. diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 1cfe587e733..fc8a9ef2e79 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -28,6 +28,7 @@ import { import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1p4beta1/asset_service_client_config.json`. @@ -142,32 +143,13 @@ export class AssetServiceClient { 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. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - 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 - ); + 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({ diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index b7f5150806e..ea42d8335dd 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -31,6 +31,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/v1p5beta1/asset_service_client_config.json`. @@ -144,22 +145,7 @@ export class AssetServiceClient { 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); // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent From 273f40332786d84de02502e8c86b9bdef96bf31d 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:26 +0000 Subject: [PATCH 316/429] chore: update gapic-generator-typescript to v1.3.2 (#485) 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 --- packages/google-cloud-asset/src/v1/asset_service_client.ts | 1 - .../google-cloud-asset/src/v1p1beta1/asset_service_client.ts | 1 - .../google-cloud-asset/src/v1p2beta1/asset_service_client.ts | 1 - .../google-cloud-asset/src/v1p4beta1/asset_service_client.ts | 1 - .../google-cloud-asset/src/v1p5beta1/asset_service_client.ts | 1 - 5 files changed, 5 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 521bfe052e2..df3cfad4fbe 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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'; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 0e04ae318e7..3bf4d360769 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index ed52fd1bd1c..bc72a283da7 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -19,7 +19,6 @@ /* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index fc8a9ef2e79..69526ea97fc 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -25,7 +25,6 @@ import { ClientOptions, LROperation, } from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index ea42d8335dd..c2717671446 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -26,7 +26,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 30b2803e7b50380fede0bb71d8eb9aa6dfb196d1 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:35:31 -0700 Subject: [PATCH 317/429] chore: release 3.12.1 (#482) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 8 ++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 48857ff333a..d026b06ce0d 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.12.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.12.0...v3.12.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#481](https://www.github.com/googleapis/nodejs-asset/issues/481)) ([f6f890f](https://www.github.com/googleapis/nodejs-asset/commit/f6f890fa49a68b0b67556af8dae0ef9d52c43e34)) +* use require() to load JSON protos ([#484](https://www.github.com/googleapis/nodejs-asset/issues/484)) ([1aa6fa9](https://www.github.com/googleapis/nodejs-asset/commit/1aa6fa96540f94bd51784357186db87b080fdfe5)) + ## [3.12.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.11.0...v3.12.0) (2021-02-09) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index e6a93e3f520..138e7e05f6a 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.12.0", + "version": "3.12.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index b3d78c52bea..cf690ed9ac0 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.12.0", + "@google-cloud/asset": "^3.12.1", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From b1b3436f27daa50f65f496b4b34e56cb27380b96 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 20:30:28 +0000 Subject: [PATCH 318/429] chore: new owl bot post processor docker image (#488) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f4734af778c3d0eb58a6db0078907a87f2e53f3c7a6422363fc37ee52e02b25a --- packages/google-cloud-asset/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 70a24905289..6eabddb7492 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -16,21 +16,21 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1p1beta1 from './v1p1beta1'; import * as v1p4beta1 from './v1p4beta1'; import * as v1p5beta1 from './v1p5beta1'; import * as v1p2beta1 from './v1p2beta1'; +import * as v1p1beta1 from './v1p1beta1'; import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; type AssetServiceClient = v1.AssetServiceClient; -export {v1p1beta1, v1p4beta1, v1p5beta1, v1p2beta1, v1, AssetServiceClient}; +export {v1p4beta1, v1p5beta1, v1p2beta1, v1p1beta1, v1, AssetServiceClient}; export default { - v1p1beta1, v1p4beta1, v1p5beta1, v1p2beta1, + v1p1beta1, v1, AssetServiceClient, }; From 7db790a283354c734b590bc179753baa2bb458a9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:04:10 +0200 Subject: [PATCH 319/429] chore(deps): update dependency @types/node to v14 (#489) 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) | [`^13.9.3` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/13.13.52/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/13.13.52)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/13.13.52)](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, 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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 138e7e05f6a..c363ae823f2 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^13.9.3", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", From 21e39c6c53c480cb0e88f2db4154ce9a908e071c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:56:37 +0200 Subject: [PATCH 320/429] chore(deps): update dependency sinon to v11 (#490) 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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c363ae823f2..32f960d09a6 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -62,7 +62,7 @@ "mocha": "^8.0.0", "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.8.3", "webpack": "^5.0.0", From b351e263dbf910cb2c5cc3002cc5bdba67107fe1 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:34 +0000 Subject: [PATCH 321/429] fix: GoogleAdsError missing using generator version after 1.3.0 (#492) [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 --- .../google/cloud/asset/v1/asset_service.proto | 201 ++- .../protos/google/cloud/asset/v1/assets.proto | 163 +- .../google-cloud-asset/protos/protos.d.ts | 497 ++++++ packages/google-cloud-asset/protos/protos.js | 1480 ++++++++++++++++- .../google-cloud-asset/protos/protos.json | 145 ++ .../src/v1/asset_service_client.ts | 564 ++++++- .../src/v1/asset_service_client_config.json | 5 + .../src/v1/asset_service_proto_list.json | 8 +- .../src/v1/gapic_metadata.json | 14 + .../src/v1p1beta1/asset_service_client.ts | 2 + .../src/v1p2beta1/asset_service_client.ts | 2 + .../src/v1p4beta1/asset_service_client.ts | 2 + .../src/v1p5beta1/asset_service_client.ts | 2 + .../v1p5beta1/asset_service_proto_list.json | 7 +- .../test/gapic_asset_service_v1.ts | 279 ++++ 15 files changed, 3182 insertions(+), 189 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index d7d22fee960..eadaef285c0 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.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. @@ -25,6 +25,7 @@ import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/type/expr.proto"; @@ -61,6 +62,15 @@ service AssetService { }; } + // Lists assets with time and resource types and returns paged results in + // response. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } + // Batch gets the update history of assets that overlap a time window. // For IAM_POLICY content, this API outputs history when the asset and its // attached IAM POLICY both exist. This can create gaps in the output history. @@ -234,6 +244,74 @@ message ExportAssetsResponse { OutputResult output_result = 3; } +// ListAssets request. +message ListAssetsRequest { + // Required. Name of the organization or project the assets belong to. Format: + // "organizations/[organization-number]" (such as "organizations/123"), + // "projects/[project-id]" (such as "projects/my-project-id"), or + // "projects/[project-number]" (such as "projects/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expression is also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will + // be returned. + ContentType content_type = 4; + + // The maximum number of assets to be returned in a single response. Default + // is 100, minimum is 1, and maximum is 1000. + int32 page_size = 5; + + // The `next_page_token` returned from the previous `ListAssetsResponse`, or + // unspecified for the first `ListAssetsRequest`. It is a continuation of a + // prior `ListAssets` call, and the API should return the next page of assets. + string page_token = 6; +} + +// ListAssets response. +message ListAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Assets. + repeated Asset assets = 2; + + // Token to retrieve the next page of results. It expires 72 hours after the + // page token for the first page is generated. Set to empty if there are no + // remaining results. + string next_page_token = 3; +} + // Batch get assets history request. message BatchGetAssetsHistoryRequest { // Required. The relative name of the root asset. It can only be an @@ -388,6 +466,10 @@ message GcsDestination { // Editing Object // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. + // + // If the specified Cloud Storage object already exists and there is no + // [hold](https://cloud.google.com/storage/docs/object-holds), it will be + // overwritten with the exported result. string uri = 1; // The uri prefix of all generated Cloud Storage objects. Example: @@ -586,7 +668,7 @@ message Feed { message SearchAllResourcesRequest { // Required. A scope can be a project, a folder, or an organization. The search is // limited to the resources within the `scope`. The caller must be granted the - // [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // // The allowed values are: @@ -598,36 +680,41 @@ message SearchAllResourcesRequest { string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The query statement. See [how to construct a - // query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + // query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) // for more information. If not specified or empty, it will search all the - // resources within the specified `scope`. Note that the query string is - // compared against each Cloud IAM policy binding, including its members, - // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only - // contain the bindings that match your query. To learn more about the IAM - // policy structure, see [IAM policy - // doc](https://cloud.google.com/iam/docs/policies#structure). + // resources within the specified `scope`. // // Examples: // // * `name:Important` to find Cloud resources whose name contains // "Important" as a word. + // * `name=Important` to find the Cloud resource whose name is exactly + // "Important". // * `displayName:Impor*` to find Cloud resources whose display name - // contains "Impor" as a prefix. - // * `description:*por*` to find Cloud resources whose description - // contains "por" as a substring. - // * `location:us-west*` to find Cloud resources whose location is - // prefixed with "us-west". + // contains "Impor" as a prefix of any word in the field. + // * `location:us-west*` to find Cloud resources whose location contains both + // "us" and "west" as prefixes. // * `labels:prod` to find Cloud resources whose labels contain "prod" as // a key or value. // * `labels.env:prod` to find Cloud resources that have a label "env" // and its value is "prod". // * `labels.env:*` to find Cloud resources that have a label "env". + // * `kmsKey:key` to find Cloud resources encrypted with a customer-managed + // encryption key whose name contains the word "key". + // * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a + // word. + // * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state + // doesn't contain "ACTIVE" as a word. + // * `createTime<1609459200` to find Cloud resources that were created before + // "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + // "2021-01-01 00:00:00 UTC" in seconds. + // * `updateTime>1609459200` to find Cloud resources that were updated after + // "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + // "2021-01-01 00:00:00 UTC" in seconds. // * `Important` to find Cloud resources that contain "Important" as a word // in any of the searchable fields. - // * `Impor*` to find Cloud resources that contain "Impor" as a prefix - // in any of the searchable fields. - // * `*por*` to find Cloud resources that contain "por" as a substring in - // any of the searchable fields. + // * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any + // word in any of the searchable fields. // * `Important location:(us-west1 OR global)` to find Cloud // resources that contain "Important" as a word in any of the searchable // fields and are also located in the "us-west1" region or the "global" @@ -637,6 +724,17 @@ message SearchAllResourcesRequest { // Optional. A list of asset types that this request searches for. If empty, it will // search all the [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The page size for search result pagination. Page size is capped at 500 even @@ -651,12 +749,24 @@ message SearchAllResourcesRequest { // identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma separated list of fields specifying the sorting order of the + // Optional. A comma-separated list of fields specifying the sorting order of the // results. The default order is ascending. Add " DESC" after the field name // to indicate descending order. Redundant space characters are ignored. - // Example: "location DESC, name". Only string fields in the response are - // sortable, including `name`, `displayName`, `description`, `location`. All - // the other fields such as repeated fields (e.g., `networkTags`), map + // Example: "location DESC, name". + // Only singular primitive fields in the response are sortable: + // * name + // * assetType + // * project + // * displayName + // * description + // * location + // * kmsKey + // * createTime + // * updateTime + // * state + // * parentFullResourceName + // * parentAssetType + // All the other fields such as repeated fields (e.g., `networkTags`), map // fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) // are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; @@ -679,7 +789,7 @@ message SearchAllIamPoliciesRequest { // Required. A scope can be a project, a folder, or an organization. The search is // limited to the IAM policies within the `scope`. The caller must be granted // the - // [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // // The allowed values are: @@ -693,7 +803,12 @@ message SearchAllIamPoliciesRequest { // Optional. The query statement. See [how to construct a // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) // for more information. If not specified or empty, it will search all the - // IAM policies within the specified `scope`. + // IAM policies within the specified `scope`. Note that the query string is + // compared against each Cloud IAM policy binding, including its members, + // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + // contain the bindings that match your query. To learn more about the IAM + // policy structure, see [IAM policy + // doc](https://cloud.google.com/iam/docs/policies#structure). // // Examples: // @@ -701,18 +816,25 @@ message SearchAllIamPoliciesRequest { // "amy@gmail.com". // * `policy:roles/compute.admin` to find IAM policy bindings that specify // the Compute Admin role. + // * `policy:comp*` to find IAM policy bindings that contain "comp" as a + // prefix of any word in the binding. // * `policy.role.permissions:storage.buckets.update` to find IAM policy // bindings that specify a role containing "storage.buckets.update" // permission. Note that if callers don't have `iam.roles.get` access to a // role's included permissions, policy bindings that specify this role will // be dropped from the search results. + // * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + // role containing "upd" as a prefix of any word in the role permission. + // Note that if callers don't have `iam.roles.get` access to a role's + // included permissions, policy bindings that specify this role will be + // dropped from the search results. // * `resource:organizations/123456` to find IAM policy bindings // that are set on "organizations/123456". + // * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + // find IAM policy bindings that are set on the project named "myproject". // * `Important` to find IAM policy bindings that contain "Important" as a // word in any of the searchable fields (except for the included // permissions). - // * `*por*` to find IAM policy bindings that contain "por" as a substring - // in any of the searchable fields (except for the included permissions). // * `resource:(instance1 OR instance2) policy:amy` to find // IAM policy bindings that are set on resources "instance1" or // "instance2" and also specify user "amy". @@ -743,7 +865,7 @@ message SearchAllIamPoliciesResponse { string next_page_token = 2; } -// IAM policy analysis query message. +// ## IAM policy analysis query message. message IamPolicyAnalysisQuery { // Specifies the resource to analyze for access policies, which may be set // directly on the resource, or on ancestors such as organizations, folders or @@ -869,6 +991,17 @@ message IamPolicyAnalysisQuery { bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; } + // The IAM conditions context. + message ConditionContext { + // The IAM conditions time context. + oneof TimeContext { + // The hypothetical access timestamp to evaluate IAM conditions. Note that + // this value must not be earlier than the current time; otherwise, an + // INVALID_ARGUMENT error will be returned. + google.protobuf.Timestamp access_time = 1; + } + } + // Required. The relative name of the root asset. Only resources and IAM policies within // the scope will be analyzed. // @@ -894,6 +1027,9 @@ message IamPolicyAnalysisQuery { // Optional. The query options. Options options = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The hypothetical context for IAM conditions evaluation. + ConditionContext condition_context = 6 [(google.api.field_behavior) = OPTIONAL]; } // A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. @@ -952,9 +1088,14 @@ message IamPolicyAnalysisOutputConfig { // A Cloud Storage location. message GcsDestination { // Required. The uri of the Cloud Storage object. It's the same uri that is used by - // gsutil. For example: "gs://bucket_name/object_name". See - // [Quickstart: Using the gsutil tool] - // (https://cloud.google.com/storage/docs/quickstart-gsutil) for examples. + // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + // + // If the specified Cloud Storage object already exists and there is no + // [hold](https://cloud.google.com/storage/docs/object-holds), it will be + // overwritten with the analysis result. string uri = 1 [(google.api.field_behavior) = REQUIRED]; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index f7e2432fcc7..572ed739a63 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.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. @@ -89,7 +89,8 @@ message TimeWindow { // [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as Google -// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). +// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy), +// or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship). // See [Supported asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) // for more information. @@ -242,14 +243,40 @@ message ResourceSearchResult { string asset_type = 2; // The project that this resource belongs to, in the form of - // projects/{PROJECT_NUMBER}. + // projects/{PROJECT_NUMBER}. This field is available when the resource + // belongs to a project. // - // To search against the `project`: + // To search against `project`: // + // * use a field query. Example: `project:12345` + // * use a free text query. Example: `12345` // * specify the `scope` field as this project in your search request. string project = 3; - // The display name of this resource. + // The folder(s) that this resource belongs to, in the form of + // folders/{FOLDER_NUMBER}. This field is available when the resource + // belongs to one or more folders. + // + // To search against `folders`: + // + // * use a field query. Example: `folders:(123 OR 456)` + // * use a free text query. Example: `123` + // * specify the `scope` field as this folder in your search request. + repeated string folders = 17; + + // The organization that this resource belongs to, in the form of + // organizations/{ORGANIZATION_NUMBER}. This field is available when the + // resource belongs to an organization. + // + // To search against `organization`: + // + // * use a field query. Example: `organization:123` + // * use a free text query. Example: `123` + // * specify the `scope` field as this organization in your search request. + string organization = 18; + + // The display name of this resource. This field is available only when the + // resource's proto contains it. // // To search against the `display_name`: // @@ -258,16 +285,18 @@ message ResourceSearchResult { string display_name = 4; // One or more paragraphs of text description of this resource. Maximum length - // could be up to 1M bytes. + // could be up to 1M bytes. This field is available only when the resource's + // proto contains it. // // To search against the `description`: // - // * use a field query. Example: `description:"*important instance*"` - // * use a free text query. Example: `"*important instance*"` + // * use a field query. Example: `description:"important instance"` + // * use a free text query. Example: `"important instance"` string description = 5; // Location can be `global`, regional like `us-east1`, or zonal like - // `us-west1-b`. + // `us-west1-b`. This field is available only when the resource's proto + // contains it. // // To search against the `location`: // @@ -277,7 +306,8 @@ message ResourceSearchResult { // Labels associated with this resource. See [Labelling and grouping GCP // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) - // for more information. + // for more information. This field is available only when the resource's + // proto contains it. // // To search against the `labels`: // @@ -291,7 +321,8 @@ message ResourceSearchResult { // Network tags associated with this resource. Like labels, network tags are a // type of annotations used to group GCP resources. See [Labelling GCP // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) - // for more information. + // for more information. This field is available only when the resource's + // proto contains it. // // To search against the `network_tags`: // @@ -299,6 +330,66 @@ message ResourceSearchResult { // * use a free text query. Example: `internal` repeated string network_tags = 8; + // The Cloud KMS + // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys?hl=en) + // name or + // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) + // name. This field is available only when the resource's proto contains it. + // + // To search against the `kms_key`: + // + // * use a field query. Example: `kmsKey:key` + // * use a free text query. Example: `key` + string kms_key = 10; + + // The create timestamp of this resource, at which the resource was created. + // The granularity is in seconds. Timestamp.nanos will always be 0. This field + // is available only when the resource's proto contains it. + // + // To search against `create_time`: + // + // * use a field query. + // - value in seconds since unix epoch. Example: `createTime > 1609459200` + // - value in date string. Example: `createTime > 2021-01-01` + // - value in date-time string (must be quoted). Example: `createTime > + // "2021-01-01T00:00:00"` + google.protobuf.Timestamp create_time = 11; + + // The last update timestamp of this resource, at which the resource was last + // modified or deleted. The granularity is in seconds. Timestamp.nanos will + // always be 0. This field is available only when the resource's proto + // contains it. + // + // To search against `update_time`: + // + // * use a field query. + // - value in seconds since unix epoch. Example: `updateTime < 1609459200` + // - value in date string. Example: `updateTime < 2021-01-01` + // - value in date-time string (must be quoted). Example: `updateTime < + // "2021-01-01T00:00:00"` + google.protobuf.Timestamp update_time = 12; + + // The state of this resource. Different resources types have different state + // definitions that are mapped from various fields of different resource + // types. This field is available only when the resource's proto contains it. + // + // Example: + // If the resource is an instance provided by Compute Engine, + // its state will include PROVISIONING, STAGING, RUNNING, STOPPING, + // SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition + // in [API + // Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + // If the resource is a project provided by Cloud Resource Manager, its state + // will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and + // DELETE_IN_PROGRESS. See `lifecycleState` definition in [API + // Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). + // + // To search against the `state`: + // + // * use a field query. Example: `state:RUNNING` + // * use a free text query. Example: `RUNNING` + string state = 13; + // The additional searchable attributes of this resource. The attributes may // vary from one resource type to another. Examples: `projectId` for Project, // `dnsName` for DNS ManagedZone. This field contains a subset of the resource @@ -306,7 +397,7 @@ message ResourceSearchResult { // corresponding GCP service (e.g., Compute Engine). see [API references and // supported searchable // attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) - // for more information. + // to see which fields are included. // // You can search values of these fields through free text search. However, // you should not consume the field programically as the field names and @@ -319,6 +410,25 @@ message ResourceSearchResult { // `additional_attributes = { dnsName: "foobar" }`, you can issue a query // `foobar`. google.protobuf.Struct additional_attributes = 9; + + // The full resource name of this resource's parent, if it has one. + // To search against the `parent_full_resource_name`: + // + // * use a field query. Example: + // `parentFullResourceName:"project-name"` + // * use a free text query. Example: + // `project-name` + string parent_full_resource_name = 19; + + // The type of this resource's immediate parent, if there is one. + // + // To search against the `parent_asset_type`: + // + // * use a field query. Example: + // `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` + // * use a free text query. Example: + // `cloudresourcemanager.googleapis.com/Project` + string parent_asset_type = 103; } // A result of IAM Policy search, containing information of an IAM policy. @@ -357,7 +467,7 @@ message IamPolicySearchResult { // projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM // instance, Cloud Storage bucket), the project field will indicate the // project that contains the resource. If an IAM policy is set on a folder or - // orgnization, the project field will be empty. + // orgnization, this field will be empty. // // To search against the `project`: // @@ -400,6 +510,29 @@ message IamPolicyAnalysisState { string cause = 2; } +// The Condition evaluation. +message ConditionEvaluation { + // Value of this expression. + enum EvaluationValue { + // Reserved for future use. + EVALUATION_VALUE_UNSPECIFIED = 0; + + // The evaluation result is `true`. + TRUE = 1; + + // The evaluation result is `false`. + FALSE = 2; + + // The evaluation result is `conditional` when the condition expression + // contains variables that are either missing input values or have not been + // supported by Analyzer yet. + CONDITIONAL = 3; + } + + // The evaluation result. + EvaluationValue evaluation_value = 1; +} + // IAM Policy analysis result, consisting of one IAM policy binding and derived // access control lists. message IamPolicyAnalysisResult { @@ -489,6 +622,10 @@ message IamPolicyAnalysisResult { // contains the full resource name of a child resource. This field is // present only if the output_resource_edges option is enabled in request. repeated Edge resource_edges = 3; + + // Condition evaluation for this AccessControlList, if there is a condition + // defined in the above IAM policy binding. + ConditionEvaluation condition_evaluation = 4; } // The identities and group edges. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 1805359ec45..e7d67db7556 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -60,6 +60,20 @@ export namespace google { */ public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.asset.v1.IListAssetsRequest, callback: google.cloud.asset.v1.AssetService.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.asset.v1.IListAssetsRequest): Promise; + /** * Calls BatchGetAssetsHistory. * @param request BatchGetAssetsHistoryRequest message or plain object @@ -210,6 +224,13 @@ export namespace google { */ type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListAssetsResponse) => void; + /** * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. * @param error Error, if any @@ -497,6 +518,228 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ListAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ListAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IListAssetsRequest): google.cloud.asset.v1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @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.asset.v1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @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.asset.v1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets */ + assets?: (google.cloud.asset.v1.IAsset[]|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListAssetsResponse); + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets. */ + public assets: google.cloud.asset.v1.IAsset[]; + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IListAssetsResponse): google.cloud.asset.v1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @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.asset.v1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @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.asset.v1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a BatchGetAssetsHistoryRequest. */ interface IBatchGetAssetsHistoryRequest { @@ -2588,6 +2831,9 @@ export namespace google { /** IamPolicyAnalysisQuery options */ options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); + + /** IamPolicyAnalysisQuery conditionContext */ + conditionContext?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null); } /** Represents an IamPolicyAnalysisQuery. */ @@ -2614,6 +2860,9 @@ export namespace google { /** IamPolicyAnalysisQuery options. */ public options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); + /** IamPolicyAnalysisQuery conditionContext. */ + public conditionContext?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null); + /** * Creates a new IamPolicyAnalysisQuery instance using the specified properties. * @param [properties] Properties to set @@ -3082,6 +3331,99 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a ConditionContext. */ + interface IConditionContext { + + /** ConditionContext accessTime */ + accessTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ConditionContext. */ + class ConditionContext implements IConditionContext { + + /** + * Constructs a new ConditionContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext); + + /** ConditionContext accessTime. */ + public accessTime?: (google.protobuf.ITimestamp|null); + + /** ConditionContext TimeContext. */ + public TimeContext?: "accessTime"; + + /** + * Creates a new ConditionContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionContext instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext): google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Encodes the specified ConditionContext message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @param message ConditionContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionContext message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @param message ConditionContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionContext + * @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.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Decodes a ConditionContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionContext + * @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.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Verifies a ConditionContext 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 ConditionContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Creates a plain object from a ConditionContext message. Also converts values to other types if specified. + * @param message ConditionContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Properties of an AnalyzeIamPolicyRequest. */ @@ -4405,6 +4747,12 @@ export namespace google { /** ResourceSearchResult project */ project?: (string|null); + /** ResourceSearchResult folders */ + folders?: (string[]|null); + + /** ResourceSearchResult organization */ + organization?: (string|null); + /** ResourceSearchResult displayName */ displayName?: (string|null); @@ -4420,8 +4768,26 @@ export namespace google { /** ResourceSearchResult networkTags */ networkTags?: (string[]|null); + /** ResourceSearchResult kmsKey */ + kmsKey?: (string|null); + + /** ResourceSearchResult createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state */ + state?: (string|null); + /** ResourceSearchResult additionalAttributes */ additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName */ + parentFullResourceName?: (string|null); + + /** ResourceSearchResult parentAssetType */ + parentAssetType?: (string|null); } /** Represents a ResourceSearchResult. */ @@ -4442,6 +4808,12 @@ export namespace google { /** ResourceSearchResult project. */ public project: string; + /** ResourceSearchResult folders. */ + public folders: string[]; + + /** ResourceSearchResult organization. */ + public organization: string; + /** ResourceSearchResult displayName. */ public displayName: string; @@ -4457,9 +4829,27 @@ export namespace google { /** ResourceSearchResult networkTags. */ public networkTags: string[]; + /** ResourceSearchResult kmsKey. */ + public kmsKey: string; + + /** ResourceSearchResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state. */ + public state: string; + /** ResourceSearchResult additionalAttributes. */ public additionalAttributes?: (google.protobuf.IStruct|null); + /** ResourceSearchResult parentFullResourceName. */ + public parentFullResourceName: string; + + /** ResourceSearchResult parentAssetType. */ + public parentAssetType: string; + /** * Creates a new ResourceSearchResult instance using the specified properties. * @param [properties] Properties to set @@ -4921,6 +5311,107 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ConditionEvaluation. */ + interface IConditionEvaluation { + + /** ConditionEvaluation evaluationValue */ + evaluationValue?: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null); + } + + /** Represents a ConditionEvaluation. */ + class ConditionEvaluation implements IConditionEvaluation { + + /** + * Constructs a new ConditionEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IConditionEvaluation); + + /** ConditionEvaluation evaluationValue. */ + public evaluationValue: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue); + + /** + * Creates a new ConditionEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionEvaluation instance + */ + public static create(properties?: google.cloud.asset.v1.IConditionEvaluation): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionEvaluation + * @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.asset.v1.ConditionEvaluation; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionEvaluation + * @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.asset.v1.ConditionEvaluation; + + /** + * Verifies a ConditionEvaluation 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 ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. + * @param message ConditionEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ConditionEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ConditionEvaluation { + + /** EvaluationValue enum. */ + enum EvaluationValue { + EVALUATION_VALUE_UNSPECIFIED = 0, + TRUE = 1, + FALSE = 2, + CONDITIONAL = 3 + } + } + /** Properties of an IamPolicyAnalysisResult. */ interface IIamPolicyAnalysisResult { @@ -5441,6 +5932,9 @@ export namespace google { /** AccessControlList resourceEdges */ resourceEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); + + /** AccessControlList conditionEvaluation */ + conditionEvaluation?: (google.cloud.asset.v1.IConditionEvaluation|null); } /** Represents an AccessControlList. */ @@ -5461,6 +5955,9 @@ export namespace google { /** AccessControlList resourceEdges. */ public resourceEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; + /** AccessControlList conditionEvaluation. */ + public conditionEvaluation?: (google.cloud.asset.v1.IConditionEvaluation|null); + /** * Creates a new AccessControlList instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 948a7f075f3..89cf38adea5 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -131,6 +131,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.asset.v1.ListAssetsRequest, $root.google.cloud.asset.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. * @memberof google.cloud.asset.v1.AssetService @@ -865,52 +898,654 @@ /** * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputResult != null && Object.hasOwnProperty.call(message, "outputResult")) + $root.google.cloud.asset.v1.OutputResult.encode(message.outputResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.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.asset.v1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + case 3: + message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.outputResult != null && message.hasOwnProperty("outputResult")) { + var error = $root.google.cloud.asset.v1.OutputResult.verify(message.outputResult); + if (error) + return "outputResult." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); + } + if (object.outputResult != null) { + if (typeof object.outputResult !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputResult: object expected"); + message.outputResult = $root.google.cloud.asset.v1.OutputResult.fromObject(object.outputResult); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + object.outputResult = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.outputResult != null && message.hasOwnProperty("outputResult")) + object.outputResult = $root.google.cloud.asset.v1.OutputResult.toObject(message.outputResult, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAssetsResponse; + })(); + + v1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {Array.|null} [assetTypes] ListAssetsRequest assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] ListAssetsRequest contentType + * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @property {string|null} [pageToken] ListAssetsRequest pageToken + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ListAssetsRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.contentType = 0; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.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.asset.v1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 4: + message.contentType = reader.int32(); + break; + case 5: + message.pageSize = reader.int32(); + break; + case 6: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.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.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + break; + } + 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; + } + 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 ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssetsRequest; + })(); + + v1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IListAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {Array.|null} [assets] ListAssetsResponse assets + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.assets = $util.emptyArray; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static - * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encode = function encode(message, writer) { + ListAssetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.outputResult != null && Object.hasOwnProperty.call(message, "outputResult")) - $root.google.cloud.asset.v1.OutputResult.encode(message.outputResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.Asset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static - * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a ListAssetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decode = function decode(reader, length) { + ListAssetsResponse.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.asset.v1.ExportAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListAssetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -918,10 +1553,12 @@ message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32())); break; case 3: - message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -932,30 +1569,30 @@ }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsResponse message. + * Verifies a ListAssetsResponse message. * @function verify - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsResponse.verify = function verify(message) { + ListAssetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.readTime != null && message.hasOwnProperty("readTime")) { @@ -963,88 +1600,96 @@ if (error) return "readTime." + error; } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } - if (message.outputResult != null && message.hasOwnProperty("outputResult")) { - var error = $root.google.cloud.asset.v1.OutputResult.verify(message.outputResult); - if (error) - return "outputResult." + error; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.assets[i]); + if (error) + return "assets." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse */ - ExportAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.ExportAssetsResponse) + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListAssetsResponse) return object; - var message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); + var message = new $root.google.cloud.asset.v1.ListAssetsResponse(); if (object.readTime != null) { if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.readTime: object expected"); + throw TypeError(".google.cloud.asset.v1.ListAssetsResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); - } - if (object.outputResult != null) { - if (typeof object.outputResult !== "object") - throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputResult: object expected"); - message.outputResult = $root.google.cloud.asset.v1.OutputResult.fromObject(object.outputResult); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.ListAssetsResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListAssetsResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.Asset.fromObject(object.assets[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @static - * @param {google.cloud.asset.v1.ExportAssetsResponse} message ExportAssetsResponse + * @param {google.cloud.asset.v1.ListAssetsResponse} message ListAssetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsResponse.toObject = function toObject(message, options) { + ListAssetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assets = []; if (options.defaults) { object.readTime = null; - object.outputConfig = null; - object.outputResult = null; + object.nextPageToken = ""; } if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); - if (message.outputResult != null && message.hasOwnProperty("outputResult")) - object.outputResult = $root.google.cloud.asset.v1.OutputResult.toObject(message.outputResult, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.Asset.toObject(message.assets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this ListAssetsResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @memberof google.cloud.asset.v1.ListAssetsResponse * @instance * @returns {Object.} JSON object */ - ExportAssetsResponse.prototype.toJSON = function toJSON() { + ListAssetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsResponse; + return ListAssetsResponse; })(); v1.BatchGetAssetsHistoryRequest = (function() { @@ -5999,6 +6644,7 @@ * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null} [options] IamPolicyAnalysisQuery options + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null} [conditionContext] IamPolicyAnalysisQuery conditionContext */ /** @@ -6056,6 +6702,14 @@ */ IamPolicyAnalysisQuery.prototype.options = null; + /** + * IamPolicyAnalysisQuery conditionContext. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null|undefined} conditionContext + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.conditionContext = null; + /** * Creates a new IamPolicyAnalysisQuery instance using the specified properties. * @function create @@ -6090,6 +6744,8 @@ $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.encode(message.options, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.conditionContext != null && Object.hasOwnProperty.call(message, "conditionContext")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.encode(message.conditionContext, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -6139,6 +6795,9 @@ case 5: message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); break; + case 6: + message.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -6197,6 +6856,11 @@ if (error) return "options." + error; } + if (message.conditionContext != null && message.hasOwnProperty("conditionContext")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify(message.conditionContext); + if (error) + return "conditionContext." + error; + } return null; }; @@ -6234,6 +6898,11 @@ throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.options: object expected"); message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.fromObject(object.options); } + if (object.conditionContext != null) { + if (typeof object.conditionContext !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.conditionContext: object expected"); + message.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.fromObject(object.conditionContext); + } return message; }; @@ -6256,6 +6925,7 @@ object.identitySelector = null; object.accessSelector = null; object.options = null; + object.conditionContext = null; } if (message.scope != null && message.hasOwnProperty("scope")) object.scope = message.scope; @@ -6267,6 +6937,8 @@ object.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.toObject(message.options, options); + if (message.conditionContext != null && message.hasOwnProperty("conditionContext")) + object.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.toObject(message.conditionContext, options); return object; }; @@ -7182,17 +7854,228 @@ }; /** - * Converts this Options to JSON. + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + IamPolicyAnalysisQuery.ConditionContext = (function() { + + /** + * Properties of a ConditionContext. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IConditionContext + * @property {google.protobuf.ITimestamp|null} [accessTime] ConditionContext accessTime + */ + + /** + * Constructs a new ConditionContext. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents a ConditionContext. + * @implements IConditionContext + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext=} [properties] Properties to set + */ + function ConditionContext(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]]; + } + + /** + * ConditionContext accessTime. + * @member {google.protobuf.ITimestamp|null|undefined} accessTime + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @instance + */ + ConditionContext.prototype.accessTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConditionContext TimeContext. + * @member {"accessTime"|undefined} TimeContext + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @instance + */ + Object.defineProperty(ConditionContext.prototype, "TimeContext", { + get: $util.oneOfGetter($oneOfFields = ["accessTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConditionContext instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext instance + */ + ConditionContext.create = function create(properties) { + return new ConditionContext(properties); + }; + + /** + * Encodes the specified ConditionContext message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext} message ConditionContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessTime != null && Object.hasOwnProperty.call(message, "accessTime")) + $root.google.protobuf.Timestamp.encode(message.accessTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionContext message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext} message ConditionContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionContext.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.asset.v1.IamPolicyAnalysisQuery.ConditionContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accessTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionContext message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessTime != null && message.hasOwnProperty("accessTime")) { + properties.TimeContext = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.accessTime); + if (error) + return "accessTime." + error; + } + } + return null; + }; + + /** + * Creates a ConditionContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext + */ + ConditionContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext(); + if (object.accessTime != null) { + if (typeof object.accessTime !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.accessTime: object expected"); + message.accessTime = $root.google.protobuf.Timestamp.fromObject(object.accessTime); + } + return message; + }; + + /** + * Creates a plain object from a ConditionContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} message ConditionContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.accessTime != null && message.hasOwnProperty("accessTime")) { + object.accessTime = $root.google.protobuf.Timestamp.toObject(message.accessTime, options); + if (options.oneofs) + object.TimeContext = "accessTime"; + } + return object; + }; + + /** + * Converts this ConditionContext to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext * @instance * @returns {Object.} JSON object */ - Options.prototype.toJSON = function toJSON() { + ConditionContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Options; + return ConditionContext; })(); return IamPolicyAnalysisQuery; @@ -10504,12 +11387,20 @@ * @property {string|null} [name] ResourceSearchResult name * @property {string|null} [assetType] ResourceSearchResult assetType * @property {string|null} [project] ResourceSearchResult project + * @property {Array.|null} [folders] ResourceSearchResult folders + * @property {string|null} [organization] ResourceSearchResult organization * @property {string|null} [displayName] ResourceSearchResult displayName * @property {string|null} [description] ResourceSearchResult description * @property {string|null} [location] ResourceSearchResult location * @property {Object.|null} [labels] ResourceSearchResult labels * @property {Array.|null} [networkTags] ResourceSearchResult networkTags + * @property {string|null} [kmsKey] ResourceSearchResult kmsKey + * @property {google.protobuf.ITimestamp|null} [createTime] ResourceSearchResult createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceSearchResult updateTime + * @property {string|null} [state] ResourceSearchResult state * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes + * @property {string|null} [parentFullResourceName] ResourceSearchResult parentFullResourceName + * @property {string|null} [parentAssetType] ResourceSearchResult parentAssetType */ /** @@ -10521,6 +11412,7 @@ * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set */ function ResourceSearchResult(properties) { + this.folders = []; this.labels = {}; this.networkTags = []; if (properties) @@ -10553,6 +11445,22 @@ */ ResourceSearchResult.prototype.project = ""; + /** + * ResourceSearchResult folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.folders = $util.emptyArray; + + /** + * ResourceSearchResult organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.organization = ""; + /** * ResourceSearchResult displayName. * @member {string} displayName @@ -10593,6 +11501,38 @@ */ ResourceSearchResult.prototype.networkTags = $util.emptyArray; + /** + * ResourceSearchResult kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.kmsKey = ""; + + /** + * ResourceSearchResult createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.createTime = null; + + /** + * ResourceSearchResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.updateTime = null; + + /** + * ResourceSearchResult state. + * @member {string} state + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.state = ""; + /** * ResourceSearchResult additionalAttributes. * @member {google.protobuf.IStruct|null|undefined} additionalAttributes @@ -10601,6 +11541,22 @@ */ ResourceSearchResult.prototype.additionalAttributes = null; + /** + * ResourceSearchResult parentFullResourceName. + * @member {string} parentFullResourceName + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.parentFullResourceName = ""; + + /** + * ResourceSearchResult parentAssetType. + * @member {string} parentAssetType + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.parentAssetType = ""; + /** * Creates a new ResourceSearchResult instance using the specified properties. * @function create @@ -10645,6 +11601,23 @@ writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKey); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.state); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.organization); + if (message.parentFullResourceName != null && Object.hasOwnProperty.call(message, "parentFullResourceName")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.parentFullResourceName); + if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); return writer; }; @@ -10688,6 +11661,14 @@ case 3: message.project = reader.string(); break; + case 17: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + case 18: + message.organization = reader.string(); + break; case 4: message.displayName = reader.string(); break; @@ -10724,9 +11705,27 @@ message.networkTags = []; message.networkTags.push(reader.string()); break; + case 10: + message.kmsKey = reader.string(); + break; + case 11: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 13: + message.state = reader.string(); + break; case 9: message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; + case 19: + message.parentFullResourceName = reader.string(); + break; + case 103: + message.parentAssetType = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -10771,6 +11770,16 @@ if (message.project != null && message.hasOwnProperty("project")) if (!$util.isString(message.project)) return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; @@ -10795,11 +11804,33 @@ if (!$util.isString(message.networkTags[i])) return "networkTags: string[] expected"; } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); if (error) return "additionalAttributes." + error; } + if (message.parentFullResourceName != null && message.hasOwnProperty("parentFullResourceName")) + if (!$util.isString(message.parentFullResourceName)) + return "parentFullResourceName: string expected"; + if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) + if (!$util.isString(message.parentAssetType)) + return "parentAssetType: string expected"; return null; }; @@ -10821,6 +11852,15 @@ message.assetType = String(object.assetType); if (object.project != null) message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); if (object.displayName != null) message.displayName = String(object.displayName); if (object.description != null) @@ -10841,11 +11881,29 @@ for (var i = 0; i < object.networkTags.length; ++i) message.networkTags[i] = String(object.networkTags[i]); } + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.state != null) + message.state = String(object.state); if (object.additionalAttributes != null) { if (typeof object.additionalAttributes !== "object") throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); } + if (object.parentFullResourceName != null) + message.parentFullResourceName = String(object.parentFullResourceName); + if (object.parentAssetType != null) + message.parentAssetType = String(object.parentAssetType); return message; }; @@ -10862,8 +11920,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.networkTags = []; + object.folders = []; + } if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { @@ -10874,6 +11934,13 @@ object.description = ""; object.location = ""; object.additionalAttributes = null; + object.kmsKey = ""; + object.createTime = null; + object.updateTime = null; + object.state = ""; + object.organization = ""; + object.parentFullResourceName = ""; + object.parentAssetType = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -10900,6 +11967,25 @@ } if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.parentFullResourceName != null && message.hasOwnProperty("parentFullResourceName")) + object.parentFullResourceName = message.parentFullResourceName; + if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) + object.parentAssetType = message.parentAssetType; return object; }; @@ -11911,6 +12997,234 @@ return IamPolicyAnalysisState; })(); + v1.ConditionEvaluation = (function() { + + /** + * Properties of a ConditionEvaluation. + * @memberof google.cloud.asset.v1 + * @interface IConditionEvaluation + * @property {google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null} [evaluationValue] ConditionEvaluation evaluationValue + */ + + /** + * Constructs a new ConditionEvaluation. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ConditionEvaluation. + * @implements IConditionEvaluation + * @constructor + * @param {google.cloud.asset.v1.IConditionEvaluation=} [properties] Properties to set + */ + function ConditionEvaluation(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]]; + } + + /** + * ConditionEvaluation evaluationValue. + * @member {google.cloud.asset.v1.ConditionEvaluation.EvaluationValue} evaluationValue + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @instance + */ + ConditionEvaluation.prototype.evaluationValue = 0; + + /** + * Creates a new ConditionEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.IConditionEvaluation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation instance + */ + ConditionEvaluation.create = function create(properties) { + return new ConditionEvaluation(properties); + }; + + /** + * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.IConditionEvaluation} message ConditionEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionEvaluation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationValue != null && Object.hasOwnProperty.call(message, "evaluationValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluationValue); + return writer; + }; + + /** + * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.IConditionEvaluation} message ConditionEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionEvaluation.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.asset.v1.ConditionEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evaluationValue = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionEvaluation message. + * @function verify + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationValue != null && message.hasOwnProperty("evaluationValue")) + switch (message.evaluationValue) { + default: + return "evaluationValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation + */ + ConditionEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ConditionEvaluation) + return object; + var message = new $root.google.cloud.asset.v1.ConditionEvaluation(); + switch (object.evaluationValue) { + case "EVALUATION_VALUE_UNSPECIFIED": + case 0: + message.evaluationValue = 0; + break; + case "TRUE": + case 1: + message.evaluationValue = 1; + break; + case "FALSE": + case 2: + message.evaluationValue = 2; + break; + case "CONDITIONAL": + case 3: + message.evaluationValue = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.ConditionEvaluation} message ConditionEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluationValue = options.enums === String ? "EVALUATION_VALUE_UNSPECIFIED" : 0; + if (message.evaluationValue != null && message.hasOwnProperty("evaluationValue")) + object.evaluationValue = options.enums === String ? $root.google.cloud.asset.v1.ConditionEvaluation.EvaluationValue[message.evaluationValue] : message.evaluationValue; + return object; + }; + + /** + * Converts this ConditionEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @instance + * @returns {Object.} JSON object + */ + ConditionEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * EvaluationValue enum. + * @name google.cloud.asset.v1.ConditionEvaluation.EvaluationValue + * @enum {number} + * @property {number} EVALUATION_VALUE_UNSPECIFIED=0 EVALUATION_VALUE_UNSPECIFIED value + * @property {number} TRUE=1 TRUE value + * @property {number} FALSE=2 FALSE value + * @property {number} CONDITIONAL=3 CONDITIONAL value + */ + ConditionEvaluation.EvaluationValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRUE"] = 1; + values[valuesById[2] = "FALSE"] = 2; + values[valuesById[3] = "CONDITIONAL"] = 3; + return values; + })(); + + return ConditionEvaluation; + })(); + v1.IamPolicyAnalysisResult = (function() { /** @@ -13126,6 +14440,7 @@ * @property {Array.|null} [resources] AccessControlList resources * @property {Array.|null} [accesses] AccessControlList accesses * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges + * @property {google.cloud.asset.v1.IConditionEvaluation|null} [conditionEvaluation] AccessControlList conditionEvaluation */ /** @@ -13170,6 +14485,14 @@ */ AccessControlList.prototype.resourceEdges = $util.emptyArray; + /** + * AccessControlList conditionEvaluation. + * @member {google.cloud.asset.v1.IConditionEvaluation|null|undefined} conditionEvaluation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.conditionEvaluation = null; + /** * Creates a new AccessControlList instance using the specified properties. * @function create @@ -13203,6 +14526,8 @@ if (message.resourceEdges != null && message.resourceEdges.length) for (var i = 0; i < message.resourceEdges.length; ++i) $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.conditionEvaluation != null && Object.hasOwnProperty.call(message, "conditionEvaluation")) + $root.google.cloud.asset.v1.ConditionEvaluation.encode(message.conditionEvaluation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -13252,6 +14577,9 @@ message.resourceEdges = []; message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); break; + case 4: + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -13314,6 +14642,11 @@ return "resourceEdges." + error; } } + if (message.conditionEvaluation != null && message.hasOwnProperty("conditionEvaluation")) { + var error = $root.google.cloud.asset.v1.ConditionEvaluation.verify(message.conditionEvaluation); + if (error) + return "conditionEvaluation." + error; + } return null; }; @@ -13359,6 +14692,11 @@ message.resourceEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); } } + if (object.conditionEvaluation != null) { + if (typeof object.conditionEvaluation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.conditionEvaluation: object expected"); + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.fromObject(object.conditionEvaluation); + } return message; }; @@ -13380,6 +14718,8 @@ object.accesses = []; object.resourceEdges = []; } + if (options.defaults) + object.conditionEvaluation = null; if (message.resources && message.resources.length) { object.resources = []; for (var j = 0; j < message.resources.length; ++j) @@ -13395,6 +14735,8 @@ for (var j = 0; j < message.resourceEdges.length; ++j) object.resourceEdges[j] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); } + if (message.conditionEvaluation != null && message.hasOwnProperty("conditionEvaluation")) + object.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.toObject(message.conditionEvaluation, options); return object; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index c3ab1296b93..072c3202456 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -47,6 +47,24 @@ } ] }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/assets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/assets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, "BatchGetAssetsHistory": { "requestType": "BatchGetAssetsHistoryRequest", "responseType": "BatchGetAssetsHistoryResponse", @@ -279,6 +297,56 @@ } } }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "Asset", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, "BatchGetAssetsHistoryRequest": { "fields": { "parent": { @@ -722,6 +790,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "conditionContext": { + "type": "ConditionContext", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -812,6 +887,21 @@ } } } + }, + "ConditionContext": { + "oneofs": { + "TimeContext": { + "oneof": [ + "accessTime" + ] + } + }, + "fields": { + "accessTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } } } }, @@ -1131,6 +1221,15 @@ "type": "string", "id": 3 }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 17 + }, + "organization": { + "type": "string", + "id": 18 + }, "displayName": { "type": "string", "id": 4 @@ -1153,9 +1252,33 @@ "type": "string", "id": 8 }, + "kmsKey": { + "type": "string", + "id": 10 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12 + }, + "state": { + "type": "string", + "id": 13 + }, "additionalAttributes": { "type": "google.protobuf.Struct", "id": 9 + }, + "parentFullResourceName": { + "type": "string", + "id": 19 + }, + "parentAssetType": { + "type": "string", + "id": 103 } } }, @@ -1213,6 +1336,24 @@ } } }, + "ConditionEvaluation": { + "fields": { + "evaluationValue": { + "type": "EvaluationValue", + "id": 1 + } + }, + "nested": { + "EvaluationValue": { + "values": { + "EVALUATION_VALUE_UNSPECIFIED": 0, + "TRUE": 1, + "FALSE": 2, + "CONDITIONAL": 3 + } + } + } + }, "IamPolicyAnalysisResult": { "fields": { "attachedResourceFullName": { @@ -1314,6 +1455,10 @@ "rule": "repeated", "type": "Edge", "id": 3 + }, + "conditionEvaluation": { + "type": "ConditionEvaluation", + "id": 4 } } }, diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index df3cfad4fbe..8db426c5c26 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -142,6 +142,8 @@ export class AssetServiceClient { } 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}`); @@ -168,6 +170,11 @@ export class AssetServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assets' + ), searchAllResources: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -269,6 +276,7 @@ export class AssetServiceClient { // and create an API call method for each. const assetServiceStubMethods = [ 'exportAssets', + 'listAssets', 'batchGetAssetsHistory', 'createFeed', 'getFeed', @@ -1362,6 +1370,292 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest >; } + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAsset[], + protos.google.cloud.asset.v1.IListAssetsRequest | null, + protos.google.cloud.asset.v1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + > + ): void; + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + > + ): void; + /** + * Lists assets with time and resource types and returns paged results in + * response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @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 [Asset]{@link google.cloud.asset.v1.Asset}. + * 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 `listAssetsAsync()` + * 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. + */ + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + >, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + > + ): Promise< + [ + protos.google.cloud.asset.v1.IAsset[], + protos.google.cloud.asset.v1.IListAssetsRequest | null, + protos.google.cloud.asset.v1.IListAssetsResponse + ] + > | 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.listAssets(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. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @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 [Asset]{@link google.cloud.asset.v1.Asset} 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 `listAssetsAsync()` + * 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. + */ + listAssetsStream( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + 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.listAssets.createStream( + this.innerApiCalls.listAssets as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssets`, 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. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @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 + * [Asset]{@link google.cloud.asset.v1.Asset}. 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.listAssetsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAssetsAsync( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + 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.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } searchAllResources( request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, options?: CallOptions @@ -1404,7 +1698,7 @@ export class AssetServiceClient { * @param {string} request.scope * Required. A scope can be a project, a folder, or an organization. The search is * limited to the resources within the `scope`. The caller must be granted the - * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * * The allowed values are: @@ -1415,36 +1709,41 @@ export class AssetServiceClient { * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] * Optional. The query statement. See [how to construct a - * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the - * resources within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, - * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only - * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * resources within the specified `scope`. * * Examples: * * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. + * * `name=Important` to find the Cloud resource whose name is exactly + * "Important". * * `displayName:Impor*` to find Cloud resources whose display name - * contains "Impor" as a prefix. - * * `description:*por*` to find Cloud resources whose description - * contains "por" as a substring. - * * `location:us-west*` to find Cloud resources whose location is - * prefixed with "us-west". + * contains "Impor" as a prefix of any word in the field. + * * `location:us-west*` to find Cloud resources whose location contains both + * "us" and "west" as prefixes. * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". + * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed + * encryption key whose name contains the word "key". + * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a + * word. + * * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state + * doesn't contain "ACTIVE" as a word. + * * `createTime<1609459200` to find Cloud resources that were created before + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. + * * `updateTime>1609459200` to find Cloud resources that were updated after + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `Impor*` to find Cloud resources that contain "Impor" as a prefix - * in any of the searchable fields. - * * `*por*` to find Cloud resources that contain "por" as a substring in - * any of the searchable fields. + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any + * word in any of the searchable fields. * * `Important location:(us-west1 OR global)` to find Cloud * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" @@ -1453,6 +1752,17 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] * Optional. The page size for search result pagination. Page size is capped at 500 even * if a larger value is given. If set to zero, server will pick an appropriate @@ -1464,12 +1774,24 @@ export class AssetServiceClient { * the previous response. The values of all other method parameters, must be * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of the + * Optional. A comma-separated list of fields specifying the sorting order of the * results. The default order is ascending. Add " DESC" after the field name * to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". Only string fields in the response are - * sortable, including `name`, `displayName`, `description`, `location`. All - * the other fields such as repeated fields (e.g., `networkTags`), map + * Example: "location DESC, name". + * Only singular primitive fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * kmsKey + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * All the other fields such as repeated fields (e.g., `networkTags`), map * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {object} [options] @@ -1536,7 +1858,7 @@ export class AssetServiceClient { * @param {string} request.scope * Required. A scope can be a project, a folder, or an organization. The search is * limited to the resources within the `scope`. The caller must be granted the - * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * * The allowed values are: @@ -1547,36 +1869,41 @@ export class AssetServiceClient { * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] * Optional. The query statement. See [how to construct a - * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the - * resources within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, - * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only - * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * resources within the specified `scope`. * * Examples: * * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. + * * `name=Important` to find the Cloud resource whose name is exactly + * "Important". * * `displayName:Impor*` to find Cloud resources whose display name - * contains "Impor" as a prefix. - * * `description:*por*` to find Cloud resources whose description - * contains "por" as a substring. - * * `location:us-west*` to find Cloud resources whose location is - * prefixed with "us-west". + * contains "Impor" as a prefix of any word in the field. + * * `location:us-west*` to find Cloud resources whose location contains both + * "us" and "west" as prefixes. * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". + * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed + * encryption key whose name contains the word "key". + * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a + * word. + * * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state + * doesn't contain "ACTIVE" as a word. + * * `createTime<1609459200` to find Cloud resources that were created before + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. + * * `updateTime>1609459200` to find Cloud resources that were updated after + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `Impor*` to find Cloud resources that contain "Impor" as a prefix - * in any of the searchable fields. - * * `*por*` to find Cloud resources that contain "por" as a substring in - * any of the searchable fields. + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any + * word in any of the searchable fields. * * `Important location:(us-west1 OR global)` to find Cloud * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" @@ -1585,6 +1912,17 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] * Optional. The page size for search result pagination. Page size is capped at 500 even * if a larger value is given. If set to zero, server will pick an appropriate @@ -1596,12 +1934,24 @@ export class AssetServiceClient { * the previous response. The values of all other method parameters, must be * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of the + * Optional. A comma-separated list of fields specifying the sorting order of the * results. The default order is ascending. Add " DESC" after the field name * to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". Only string fields in the response are - * sortable, including `name`, `displayName`, `description`, `location`. All - * the other fields such as repeated fields (e.g., `networkTags`), map + * Example: "location DESC, name". + * Only singular primitive fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * kmsKey + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * All the other fields such as repeated fields (e.g., `networkTags`), map * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {object} [options] @@ -1646,7 +1996,7 @@ export class AssetServiceClient { * @param {string} request.scope * Required. A scope can be a project, a folder, or an organization. The search is * limited to the resources within the `scope`. The caller must be granted the - * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * * The allowed values are: @@ -1657,36 +2007,41 @@ export class AssetServiceClient { * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] * Optional. The query statement. See [how to construct a - * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the - * resources within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, - * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only - * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * resources within the specified `scope`. * * Examples: * * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. + * * `name=Important` to find the Cloud resource whose name is exactly + * "Important". * * `displayName:Impor*` to find Cloud resources whose display name - * contains "Impor" as a prefix. - * * `description:*por*` to find Cloud resources whose description - * contains "por" as a substring. - * * `location:us-west*` to find Cloud resources whose location is - * prefixed with "us-west". + * contains "Impor" as a prefix of any word in the field. + * * `location:us-west*` to find Cloud resources whose location contains both + * "us" and "west" as prefixes. * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". + * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed + * encryption key whose name contains the word "key". + * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a + * word. + * * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state + * doesn't contain "ACTIVE" as a word. + * * `createTime<1609459200` to find Cloud resources that were created before + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. + * * `updateTime>1609459200` to find Cloud resources that were updated after + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `Impor*` to find Cloud resources that contain "Impor" as a prefix - * in any of the searchable fields. - * * `*por*` to find Cloud resources that contain "por" as a substring in - * any of the searchable fields. + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any + * word in any of the searchable fields. * * `Important location:(us-west1 OR global)` to find Cloud * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" @@ -1695,6 +2050,17 @@ export class AssetServiceClient { * Optional. A list of asset types that this request searches for. If empty, it will * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] * Optional. The page size for search result pagination. Page size is capped at 500 even * if a larger value is given. If set to zero, server will pick an appropriate @@ -1706,12 +2072,24 @@ export class AssetServiceClient { * the previous response. The values of all other method parameters, must be * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of the + * Optional. A comma-separated list of fields specifying the sorting order of the * results. The default order is ascending. Add " DESC" after the field name * to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". Only string fields in the response are - * sortable, including `name`, `displayName`, `description`, `location`. All - * the other fields such as repeated fields (e.g., `networkTags`), map + * Example: "location DESC, name". + * Only singular primitive fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * kmsKey + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * All the other fields such as repeated fields (e.g., `networkTags`), map * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {object} [options] @@ -1794,7 +2172,7 @@ export class AssetServiceClient { * Required. A scope can be a project, a folder, or an organization. The search is * limited to the IAM policies within the `scope`. The caller must be granted * the - * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * * The allowed values are: @@ -1807,7 +2185,12 @@ export class AssetServiceClient { * Optional. The query statement. See [how to construct a * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the - * IAM policies within the specified `scope`. + * IAM policies within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * @@ -1815,18 +2198,25 @@ export class AssetServiceClient { * "amy@gmail.com". * * `policy:roles/compute.admin` to find IAM policy bindings that specify * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. * * `policy.role.permissions:storage.buckets.update` to find IAM policy * bindings that specify a role containing "storage.buckets.update" * permission. Note that if callers don't have `iam.roles.get` access to a * role's included permissions, policy bindings that specify this role will * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. * * `resource:organizations/123456` to find IAM policy bindings * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". * * `Important` to find IAM policy bindings that contain "Important" as a * word in any of the searchable fields (except for the included * permissions). - * * `*por*` to find IAM policy bindings that contain "por" as a substring - * in any of the searchable fields (except for the included permissions). * * `resource:(instance1 OR instance2) policy:amy` to find * IAM policy bindings that are set on resources "instance1" or * "instance2" and also specify user "amy". @@ -1905,7 +2295,7 @@ export class AssetServiceClient { * Required. A scope can be a project, a folder, or an organization. The search is * limited to the IAM policies within the `scope`. The caller must be granted * the - * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * * The allowed values are: @@ -1918,7 +2308,12 @@ export class AssetServiceClient { * Optional. The query statement. See [how to construct a * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the - * IAM policies within the specified `scope`. + * IAM policies within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * @@ -1926,18 +2321,25 @@ export class AssetServiceClient { * "amy@gmail.com". * * `policy:roles/compute.admin` to find IAM policy bindings that specify * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. * * `policy.role.permissions:storage.buckets.update` to find IAM policy * bindings that specify a role containing "storage.buckets.update" * permission. Note that if callers don't have `iam.roles.get` access to a * role's included permissions, policy bindings that specify this role will * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. * * `resource:organizations/123456` to find IAM policy bindings * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". * * `Important` to find IAM policy bindings that contain "Important" as a * word in any of the searchable fields (except for the included * permissions). - * * `*por*` to find IAM policy bindings that contain "por" as a substring - * in any of the searchable fields (except for the included permissions). * * `resource:(instance1 OR instance2) policy:amy` to find * IAM policy bindings that are set on resources "instance1" or * "instance2" and also specify user "amy". @@ -1994,7 +2396,7 @@ export class AssetServiceClient { * Required. A scope can be a project, a folder, or an organization. The search is * limited to the IAM policies within the `scope`. The caller must be granted * the - * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * * The allowed values are: @@ -2007,7 +2409,12 @@ export class AssetServiceClient { * Optional. The query statement. See [how to construct a * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the - * IAM policies within the specified `scope`. + * IAM policies within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * @@ -2015,18 +2422,25 @@ export class AssetServiceClient { * "amy@gmail.com". * * `policy:roles/compute.admin` to find IAM policy bindings that specify * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. * * `policy.role.permissions:storage.buckets.update` to find IAM policy * bindings that specify a role containing "storage.buckets.update" * permission. Note that if callers don't have `iam.roles.get` access to a * role's included permissions, policy bindings that specify this role will * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. * * `resource:organizations/123456` to find IAM policy bindings * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". * * `Important` to find IAM policy bindings that contain "Important" as a * word in any of the searchable fields (except for the included * permissions). - * * `*por*` to find IAM policy bindings that contain "por" as a substring - * in any of the searchable fields (except for the included permissions). * * `resource:(instance1 OR instance2) policy:amy` to find * IAM policy bindings that are set on resources "instance1" or * "instance2" and also specify user "amy". diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index 16565a7fe35..7c1413ed716 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -28,6 +28,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ListAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "BatchGetAssetsHistory": { "timeout_millis": 60000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 37185e2cc13..d519d6bffd1 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,4 +1,10 @@ [ "../../protos/google/cloud/asset/v1/asset_service.proto", - "../../protos/google/cloud/asset/v1/assets.proto" + "../../protos/google/cloud/asset/v1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/cloud/osconfig/v1/inventory.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/src/v1/gapic_metadata.json b/packages/google-cloud-asset/src/v1/gapic_metadata.json index 46df80bec8f..2fdd04eb95a 100644 --- a/packages/google-cloud-asset/src/v1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1/gapic_metadata.json @@ -55,6 +55,13 @@ "analyzeIamPolicyLongrunning" ] }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, "SearchAllResources": { "methods": [ "searchAllResources", @@ -119,6 +126,13 @@ "analyzeIamPolicyLongrunning" ] }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, "SearchAllResources": { "methods": [ "searchAllResources", diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 3bf4d360769..590f00888af 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -139,6 +139,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index bc72a283da7..7dcbeee62ba 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -131,6 +131,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 69526ea97fc..0cc2b59fab6 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -137,6 +137,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index c2717671446..2e317883c91 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -139,6 +139,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json index cb107dd3fa8..98ff312c565 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1p5beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p5beta1/assets.proto" + "../../protos/google/cloud/asset/v1p5beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 8bf238571a5..4d82a3018c2 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -1398,6 +1398,285 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IAsset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('searchAllResources', () => { it('invokes searchAllResources without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ From 29f6247fcf6404969df5baa665379ec91c9e9592 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:22:44 -0400 Subject: [PATCH 322/429] chore: release 3.12.2 (#493) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index d026b06ce0d..9a9c9a28bb1 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.12.2](https://www.github.com/googleapis/nodejs-asset/compare/v3.12.1...v3.12.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#492](https://www.github.com/googleapis/nodejs-asset/issues/492)) ([f8f8ed6](https://www.github.com/googleapis/nodejs-asset/commit/f8f8ed67b1f71d2491c9f54eb2beb09475c5663d)) + ### [3.12.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.12.0...v3.12.1) (2021-05-12) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 32f960d09a6..ecc941b4e3d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.12.1", + "version": "3.12.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index cf690ed9ac0..7caa0bc3bca 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.12.1", + "@google-cloud/asset": "^3.12.2", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 5337fc418b3852cfea9fcacdcfc3599874c50544 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 May 2021 00:14:52 -0400 Subject: [PATCH 323/429] feat: add Cloud Asset List API, add access time as condition context in request and evaluation value in response for Cloud Asset AnalyzeIamPolicy API, add more info (folders, organizations, kms_key, create_time, update_time, state, parent_full_resource_name, parent_asset_type) in response for Cloud Asset SearchAllResources API (#491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add Cloud Asset List API, add access time as condition context in request and evaluation value in response for Cloud Asset AnalyzeIamPolicy API, add more info (folders, organizations, kms_key, create_time, update_time, state, parent_full_resource_name, parent_asset_type) in response for Cloud Asset SearchAllResources API Committer: @peter-zheng-g PiperOrigin-RevId: 375731640 Source-Link: https://github.com/googleapis/googleapis/commit/de04592991247b9b617d06d4ec68f7e90adf2b81 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7b343f4bb6302e1de90e4ea773f1a2ba783a3edd * 🦉 Updates from OwlBot * 🦉 Updates from OwlBot * 🦉 Updates from OwlBot Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../google-cloud-asset/src/v1/asset_service_client.ts | 2 -- .../src/v1/asset_service_proto_list.json | 8 +------- .../src/v1p1beta1/asset_service_client.ts | 2 -- .../src/v1p2beta1/asset_service_client.ts | 2 -- .../src/v1p4beta1/asset_service_client.ts | 2 -- .../src/v1p5beta1/asset_service_client.ts | 2 -- .../src/v1p5beta1/asset_service_proto_list.json | 7 +------ 7 files changed, 2 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 8db426c5c26..9c7ebb91590 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -142,8 +142,6 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index d519d6bffd1..37185e2cc13 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,10 +1,4 @@ [ "../../protos/google/cloud/asset/v1/asset_service.proto", - "../../protos/google/cloud/asset/v1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/cloud/osconfig/v1/inventory.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1/assets.proto" ] diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 590f00888af..3bf4d360769 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -139,8 +139,6 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 7dcbeee62ba..bc72a283da7 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -131,8 +131,6 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 0cc2b59fab6..69526ea97fc 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -137,8 +137,6 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 2e317883c91..c2717671446 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -139,8 +139,6 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json index 98ff312c565..cb107dd3fa8 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json @@ -1,9 +1,4 @@ [ "../../protos/google/cloud/asset/v1p5beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p5beta1/assets.proto", - "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", - "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", - "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", - "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" + "../../protos/google/cloud/asset/v1p5beta1/assets.proto" ] From 6f0178869a6c670031d66032d97f72dd0828bed1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 26 May 2021 08:29:32 -0700 Subject: [PATCH 324/429] chore: release 3.13.0 (#494) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 9a9c9a28bb1..8c0bd930f38 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.13.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.12.2...v3.13.0) (2021-05-26) + + +### Features + +* add Cloud Asset List API, add access time as condition context in request and evaluation value in response for Cloud Asset AnalyzeIamPolicy API, add more info (folders, organizations, kms_key, create_time, update_time, state, parent_full_resource_name, parent_asset_type) in response for Cloud Asset SearchAllResources API ([#491](https://www.github.com/googleapis/nodejs-asset/issues/491)) ([8eea45f](https://www.github.com/googleapis/nodejs-asset/commit/8eea45fe3e5b528faf85a8ebb96e2c0c35a7e66d)) + ### [3.12.2](https://www.github.com/googleapis/nodejs-asset/compare/v3.12.1...v3.12.2) (2021-05-25) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ecc941b4e3d..f7d2845e45f 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.12.2", + "version": "3.13.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 7caa0bc3bca..533462e0295 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.12.2", + "@google-cloud/asset": "^3.13.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 4d04be4e156500084f8339b0c835332b881972ef Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 29 May 2021 20:52:12 +0000 Subject: [PATCH 325/429] chore: make generate_index_ts() deterministic (#496) Fixes https://github.com/googleapis/synthtool/issues/1103 Source-Link: https://github.com/googleapis/synthtool/commit/c3e41da0fa256ad7f6b4bc76b9d069dedecdfef4 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:e37a815333a6f3e14d8532efe90cba8aa0d34210f8c0fdbdd9e6a34dcbe51e96 --- packages/google-cloud-asset/src/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 6eabddb7492..fc2b6f63346 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -16,22 +16,22 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; +import * as v1p1beta1 from './v1p1beta1'; +import * as v1p2beta1 from './v1p2beta1'; import * as v1p4beta1 from './v1p4beta1'; import * as v1p5beta1 from './v1p5beta1'; -import * as v1p2beta1 from './v1p2beta1'; -import * as v1p1beta1 from './v1p1beta1'; -import * as v1 from './v1'; const AssetServiceClient = v1.AssetServiceClient; type AssetServiceClient = v1.AssetServiceClient; -export {v1p4beta1, v1p5beta1, v1p2beta1, v1p1beta1, v1, AssetServiceClient}; +export {v1, v1p1beta1, v1p2beta1, v1p4beta1, v1p5beta1, AssetServiceClient}; export default { + v1, + v1p1beta1, + v1p2beta1, v1p4beta1, v1p5beta1, - v1p2beta1, - v1p1beta1, - v1, AssetServiceClient, }; import * as protos from '../protos/protos'; From 10f079e4393d4eb46ff190706e93eeaa9cdb4c7f Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:00:34 +0200 Subject: [PATCH 326/429] chore(nodejs): remove api-extractor dependencies (#502) --- packages/google-cloud-asset/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index f7d2845e45f..dac8e0cba9f 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -41,9 +41,7 @@ "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.12.0" @@ -66,8 +64,6 @@ "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", - "webpack-cli": "^4.0.0", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "webpack-cli": "^4.0.0" } } From bebaff99286698341303bc539f0a8986e78eeb53 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Mon, 21 Jun 2021 11:16:26 -0400 Subject: [PATCH 327/429] feat: generate new surface for v1 (#504) --- .../google-cloud-asset/src/v1/asset_service_client.ts | 2 ++ .../src/v1/asset_service_proto_list.json | 8 +++++++- .../src/v1p1beta1/asset_service_client.ts | 2 ++ .../src/v1p2beta1/asset_service_client.ts | 2 ++ .../src/v1p4beta1/asset_service_client.ts | 2 ++ .../src/v1p5beta1/asset_service_client.ts | 2 ++ .../src/v1p5beta1/asset_service_proto_list.json | 7 ++++++- 7 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 9c7ebb91590..8db426c5c26 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -142,6 +142,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 37185e2cc13..d519d6bffd1 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,4 +1,10 @@ [ "../../protos/google/cloud/asset/v1/asset_service.proto", - "../../protos/google/cloud/asset/v1/assets.proto" + "../../protos/google/cloud/asset/v1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/cloud/osconfig/v1/inventory.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 3bf4d360769..590f00888af 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -139,6 +139,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index bc72a283da7..7dcbeee62ba 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -131,6 +131,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 69526ea97fc..0cc2b59fab6 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -137,6 +137,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index c2717671446..2e317883c91 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -139,6 +139,8 @@ export class AssetServiceClient { } 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}`); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json index cb107dd3fa8..98ff312c565 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_proto_list.json @@ -1,4 +1,9 @@ [ "../../protos/google/cloud/asset/v1p5beta1/asset_service.proto", - "../../protos/google/cloud/asset/v1p5beta1/assets.proto" + "../../protos/google/cloud/asset/v1p5beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" ] From 3e93553165897cb69aebe737fc67e5dc3610eded Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 21 Jun 2021 15:24:02 +0000 Subject: [PATCH 328/429] chore: release 3.14.0 (#506) :robot: I have created a release \*beep\* \*boop\* --- ## [3.14.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.13.0...v3.14.0) (2021-06-21) ### Features * generate new surface for v1 ([#504](https://www.github.com/googleapis/nodejs-asset/issues/504)) ([e1c6350](https://www.github.com/googleapis/nodejs-asset/commit/e1c6350f09adb6ab1e420de4ce5a3a4fd4c8c252)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 8c0bd930f38..db365e8b85b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.14.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.13.0...v3.14.0) (2021-06-21) + + +### Features + +* generate new surface for v1 ([#504](https://www.github.com/googleapis/nodejs-asset/issues/504)) ([e1c6350](https://www.github.com/googleapis/nodejs-asset/commit/e1c6350f09adb6ab1e420de4ce5a3a4fd4c8c252)) + ## [3.13.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.12.2...v3.13.0) (2021-05-26) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index dac8e0cba9f..7a8beb8a647 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.13.0", + "version": "3.14.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 533462e0295..9bdccf79096 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.13.0", + "@google-cloud/asset": "^3.14.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From d871a8377476d995809097f69ce07abad65df6e4 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:28 +0000 Subject: [PATCH 329/429] fix: make request optional in all cases (#507) ... 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 --- .../src/v1/asset_service_client.ts | 48 +++++++++---------- .../src/v1p1beta1/asset_service_client.ts | 8 ++-- .../src/v1p2beta1/asset_service_client.ts | 20 ++++---- .../src/v1p4beta1/asset_service_client.ts | 8 ++-- .../src/v1p5beta1/asset_service_client.ts | 4 +- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 8db426c5c26..6b9f6c59226 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -373,7 +373,7 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- batchGetAssetsHistory( - request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, options?: CallOptions ): Promise< [ @@ -447,7 +447,7 @@ export class AssetServiceClient { * const [response] = await client.batchGetAssetsHistory(request); */ batchGetAssetsHistory( - request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: | CallOptions | Callback< @@ -490,7 +490,7 @@ export class AssetServiceClient { return this.innerApiCalls.batchGetAssetsHistory(request, options, callback); } createFeed( - request: protos.google.cloud.asset.v1.ICreateFeedRequest, + request?: protos.google.cloud.asset.v1.ICreateFeedRequest, options?: CallOptions ): Promise< [ @@ -548,7 +548,7 @@ export class AssetServiceClient { * const [response] = await client.createFeed(request); */ createFeed( - request: protos.google.cloud.asset.v1.ICreateFeedRequest, + request?: protos.google.cloud.asset.v1.ICreateFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -587,7 +587,7 @@ export class AssetServiceClient { return this.innerApiCalls.createFeed(request, options, callback); } getFeed( - request: protos.google.cloud.asset.v1.IGetFeedRequest, + request?: protos.google.cloud.asset.v1.IGetFeedRequest, options?: CallOptions ): Promise< [ @@ -634,7 +634,7 @@ export class AssetServiceClient { * const [response] = await client.getFeed(request); */ getFeed( - request: protos.google.cloud.asset.v1.IGetFeedRequest, + request?: protos.google.cloud.asset.v1.IGetFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -673,7 +673,7 @@ export class AssetServiceClient { return this.innerApiCalls.getFeed(request, options, callback); } listFeeds( - request: protos.google.cloud.asset.v1.IListFeedsRequest, + request?: protos.google.cloud.asset.v1.IListFeedsRequest, options?: CallOptions ): Promise< [ @@ -719,7 +719,7 @@ export class AssetServiceClient { * const [response] = await client.listFeeds(request); */ listFeeds( - request: protos.google.cloud.asset.v1.IListFeedsRequest, + request?: protos.google.cloud.asset.v1.IListFeedsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -758,7 +758,7 @@ export class AssetServiceClient { return this.innerApiCalls.listFeeds(request, options, callback); } updateFeed( - request: protos.google.cloud.asset.v1.IUpdateFeedRequest, + request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, options?: CallOptions ): Promise< [ @@ -810,7 +810,7 @@ export class AssetServiceClient { * const [response] = await client.updateFeed(request); */ updateFeed( - request: protos.google.cloud.asset.v1.IUpdateFeedRequest, + request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -849,7 +849,7 @@ export class AssetServiceClient { return this.innerApiCalls.updateFeed(request, options, callback); } deleteFeed( - request: protos.google.cloud.asset.v1.IDeleteFeedRequest, + request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, options?: CallOptions ): Promise< [ @@ -896,7 +896,7 @@ export class AssetServiceClient { * const [response] = await client.deleteFeed(request); */ deleteFeed( - request: protos.google.cloud.asset.v1.IDeleteFeedRequest, + request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -935,7 +935,7 @@ export class AssetServiceClient { return this.innerApiCalls.deleteFeed(request, options, callback); } analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -991,7 +991,7 @@ export class AssetServiceClient { * const [response] = await client.analyzeIamPolicy(request); */ analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1033,7 +1033,7 @@ export class AssetServiceClient { } exportAssets( - request: protos.google.cloud.asset.v1.IExportAssetsRequest, + request?: protos.google.cloud.asset.v1.IExportAssetsRequest, options?: CallOptions ): Promise< [ @@ -1131,7 +1131,7 @@ export class AssetServiceClient { * const [response] = await operation.promise(); */ exportAssets( - request: protos.google.cloud.asset.v1.IExportAssetsRequest, + request?: protos.google.cloud.asset.v1.IExportAssetsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1216,7 +1216,7 @@ export class AssetServiceClient { >; } analyzeIamPolicyLongrunning( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, options?: CallOptions ): Promise< [ @@ -1282,7 +1282,7 @@ export class AssetServiceClient { * const [response] = await operation.promise(); */ analyzeIamPolicyLongrunning( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1371,7 +1371,7 @@ export class AssetServiceClient { >; } listAssets( - request: protos.google.cloud.asset.v1.IListAssetsRequest, + request?: protos.google.cloud.asset.v1.IListAssetsRequest, options?: CallOptions ): Promise< [ @@ -1457,7 +1457,7 @@ export class AssetServiceClient { * for more details and examples. */ listAssets( - request: protos.google.cloud.asset.v1.IListAssetsRequest, + request?: protos.google.cloud.asset.v1.IListAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -1657,7 +1657,7 @@ export class AssetServiceClient { ) as AsyncIterable; } searchAllResources( - request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, options?: CallOptions ): Promise< [ @@ -1808,7 +1808,7 @@ export class AssetServiceClient { * for more details and examples. */ searchAllResources( - request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2130,7 +2130,7 @@ export class AssetServiceClient { ) as AsyncIterable; } searchAllIamPolicies( - request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, options?: CallOptions ): Promise< [ @@ -2244,7 +2244,7 @@ export class AssetServiceClient { * for more details and examples. */ searchAllIamPolicies( - request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 590f00888af..f59a2a7d72d 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -296,7 +296,7 @@ export class AssetServiceClient { // ------------------- searchAllResources( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options?: CallOptions ): Promise< [ @@ -377,7 +377,7 @@ export class AssetServiceClient { * for more details and examples. */ searchAllResources( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -555,7 +555,7 @@ export class AssetServiceClient { ) as AsyncIterable; } searchAllIamPolicies( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, options?: CallOptions ): Promise< [ @@ -631,7 +631,7 @@ export class AssetServiceClient { * for more details and examples. */ searchAllIamPolicies( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 7dcbeee62ba..8416b8a9231 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -289,7 +289,7 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- createFeed( - request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, options?: CallOptions ): Promise< [ @@ -347,7 +347,7 @@ export class AssetServiceClient { * const [response] = await client.createFeed(request); */ createFeed( - request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -388,7 +388,7 @@ export class AssetServiceClient { return this.innerApiCalls.createFeed(request, options, callback); } getFeed( - request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, options?: CallOptions ): Promise< [ @@ -435,7 +435,7 @@ export class AssetServiceClient { * const [response] = await client.getFeed(request); */ getFeed( - request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -476,7 +476,7 @@ export class AssetServiceClient { return this.innerApiCalls.getFeed(request, options, callback); } listFeeds( - request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, options?: CallOptions ): Promise< [ @@ -522,7 +522,7 @@ export class AssetServiceClient { * const [response] = await client.listFeeds(request); */ listFeeds( - request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -563,7 +563,7 @@ export class AssetServiceClient { return this.innerApiCalls.listFeeds(request, options, callback); } updateFeed( - request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, options?: CallOptions ): Promise< [ @@ -615,7 +615,7 @@ export class AssetServiceClient { * const [response] = await client.updateFeed(request); */ updateFeed( - request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, optionsOrCallback?: | CallOptions | Callback< @@ -656,7 +656,7 @@ export class AssetServiceClient { return this.innerApiCalls.updateFeed(request, options, callback); } deleteFeed( - request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, options?: CallOptions ): Promise< [ @@ -703,7 +703,7 @@ export class AssetServiceClient { * const [response] = await client.deleteFeed(request); */ deleteFeed( - request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, optionsOrCallback?: | CallOptions | Callback< diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 0cc2b59fab6..6ee2ff6b735 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -308,7 +308,7 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- analyzeIamPolicy( - request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + request?: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, options?: CallOptions ): Promise< [ @@ -359,7 +359,7 @@ export class AssetServiceClient { * const [response] = await client.analyzeIamPolicy(request); */ analyzeIamPolicy( - request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + request?: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -403,7 +403,7 @@ export class AssetServiceClient { } exportIamPolicyAnalysis( - request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + request?: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, options?: CallOptions ): Promise< [ @@ -466,7 +466,7 @@ export class AssetServiceClient { * const [response] = await operation.promise(); */ exportIamPolicyAnalysis( - request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + request?: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, optionsOrCallback?: | CallOptions | Callback< diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 2e317883c91..ada5ebb2f72 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -288,7 +288,7 @@ export class AssetServiceClient { // ------------------- listAssets( - request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, options?: CallOptions ): Promise< [ @@ -365,7 +365,7 @@ export class AssetServiceClient { * for more details and examples. */ listAssets( - request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From cc8d1a9c99b4e5eb4e304033d45e3caa46a92c6d 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:42 +0000 Subject: [PATCH 330/429] chore: release 3.14.1 (#508) :robot: I have created a release \*beep\* \*boop\* --- ### [3.14.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.0...v3.14.1) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#507](https://www.github.com/googleapis/nodejs-asset/issues/507)) ([07b6827](https://www.github.com/googleapis/nodejs-asset/commit/07b68273ea5522ae4c3a94b714f05ee7d32391ef)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index db365e8b85b..b0fdecb8554 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.14.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.0...v3.14.1) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#507](https://www.github.com/googleapis/nodejs-asset/issues/507)) ([07b6827](https://www.github.com/googleapis/nodejs-asset/commit/07b68273ea5522ae4c3a94b714f05ee7d32391ef)) + ## [3.14.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.13.0...v3.14.0) (2021-06-21) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 7a8beb8a647..6ae1d94f5f4 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.14.0", + "version": "3.14.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 9bdccf79096..9b32115e5e8 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.14.0", + "@google-cloud/asset": "^3.14.1", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From c22d4b60f46e906b3685e90ac32d81f2020f3ccc Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 29 Jun 2021 14:17:25 -0700 Subject: [PATCH 331/429] samples: reduce calls to API (#515) --- .../samples/test/sample.test.js | 75 +++++++++++-------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 141f2cb2bd8..ec52cc3b9ce 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -42,16 +42,9 @@ let vm; // Some of these tests can take an extremely long time, and occasionally // timeout, see: // "Timeout of 180000ms exceeded. For async tests and hooks". -const delay = async test => { - const retries = test.currentRetry(); - if (retries === 0) return; // no retry on the first failure. - // see: https://cloud.google.com/storage/docs/exponential-backoff: - const ms = Math.pow(2, retries) * 1000 + Math.random() * 2000; - return new Promise(done => { - console.info(`retrying "${test.title}" in ${ms}ms`); - setTimeout(done, ms); - }); -}; +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} describe('quickstart sample tests', () => { before(async () => { @@ -67,13 +60,17 @@ describe('quickstart sample tests', () => { await vm.delete(); }); - it('should export assets to specified path', async function () { - this.retries(2); - await delay(this.test); + it('should export assets to specified path', async () => { const dumpFilePath = `gs://${bucketName}/my-assets.txt`; execSync(`node exportAssets ${dumpFilePath}`); - const file = await bucket.file('my-assets.txt'); - const exists = await file.exists(); + let waitMs = 1000; + let exists = false; + let file; + for (let retry = 0; retry < 3 && !exists; ++retry) { + await sleep((waitMs *= 2)); + file = await bucket.file('my-assets.txt'); + exists = await file.exists(); + } assert.ok(exists); await file.delete(); }); @@ -115,33 +112,49 @@ describe('quickstart sample tests', () => { assert.include(stdout, '//cloudresourcemanager.googleapis.com/projects'); }); - it('should analyze iam policy and write analysis results to gcs successfully', async function () { - this.retries(2); - await delay(this.test); + it('should analyze iam policy and write analysis results to gcs successfully', async () => { const uri = `gs://${bucketName}/my-analysis.json`; execSync(`node analyzeIamPolicyLongrunningGcs ${uri}`); - const file = await bucket.file('my-analysis.json'); - const exists = await file.exists(); + let waitMs = 1000; + let exists = false; + let file; + for (let retry = 0; retry < 3 && !exists; ++retry) { + await sleep((waitMs *= 2)); + file = await bucket.file('my-analysis.json'); + exists = await file.exists(); + } assert.ok(exists); await file.delete(); }); - it('should analyze iam policy and write analysis results to bigquery successfully', async function () { - this.retries(2); - await delay(this.test); + it('should analyze iam policy and write analysis results to bigquery successfully', async () => { const tablePrefix = 'analysis_nodejs'; execSync( `node analyzeIamPolicyLongrunningBigquery ${datasetId} ${tablePrefix}` ); - const metadataTable = await bigquery - .dataset(datasetId) - .table('analysis_nodejs_analysis'); - const metadataTable_exists = await metadataTable.exists(); + let waitMs = 1000; + let metadataTable; + let metadataTable_exists = false; + let resultsTable; + let resultsTable_exists = false; + + for ( + let retry = 0; + retry < 3 && !(metadataTable_exists || resultsTable_exists); + ++retry + ) { + await sleep((waitMs *= 2)); + metadataTable = await bigquery + .dataset(datasetId) + .table('analysis_nodejs_analysis'); + metadataTable_exists = await metadataTable.exists(); + resultsTable = await bigquery + .dataset(datasetId) + .table('analysis_nodejs_analysis_result'); + resultsTable_exists = await resultsTable.exists(); + } + assert.ok(metadataTable_exists); - const resultsTable = await bigquery - .dataset(datasetId) - .table('analysis_nodejs_analysis_result'); - const resultsTable_exists = await resultsTable.exists(); assert.ok(resultsTable_exists); await metadataTable.delete(); await resultsTable.delete(); From 5f7dc285ec64c9ae9ce383135bef2b792b39ae47 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:28:57 -0700 Subject: [PATCH 332/429] feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies PiperOrigin-RevId: 381145907 Source-Link: https://github.com/googleapis/googleapis/commit/5d301f95d17d50f78e0b2a6889301c180b947357 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9b332fd884d84662522abad820fa5835cae8688a * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe Co-authored-by: Jeffrey Rennie --- .../google/cloud/asset/v1/asset_service.proto | 34 +++++ .../protos/google/cloud/asset/v1/assets.proto | 30 ++++ .../google-cloud-asset/protos/protos.d.ts | 30 ++++ packages/google-cloud-asset/protos/protos.js | 144 ++++++++++++++++++ .../google-cloud-asset/protos/protos.json | 28 ++++ .../src/v1/asset_service_client.ts | 96 ++++++++++++ .../src/v1/asset_service_client_config.json | 8 +- 7 files changed, 366 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index eadaef285c0..59f517bb07d 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -838,6 +838,10 @@ message SearchAllIamPoliciesRequest { // * `resource:(instance1 OR instance2) policy:amy` to find // IAM policy bindings that are set on resources "instance1" or // "instance2" and also specify user "amy". + // * `roles:roles/compute.admin` to find IAM policy bindings that specify the + // Compute Admin role. + // * `memberTypes:user` to find IAM policy bindings that contain the "user" + // member type. string query = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The page size for search result pagination. Page size is capped at 500 even @@ -851,6 +855,36 @@ message SearchAllIamPoliciesRequest { // previous response. The values of all other method parameters must be // identical to those in the previous call. string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that the IAM policies are attached to. If empty, it + // will search the IAM policies that are attached to all the [searchable asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + // starts with "compute.googleapis.com". + // * ".*Instance" snapshots IAM policies attached to asset type ends with + // "Instance". + // * ".*Instance.*" snapshots IAM policies attached to asset type contains + // "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + repeated string asset_types = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " DESC" after the field name + // to indicate descending order. Redundant space characters are ignored. + // Example: "assetType DESC, resource". + // Only singular primitive fields in the response are sortable: + // * resource + // * assetType + // * project + // All the other fields such as repeated fields (e.g., `folders`) and + // non-primitive fields (e.g., `policy`) are not supported. + string order_by = 7 [(google.api.field_behavior) = OPTIONAL]; } // Search all IAM policies response. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 572ed739a63..a607784e82c 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -463,6 +463,14 @@ message IamPolicySearchResult { // * use a field query. Example: `resource:organizations/123` string resource = 1; + // The type of the resource associated with this IAM policy. Example: + // `compute.googleapis.com/Disk`. + // + // To search against the `asset_type`: + // + // * specify the `asset_types` field in your search request. + string asset_type = 5; + // The project that the associated GCP resource belongs to, in the form of // projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM // instance, Cloud Storage bucket), the project field will indicate the @@ -474,6 +482,28 @@ message IamPolicySearchResult { // * specify the `scope` field as this project in your search request. string project = 2; + // The folder(s) that the IAM policy belongs to, in the form of + // folders/{FOLDER_NUMBER}. This field is available when the IAM policy + // belongs to one or more folders. + // + // To search against `folders`: + // + // * use a field query. Example: `folders:(123 OR 456)` + // * use a free text query. Example: `123` + // * specify the `scope` field as this folder in your search request. + repeated string folders = 6; + + // The organization that the IAM policy belongs to, in the form + // of organizations/{ORGANIZATION_NUMBER}. This field is available when the + // IAM policy belongs to an organization. + // + // To search against `organization`: + // + // * use a field query. Example: `organization:123` + // * use a free text query. Example: `123` + // * specify the `scope` field as this organization in your search request. + string organization = 7; + // The IAM policy directly set on the given resource. Note that the original // IAM policy can contain multiple bindings. This only contains the bindings // that match the given query. For queries that don't contain a constrain on diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index e7d67db7556..fb2fc4b3fa5 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -2624,6 +2624,12 @@ export namespace google { /** SearchAllIamPoliciesRequest pageToken */ pageToken?: (string|null); + + /** SearchAllIamPoliciesRequest assetTypes */ + assetTypes?: (string[]|null); + + /** SearchAllIamPoliciesRequest orderBy */ + orderBy?: (string|null); } /** Represents a SearchAllIamPoliciesRequest. */ @@ -2647,6 +2653,12 @@ export namespace google { /** SearchAllIamPoliciesRequest pageToken. */ public pageToken: string; + /** SearchAllIamPoliciesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllIamPoliciesRequest orderBy. */ + public orderBy: string; + /** * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set @@ -4927,9 +4939,18 @@ export namespace google { /** IamPolicySearchResult resource */ resource?: (string|null); + /** IamPolicySearchResult assetType */ + assetType?: (string|null); + /** IamPolicySearchResult project */ project?: (string|null); + /** IamPolicySearchResult folders */ + folders?: (string[]|null); + + /** IamPolicySearchResult organization */ + organization?: (string|null); + /** IamPolicySearchResult policy */ policy?: (google.iam.v1.IPolicy|null); @@ -4949,9 +4970,18 @@ export namespace google { /** IamPolicySearchResult resource. */ public resource: string; + /** IamPolicySearchResult assetType. */ + public assetType: string; + /** IamPolicySearchResult project. */ public project: string; + /** IamPolicySearchResult folders. */ + public folders: string[]; + + /** IamPolicySearchResult organization. */ + public organization: string; + /** IamPolicySearchResult policy. */ public policy?: (google.iam.v1.IPolicy|null); diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 89cf38adea5..24b08960267 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -6158,6 +6158,8 @@ * @property {string|null} [query] SearchAllIamPoliciesRequest query * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken + * @property {Array.|null} [assetTypes] SearchAllIamPoliciesRequest assetTypes + * @property {string|null} [orderBy] SearchAllIamPoliciesRequest orderBy */ /** @@ -6169,6 +6171,7 @@ * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest=} [properties] Properties to set */ function SearchAllIamPoliciesRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6207,6 +6210,22 @@ */ SearchAllIamPoliciesRequest.prototype.pageToken = ""; + /** + * SearchAllIamPoliciesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.assetTypes = $util.emptyArray; + + /** + * SearchAllIamPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.orderBy = ""; + /** * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @function create @@ -6239,6 +6258,11 @@ 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.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.assetTypes[i]); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.orderBy); return writer; }; @@ -6285,6 +6309,14 @@ case 4: message.pageToken = reader.string(); break; + case 5: + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + case 7: + message.orderBy = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -6332,6 +6364,16 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; @@ -6355,6 +6397,15 @@ message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.SearchAllIamPoliciesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; @@ -6371,11 +6422,14 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; if (options.defaults) { object.scope = ""; object.query = ""; object.pageSize = 0; object.pageToken = ""; + object.orderBy = ""; } if (message.scope != null && message.hasOwnProperty("scope")) object.scope = message.scope; @@ -6385,6 +6439,13 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; @@ -12010,7 +12071,10 @@ * @memberof google.cloud.asset.v1 * @interface IIamPolicySearchResult * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [assetType] IamPolicySearchResult assetType * @property {string|null} [project] IamPolicySearchResult project + * @property {Array.|null} [folders] IamPolicySearchResult folders + * @property {string|null} [organization] IamPolicySearchResult organization * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation */ @@ -12024,6 +12088,7 @@ * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set */ function IamPolicySearchResult(properties) { + this.folders = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12038,6 +12103,14 @@ */ IamPolicySearchResult.prototype.resource = ""; + /** + * IamPolicySearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.assetType = ""; + /** * IamPolicySearchResult project. * @member {string} project @@ -12046,6 +12119,22 @@ */ IamPolicySearchResult.prototype.project = ""; + /** + * IamPolicySearchResult folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.folders = $util.emptyArray; + + /** + * IamPolicySearchResult organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.organization = ""; + /** * IamPolicySearchResult policy. * @member {google.iam.v1.IPolicy|null|undefined} policy @@ -12094,6 +12183,13 @@ $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.assetType); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.organization); return writer; }; @@ -12131,9 +12227,20 @@ case 1: message.resource = reader.string(); break; + case 5: + message.assetType = reader.string(); + break; case 2: message.project = reader.string(); break; + case 6: + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + case 7: + message.organization = reader.string(); + break; case 3: message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; @@ -12178,9 +12285,22 @@ if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; if (message.project != null && message.hasOwnProperty("project")) if (!$util.isString(message.project)) return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; if (message.policy != null && message.hasOwnProperty("policy")) { var error = $root.google.iam.v1.Policy.verify(message.policy); if (error) @@ -12208,8 +12328,19 @@ var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); if (object.resource != null) message.resource = String(object.resource); + if (object.assetType != null) + message.assetType = String(object.assetType); if (object.project != null) message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); if (object.policy != null) { if (typeof object.policy !== "object") throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); @@ -12236,11 +12367,15 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.folders = []; if (options.defaults) { object.resource = ""; object.project = ""; object.policy = null; object.explanation = null; + object.assetType = ""; + object.organization = ""; } if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; @@ -12250,6 +12385,15 @@ object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); if (message.explanation != null && message.hasOwnProperty("explanation")) object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; return object; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 072c3202456..f16023d6f43 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -738,6 +738,21 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1288,10 +1303,23 @@ "type": "string", "id": 1 }, + "assetType": { + "type": "string", + "id": 5 + }, "project": { "type": "string", "id": 2 }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "organization": { + "type": "string", + "id": 7 + }, "policy": { "type": "google.iam.v1.Policy", "id": 3 diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 6b9f6c59226..88fb9bab153 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -2220,6 +2220,10 @@ export class AssetServiceClient { * * `resource:(instance1 OR instance2) policy:amy` to find * IAM policy bindings that are set on resources "instance1" or * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the "user" + * member type. * @param {number} [request.pageSize] * Optional. The page size for search result pagination. Page size is capped at 500 even * if a larger value is given. If set to zero, server will pick an appropriate @@ -2230,6 +2234,34 @@ export class AssetServiceClient { * this method. `page_token` must be the value of `next_page_token` from the * previous response. The values of all other method parameters must be * identical to those in the previous call. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not 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. @@ -2343,6 +2375,10 @@ export class AssetServiceClient { * * `resource:(instance1 OR instance2) policy:amy` to find * IAM policy bindings that are set on resources "instance1" or * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the "user" + * member type. * @param {number} [request.pageSize] * Optional. The page size for search result pagination. Page size is capped at 500 even * if a larger value is given. If set to zero, server will pick an appropriate @@ -2353,6 +2389,34 @@ export class AssetServiceClient { * this method. `page_token` must be the value of `next_page_token` from the * previous response. The values of all other method parameters must be * identical to those in the previous call. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2444,6 +2508,10 @@ export class AssetServiceClient { * * `resource:(instance1 OR instance2) policy:amy` to find * IAM policy bindings that are set on resources "instance1" or * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the "user" + * member type. * @param {number} [request.pageSize] * Optional. The page size for search result pagination. Page size is capped at 500 even * if a larger value is given. If set to zero, server will pick an appropriate @@ -2454,6 +2522,34 @@ export class AssetServiceClient { * this method. `page_token` must be the value of `next_page_token` from the * previous response. The values of all other method parameters must be * identical to those in the previous call. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index 7c1413ed716..e192e970d3f 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -64,13 +64,13 @@ "retry_params_name": "default" }, "SearchAllResources": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", + "timeout_millis": 30000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "SearchAllIamPolicies": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", + "timeout_millis": 30000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "AnalyzeIamPolicy": { From 314d1d97d1dc2993ca4c0f6ae5abf98e75e0304f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:14:41 +0000 Subject: [PATCH 333/429] chore: release 3.15.0 (#516) :robot: I have created a release \*beep\* \*boop\* --- ## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30) ### Features * add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies ([#511](https://www.github.com/googleapis/nodejs-asset/issues/511)) ([1dfb0e9](https://www.github.com/googleapis/nodejs-asset/commit/1dfb0e95c58fdfbca2807744ea22c52d3c6e7651)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index b0fdecb8554..45ae5752f69 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30) + + +### Features + +* add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies ([#511](https://www.github.com/googleapis/nodejs-asset/issues/511)) ([1dfb0e9](https://www.github.com/googleapis/nodejs-asset/commit/1dfb0e95c58fdfbca2807744ea22c52d3c6e7651)) + ### [3.14.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.0...v3.14.1) (2021-06-22) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 6ae1d94f5f4..4577c647bba 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.14.1", + "version": "3.15.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 9b32115e5e8..e316c93f689 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.14.1", + "@google-cloud/asset": "^3.15.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 1bea9c5da354bd1293586aa2259723adb5186efe Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 30 Jun 2021 12:26:30 -0400 Subject: [PATCH 334/429] fix(deps): google-gax v2.17.0 with mTLS (#514) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 4577c647bba..21b0eae6c56 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -44,7 +44,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 37f6447be765df480016bff8e4724b127bca566d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:40:51 +0000 Subject: [PATCH 335/429] chore: release 3.15.1 (#519) :robot: I have created a release \*beep\* \*boop\* --- ### [3.15.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.0...v3.15.1) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#514](https://www.github.com/googleapis/nodejs-asset/issues/514)) ([85e0ebd](https://www.github.com/googleapis/nodejs-asset/commit/85e0ebd92f326ce52f3a920a8cea9d392ff821b5)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 45ae5752f69..ff518dcb6a7 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.15.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.0...v3.15.1) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#514](https://www.github.com/googleapis/nodejs-asset/issues/514)) ([85e0ebd](https://www.github.com/googleapis/nodejs-asset/commit/85e0ebd92f326ce52f3a920a8cea9d392ff821b5)) + ## [3.15.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.14.1...v3.15.0) (2021-06-30) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 21b0eae6c56..3feb7d3353a 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.15.0", + "version": "3.15.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index e316c93f689..ae70cedad22 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.15.0", + "@google-cloud/asset": "^3.15.1", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 38b26d2f717e88b268dbb7bdb192b757f531404d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:44:32 -0400 Subject: [PATCH 336/429] fix(deps): google-gax v2.17.1 (#520) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 3feb7d3353a..0018eaf9cb0 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -44,7 +44,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 6764698fbae3c5d05bbcbda0c065210b28351312 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:06:19 +0000 Subject: [PATCH 337/429] chore: release 3.15.2 (#521) :robot: I have created a release \*beep\* \*boop\* --- ### [3.15.2](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.1...v3.15.2) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#520](https://www.github.com/googleapis/nodejs-asset/issues/520)) ([24afa66](https://www.github.com/googleapis/nodejs-asset/commit/24afa6682619539c472da03ac813d915d62576b9)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index ff518dcb6a7..419813bf6f4 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.15.2](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.1...v3.15.2) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#520](https://www.github.com/googleapis/nodejs-asset/issues/520)) ([24afa66](https://www.github.com/googleapis/nodejs-asset/commit/24afa6682619539c472da03ac813d915d62576b9)) + ### [3.15.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.0...v3.15.1) (2021-06-30) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 0018eaf9cb0..0aa3aff0106 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.15.1", + "version": "3.15.2", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ae70cedad22..2ae16011018 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.15.1", + "@google-cloud/asset": "^3.15.2", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 5f415d114310b6867b8025054a94025390d5d121 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:08:34 +0000 Subject: [PATCH 338/429] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#522) 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 --- .../google-cloud-asset/src/v1/asset_service_client.ts | 11 ++++++++++- .../src/v1p1beta1/asset_service_client.ts | 11 ++++++++++- .../src/v1p2beta1/asset_service_client.ts | 11 ++++++++++- .../src/v1p4beta1/asset_service_client.ts | 11 ++++++++++- .../src/v1p5beta1/asset_service_client.ts | 11 ++++++++++- 5 files changed, 50 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 88fb9bab153..b70e9b62431 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class AssetServiceClient { 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 AssetServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class AssetServiceClient { const staticMembers = this.constructor as typeof AssetServiceClient; 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 = @@ -241,6 +246,9 @@ export class AssetServiceClient { // 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; } /** @@ -269,7 +277,8 @@ export class AssetServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1.AssetService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index f59a2a7d72d..a749e2e655d 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class AssetServiceClient { 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: {}; @@ -59,6 +60,7 @@ export class AssetServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -101,6 +103,9 @@ export class AssetServiceClient { const staticMembers = this.constructor as typeof AssetServiceClient; 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 = @@ -176,6 +181,9 @@ export class AssetServiceClient { // 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; } /** @@ -204,7 +212,8 @@ export class AssetServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p1beta1.AssetService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 8416b8a9231..f3e6ca6b1a2 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -39,6 +39,7 @@ const version = require('../../../package.json').version; export class AssetServiceClient { 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: {}; @@ -50,6 +51,7 @@ export class AssetServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -93,6 +95,9 @@ export class AssetServiceClient { const staticMembers = this.constructor as typeof AssetServiceClient; 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 = @@ -167,6 +172,9 @@ export class AssetServiceClient { // 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; } /** @@ -195,7 +203,8 @@ export class AssetServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p2beta1.AssetService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 6ee2ff6b735..e9741134f50 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -45,6 +45,7 @@ const version = require('../../../package.json').version; export class AssetServiceClient { 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: {}; @@ -56,6 +57,7 @@ export class AssetServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; operationsClient: gax.OperationsClient; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -99,6 +101,9 @@ export class AssetServiceClient { const staticMembers = this.constructor as typeof AssetServiceClient; 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 = @@ -189,6 +194,9 @@ export class AssetServiceClient { // 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; } /** @@ -217,7 +225,8 @@ export class AssetServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p4beta1.AssetService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index ada5ebb2f72..117005ceef5 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class AssetServiceClient { 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: {}; @@ -59,6 +60,7 @@ export class AssetServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; assetServiceStub?: Promise<{[name: string]: Function}>; @@ -101,6 +103,9 @@ export class AssetServiceClient { const staticMembers = this.constructor as typeof AssetServiceClient; 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 = @@ -171,6 +176,9 @@ export class AssetServiceClient { // 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; } /** @@ -199,7 +207,8 @@ export class AssetServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.asset.v1p5beta1.AssetService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 39efe6a0a4e254970b34d0cc9b818ec2ffd53366 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:56:11 -0700 Subject: [PATCH 339/429] chore: release 3.15.3 (#523) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 419813bf6f4..dd49a38bfe0 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.15.3](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.2...v3.15.3) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#522](https://www.github.com/googleapis/nodejs-asset/issues/522)) ([015b801](https://www.github.com/googleapis/nodejs-asset/commit/015b80196ecd3b6a0cba17ea0971f4c585b8f972)) + ### [3.15.2](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.1...v3.15.2) (2021-07-12) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 0aa3aff0106..b90e5d6c335 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.15.2", + "version": "3.15.3", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 2ae16011018..3fd6b8f73a7 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.15.2", + "@google-cloud/asset": "^3.15.3", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From bf2078969940460361ec8436e60145bfb773d72a Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:04:26 -0400 Subject: [PATCH 340/429] chore(nodejs): update client ref docs link in metadata (#531) --- packages/google-cloud-asset/.repo-metadata.json | 2 +- packages/google-cloud-asset/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index 139eb06e3ae..697794be066 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "asset", "name_pretty": "Cloud Asset Inventory", "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", - "client_documentation": "https://googleapis.dev/nodejs/asset/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/asset/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", "release_level": "ga", "language": "nodejs", diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 0ddb14d8a80..0a13aff51e8 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -171,7 +171,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/asset/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From cef2db236493a3697fb2489465884f13553a4fc0 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 11 Aug 2021 11:08:29 -0400 Subject: [PATCH 341/429] fix(build): migrate to using main branch (#534) --- packages/google-cloud-asset/README.md | 42 +++++++++---------- packages/google-cloud-asset/samples/README.md | 28 ++++++------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 0a13aff51e8..d30519cd46b 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) @@ -15,7 +15,7 @@ Cloud Asset API client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-asset/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-asset/blob/main/CHANGELOG.md). * [Cloud Asset Inventory Node.js Client API Reference][client-docs] * [Cloud Asset Inventory Documentation][product-docs] @@ -91,24 +91,24 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/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-asset/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Analyze Iam Policy | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) | -| Analyze Iam Policy Longrunning and write results to Bigquery | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) | -| Analyze Iam Policy Longrunning and write results to GCS | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningGcs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) | -| Create Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/createFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) | -| Delete Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/deleteFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) | -| Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | -| Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | -| Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | -| List Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) | -| List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | -| Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Search All Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) | -| Search All Resources | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllResources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) | -| Update Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/updateFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) | +| Analyze Iam Policy | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) | +| Analyze Iam Policy Longrunning and write results to Bigquery | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) | +| Analyze Iam Policy Longrunning and write results to GCS | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningGcs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) | +| Create Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/createFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) | +| Delete Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/deleteFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) | +| Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | +| Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | +| Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | +| List Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) | +| List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | +| Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Search All Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) | +| Search All Resources | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllResources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) | +| Update Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/updateFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) | @@ -157,19 +157,19 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/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-asset/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index aa7a6640204..f1b21c7214d 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -46,7 +46,7 @@ Before running the samples, make sure you've followed the steps outlined in Analyzes accessible IAM policies that match a request. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicy.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicy.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) @@ -65,7 +65,7 @@ __Usage:__ Analyzes accessible IAM policies that match a request. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningBigquery.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningBigquery.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) @@ -84,7 +84,7 @@ __Usage:__ Analyzes accessible IAM policies that match a request. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/analyzeIamPolicyLongrunningGcs.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningGcs.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) @@ -103,7 +103,7 @@ __Usage:__ Create Feed. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/createFeed.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/createFeed.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) @@ -122,7 +122,7 @@ __Usage:__ Delete Feed. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/deleteFeed.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/deleteFeed.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) @@ -141,7 +141,7 @@ __Usage:__ Export asserts to specified dump file path. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/exportAssets.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssets.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) @@ -160,7 +160,7 @@ __Usage:__ Batch get history of assets. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getBatchAssetHistory.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchAssetHistory.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) @@ -179,7 +179,7 @@ __Usage:__ Get Feed. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/getFeed.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getFeed.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) @@ -198,7 +198,7 @@ __Usage:__ List assets under the current project. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listAssets.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listAssets.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) @@ -217,7 +217,7 @@ __Usage:__ List Feeds. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/listFeeds.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listFeeds.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) @@ -236,7 +236,7 @@ __Usage:__ Batch get history of assets. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) @@ -255,7 +255,7 @@ __Usage:__ Search All Iam Policies. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllIamPolicies.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllIamPolicies.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) @@ -274,7 +274,7 @@ __Usage:__ Search All Resources. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/searchAllResources.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllResources.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) @@ -293,7 +293,7 @@ __Usage:__ Update Feed. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/master/samples/updateFeed.js). +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/updateFeed.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) From d327fa17e794952d8ed6e0b01f4f6644f2a50d05 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 342/429] chore: release 3.15.4 (#535) :robot: I have created a release \*beep\* \*boop\* --- ### [3.15.4](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.3...v3.15.4) (2021-08-11) ### Bug Fixes * **build:** migrate to using main branch ([#534](https://www.github.com/googleapis/nodejs-asset/issues/534)) ([30fa2c4](https://www.github.com/googleapis/nodejs-asset/commit/30fa2c48abe3de2a9482ea5bde9a4f315a726b89)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index dd49a38bfe0..68e98d4692a 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.15.4](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.3...v3.15.4) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#534](https://www.github.com/googleapis/nodejs-asset/issues/534)) ([30fa2c4](https://www.github.com/googleapis/nodejs-asset/commit/30fa2c48abe3de2a9482ea5bde9a4f315a726b89)) + ### [3.15.3](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.2...v3.15.3) (2021-07-16) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b90e5d6c335..82033b635f1 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.15.3", + "version": "3.15.4", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 3fd6b8f73a7..a3e53586c13 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.15.3", + "@google-cloud/asset": "^3.15.4", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From db68d86f7697c82b2d63629151f402f3f4825aca Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:25:18 -0700 Subject: [PATCH 343/429] fix: failing tests for LRO check methods (#530) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat!: *Change metadata field for the AnalyzeIamPolicyLongrunning. feat: Add AnalyzeMove API. feat: Add read_mask field for SearchAllResourcesRequest feat:Add VersionedResource/AttachedResource fields for ResourceSearchResult Committer: @alexander-fenster PiperOrigin-RevId: 387841814 PiperOrigin-RevId: 387216202 PiperOrigin-RevId: 386530026 --- .../google/cloud/asset/v1/asset_service.proto | 141 +- .../protos/google/cloud/asset/v1/assets.proto | 64 +- .../google-cloud-asset/protos/protos.d.ts | 1396 ++++++++-- packages/google-cloud-asset/protos/protos.js | 2403 +++++++++++++++-- .../google-cloud-asset/protos/protos.json | 181 +- .../src/v1/asset_service_client.ts | 336 ++- .../src/v1/asset_service_client_config.json | 4 + .../src/v1/gapic_metadata.json | 10 + .../src/v1p5beta1/asset_service_client.ts | 121 + .../test/gapic_asset_service_v1.ts | 262 +- .../test/gapic_asset_service_v1p5beta1.ts | 149 + 11 files changed, 4517 insertions(+), 550 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 59f517bb07d..73ffa9e47e3 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -27,6 +27,7 @@ import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; import "google/type/expr.proto"; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -165,7 +166,7 @@ service AssetService { // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation // status. We recommend intervals of at least 2 seconds with exponential // backoff retry to poll the operation result. The metadata contains the - // request to help callers to map responses to requests. + // metadata for the long-running operation. rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning" @@ -173,9 +174,28 @@ service AssetService { }; option (google.longrunning.operation_info) = { response_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse" - metadata_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" + metadata_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata" }; } + + // Analyze moving a resource to a specified destination without kicking off + // the actual move. The analysis is best effort depending on the user's + // permissions of viewing different hierarchical policies and configurations. + // The policies and configuration are subject to change before the actual + // resource migration takes place. + rpc AnalyzeMove(AnalyzeMoveRequest) returns (AnalyzeMoveResponse) { + option (google.api.http) = { + get: "/v1/{resource=*/*}:analyzeMove" + }; + } +} + +// Represents the metadata of the longrunning operation for the +// AnalyzeIamPolicyLongrunning rpc. +message AnalyzeIamPolicyLongrunningMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Export asset request. @@ -659,7 +679,7 @@ message Feed { // optional. // // See our [user - // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes#feed_with_condition) + // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) // for detailed instructions. google.type.Expr condition = 6; } @@ -703,8 +723,8 @@ message SearchAllResourcesRequest { // encryption key whose name contains the word "key". // * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a // word. - // * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state - // doesn't contain "ACTIVE" as a word. + // * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain + // "ACTIVE" as a word. // * `createTime<1609459200` to find Cloud resources that were created before // "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of // "2021-01-01 00:00:00 UTC" in seconds. @@ -754,6 +774,7 @@ message SearchAllResourcesRequest { // to indicate descending order. Redundant space characters are ignored. // Example: "location DESC, name". // Only singular primitive fields in the response are sortable: + // // * name // * assetType // * project @@ -766,10 +787,41 @@ message SearchAllResourcesRequest { // * state // * parentFullResourceName // * parentAssetType + // // All the other fields such as repeated fields (e.g., `networkTags`), map // fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) // are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields specifying which fields to be returned in + // ResourceSearchResult. Only '*' or combination of top level fields can be + // specified. Field names of both snake_case and camelCase are supported. + // Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + // + // The read_mask paths must be valid field paths listed but not limited to + // (both snake_case and camelCase are supported): + // + // * name + // * assetType + // * project + // * displayName + // * description + // * location + // * labels + // * networkTags + // * kmsKey + // * createTime + // * updateTime + // * state + // * additionalAttributes + // * versionedResources + // + // If read_mask is not specified, all fields except versionedResources will + // be returned. + // If only '*' is specified, all fields including versionedResources will be + // returned. + // Any invalid field path will trigger INVALID_ARGUMENT error. + google.protobuf.FieldMask read_mask = 8 [(google.api.field_behavior) = OPTIONAL]; } // Search all resources response. @@ -1203,7 +1255,84 @@ message AnalyzeIamPolicyLongrunningRequest { } // A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. -message AnalyzeIamPolicyLongrunningResponse {} +message AnalyzeIamPolicyLongrunningResponse { + +} + +// The request message for performing resource move analysis. +message AnalyzeMoveRequest { + // View enum for supporting partial analysis responses. + enum AnalysisView { + // The default/unset value. + // The API will default to the FULL view. + ANALYSIS_VIEW_UNSPECIFIED = 0; + + // Full analysis including all level of impacts of the specified resource + // move. + FULL = 1; + + // Basic analysis only including blockers which will prevent the specified + // resource move at runtime. + BASIC = 2; + } + + // Required. Name of the resource to perform the analysis against. + // Only GCP Project are supported as of today. Hence, this can only be Project + // ID (such as "projects/my-project-id") or a Project Number (such as + // "projects/12345"). + string resource = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the GCP Folder or Organization to reparent the target + // resource. The analysis will be performed against hypothetically moving the + // resource to this specified desitination parent. This can only be a Folder + // number (such as "folders/123") or an Organization number (such as + // "organizations/123"). + string destination_parent = 2 [(google.api.field_behavior) = REQUIRED]; + + // Analysis view indicating what information should be included in the + // analysis response. If unspecified, the default view is FULL. + AnalysisView view = 3; +} + +// The response message for resource move analysis. +message AnalyzeMoveResponse { + // The list of analyses returned from performing the intended resource move + // analysis. The analysis is grouped by different Cloud services. + repeated MoveAnalysis move_analysis = 1; +} + +// A message to group the analysis information. +message MoveAnalysis { + // The user friendly display name of the analysis. E.g. IAM, Organization + // Policy etc. + string display_name = 1; + + oneof result { + // Analysis result of moving the target resource. + MoveAnalysisResult analysis = 2; + + // Description of error encountered when performing the analysis. + google.rpc.Status error = 3; + } +} + +// An analysis result including blockers and warnings. +message MoveAnalysisResult { + // Blocking information that would prevent the target resource from moving + // to the specified destination at runtime. + repeated MoveImpact blockers = 1; + + // Warning information indicating that moving the target resource to the + // specified destination might be unsafe. This can include important policy + // information and configuration changes, but will not block moves at runtime. + repeated MoveImpact warnings = 2; +} + +// A message to group impacts of moving the target resource. +message MoveImpact { + // User friendly impact detail in a free form message. + string detail = 1; +} // Asset content type. enum ContentType { diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index a607784e82c..7a9d47df011 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -23,11 +23,9 @@ import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; -import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -420,6 +418,24 @@ message ResourceSearchResult { // `project-name` string parent_full_resource_name = 19; + // Versioned resource representations of this resource. This is repeated + // because there could be multiple versions of resource representations during + // version migration. + // + // This `versioned_resources` field is not searchable. Some attributes of the + // resource representations are exposed in `additional_attributes` field, so + // as to allow users to search on them. + repeated VersionedResource versioned_resources = 16; + + // Attached resources of this resource. For example, an OSConfig + // Inventory is an attached resource of a Compute Instance. This field is + // repeated because a resource could have multiple attached resources. + // + // This `attached_resources` field is not searchable. Some attributes + // of the attached resources are exposed in `additional_attributes` field, so + // as to allow users to search on them. + repeated AttachedResource attached_resources = 20; + // The type of this resource's immediate parent, if there is one. // // To search against the `parent_asset_type`: @@ -431,6 +447,50 @@ message ResourceSearchResult { string parent_asset_type = 103; } +// Resource representation as defined by the corresponding service providing the +// resource for a given API version. +message VersionedResource { + // API version of the resource. + // + // Example: + // If the resource is an instance provided by Compute Engine v1 API as defined + // in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, + // version will be "v1". + string version = 1; + + // JSON representation of the resource as defined by the corresponding + // service providing this resource. + // + // Example: + // If the resource is an instance provided by Compute Engine, this field will + // contain the JSON representation of the instance as defined by Compute + // Engine: + // `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. + // + // You can find the resource definition for each supported resource type in + // this table: + // `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types` + google.protobuf.Struct resource = 2; +} + +// Attached resource representation, which is defined by the corresponding +// service provider. It represents an attached resource's payload. +message AttachedResource { + // The type of this attached resource. + // + // Example: `osconfig.googleapis.com/Inventory` + // + // You can find the supported attached asset types of each resource in this + // table: + // `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types` + string asset_type = 1; + + // Versioned resource representations of this attached resource. This is + // repeated because there could be multiple versions of the attached resource + // representations during version migration. + repeated VersionedResource versioned_resources = 3; +} + // A result of IAM Policy search, containing information of an IAM policy. message IamPolicySearchResult { // Explanation about the IAM policy search result. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index fb2fc4b3fa5..3ee73be55b6 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -213,6 +213,20 @@ export namespace google { * @returns Promise */ public analyzeIamPolicyLongrunning(request: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest): Promise; + + /** + * Calls AnalyzeMove. + * @param request AnalyzeMoveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeMoveResponse + */ + public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeMoveCallback): void; + + /** + * Calls AnalyzeMove. + * @param request AnalyzeMoveRequest message or plain object + * @returns Promise + */ + public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest): Promise; } namespace AssetService { @@ -300,6 +314,103 @@ export namespace google { * @param [response] Operation */ type AnalyzeIamPolicyLongrunningCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeMove}. + * @param error Error, if any + * @param [response] AnalyzeMoveResponse + */ + type AnalyzeMoveCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeMoveResponse) => void; + } + + /** Properties of an AnalyzeIamPolicyLongrunningMetadata. */ + interface IAnalyzeIamPolicyLongrunningMetadata { + + /** AnalyzeIamPolicyLongrunningMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AnalyzeIamPolicyLongrunningMetadata. */ + class AnalyzeIamPolicyLongrunningMetadata implements IAnalyzeIamPolicyLongrunningMetadata { + + /** + * Constructs a new AnalyzeIamPolicyLongrunningMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata); + + /** AnalyzeIamPolicyLongrunningMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new AnalyzeIamPolicyLongrunningMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyLongrunningMetadata instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyLongrunningMetadata + * @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.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyLongrunningMetadata + * @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.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Verifies an AnalyzeIamPolicyLongrunningMetadata 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 AnalyzeIamPolicyLongrunningMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyLongrunningMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningMetadata message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyLongrunningMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyLongrunningMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } /** Properties of an ExportAssetsRequest. */ @@ -2414,6 +2525,9 @@ export namespace google { /** SearchAllResourcesRequest orderBy */ orderBy?: (string|null); + + /** SearchAllResourcesRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); } /** Represents a SearchAllResourcesRequest. */ @@ -2443,6 +2557,9 @@ export namespace google { /** SearchAllResourcesRequest orderBy. */ public orderBy: string; + /** SearchAllResourcesRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + /** * Creates a new SearchAllResourcesRequest instance using the specified properties. * @param [properties] Properties to set @@ -4236,298 +4353,791 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5, - OS_INVENTORY = 6 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** Properties of an AnalyzeMoveRequest. */ + interface IAnalyzeMoveRequest { - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** AnalyzeMoveRequest resource */ + resource?: (string|null); - /** TemporalAsset priorAssetState */ - priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + /** AnalyzeMoveRequest destinationParent */ + destinationParent?: (string|null); - /** TemporalAsset priorAsset */ - priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** AnalyzeMoveRequest view */ + view?: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an AnalyzeMoveRequest. */ + class AnalyzeMoveRequest implements IAnalyzeMoveRequest { /** - * Constructs a new TemporalAsset. + * Constructs a new AnalyzeMoveRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest); - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + /** AnalyzeMoveRequest resource. */ + public resource: string; - /** TemporalAsset priorAssetState. */ - public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + /** AnalyzeMoveRequest destinationParent. */ + public destinationParent: string; - /** TemporalAsset priorAsset. */ - public priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** AnalyzeMoveRequest view. */ + public view: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new AnalyzeMoveRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns AnalyzeMoveRequest instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns AnalyzeMoveRequest * @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.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns AnalyzeMoveRequest * @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.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Verifies a TemporalAsset message. + * Verifies an AnalyzeMoveRequest 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns AnalyzeMoveRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @param message AnalyzeMoveRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this AnalyzeMoveRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace TemporalAsset { + namespace AnalyzeMoveRequest { - /** PriorAssetState enum. */ - enum PriorAssetState { - PRIOR_ASSET_STATE_UNSPECIFIED = 0, - PRESENT = 1, - INVALID = 2, - DOES_NOT_EXIST = 3, - DELETED = 4 + /** AnalysisView enum. */ + enum AnalysisView { + ANALYSIS_VIEW_UNSPECIFIED = 0, + FULL = 1, + BASIC = 2 } } - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of an AnalyzeMoveResponse. */ + interface IAnalyzeMoveResponse { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** AnalyzeMoveResponse moveAnalysis */ + moveAnalysis?: (google.cloud.asset.v1.IMoveAnalysis[]|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an AnalyzeMoveResponse. */ + class AnalyzeMoveResponse implements IAnalyzeMoveResponse { /** - * Constructs a new TimeWindow. + * Constructs a new AnalyzeMoveResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** AnalyzeMoveResponse moveAnalysis. */ + public moveAnalysis: google.cloud.asset.v1.IMoveAnalysis[]; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new AnalyzeMoveResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns AnalyzeMoveResponse instance */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns AnalyzeMoveResponse * @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.asset.v1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns AnalyzeMoveResponse * @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.asset.v1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Verifies a TimeWindow message. + * Verifies an AnalyzeMoveResponse 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. + * Creates an AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns AnalyzeMoveResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. + * @param message AnalyzeMoveResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this AnalyzeMoveResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); + /** Properties of a MoveAnalysis. */ + interface IMoveAnalysis { - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** MoveAnalysis displayName */ + displayName?: (string|null); - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** MoveAnalysis analysis */ + analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + /** MoveAnalysis error */ + error?: (google.rpc.IStatus|null); + } - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + /** Represents a MoveAnalysis. */ + class MoveAnalysis implements IMoveAnalysis { - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + /** + * Constructs a new MoveAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IMoveAnalysis); - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + /** MoveAnalysis displayName. */ + public displayName: string; - /** Asset osInventory */ - osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** MoveAnalysis analysis. */ + public analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); - /** Asset ancestors */ - ancestors?: (string[]|null); - } + /** MoveAnalysis error. */ + public error?: (google.rpc.IStatus|null); - /** Represents an Asset. */ - class Asset implements IAsset { + /** MoveAnalysis result. */ + public result?: ("analysis"|"error"); /** - * Constructs a new Asset. + * Creates a new MoveAnalysis instance using the specified properties. * @param [properties] Properties to set + * @returns MoveAnalysis instance */ - constructor(properties?: google.cloud.asset.v1.IAsset); + public static create(properties?: google.cloud.asset.v1.IMoveAnalysis): google.cloud.asset.v1.MoveAnalysis; - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset name. */ - public name: string; + /** + * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; - /** Asset assetType. */ - public assetType: string; + /** + * Decodes a MoveAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveAnalysis + * @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.asset.v1.MoveAnalysis; - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); + /** + * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveAnalysis + * @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.asset.v1.MoveAnalysis; - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** + * Verifies a MoveAnalysis 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 MoveAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysis; + + /** + * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. + * @param message MoveAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.MoveAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MoveAnalysisResult. */ + interface IMoveAnalysisResult { + + /** MoveAnalysisResult blockers */ + blockers?: (google.cloud.asset.v1.IMoveImpact[]|null); + + /** MoveAnalysisResult warnings */ + warnings?: (google.cloud.asset.v1.IMoveImpact[]|null); + } + + /** Represents a MoveAnalysisResult. */ + class MoveAnalysisResult implements IMoveAnalysisResult { + + /** + * Constructs a new MoveAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IMoveAnalysisResult); + + /** MoveAnalysisResult blockers. */ + public blockers: google.cloud.asset.v1.IMoveImpact[]; + + /** MoveAnalysisResult warnings. */ + public warnings: google.cloud.asset.v1.IMoveImpact[]; + + /** + * Creates a new MoveAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IMoveAnalysisResult): google.cloud.asset.v1.MoveAnalysisResult; + + /** + * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveAnalysisResult + * @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.asset.v1.MoveAnalysisResult; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveAnalysisResult + * @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.asset.v1.MoveAnalysisResult; + + /** + * Verifies a MoveAnalysisResult 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 MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysisResult; + + /** + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @param message MoveAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.MoveAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MoveImpact. */ + interface IMoveImpact { + + /** MoveImpact detail */ + detail?: (string|null); + } + + /** Represents a MoveImpact. */ + class MoveImpact implements IMoveImpact { + + /** + * Constructs a new MoveImpact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IMoveImpact); + + /** MoveImpact detail. */ + public detail: string; + + /** + * Creates a new MoveImpact instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveImpact instance + */ + public static create(properties?: google.cloud.asset.v1.IMoveImpact): google.cloud.asset.v1.MoveImpact; + + /** + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveImpact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveImpact + * @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.asset.v1.MoveImpact; + + /** + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveImpact + * @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.asset.v1.MoveImpact; + + /** + * Verifies a MoveImpact 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 MoveImpact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveImpact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveImpact; + + /** + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @param message MoveImpact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.MoveImpact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveImpact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5, + OS_INVENTORY = 6 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @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.asset.v1.TemporalAsset; + + /** + * Verifies a TemporalAsset 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TemporalAsset { + + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } + + /** 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.asset.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.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.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.asset.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.asset.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.asset.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.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory */ + osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); /** Asset orgPolicy. */ public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; @@ -4798,6 +5408,12 @@ export namespace google { /** ResourceSearchResult parentFullResourceName */ parentFullResourceName?: (string|null); + /** ResourceSearchResult versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + + /** ResourceSearchResult attachedResources */ + attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); + /** ResourceSearchResult parentAssetType */ parentAssetType?: (string|null); } @@ -4832,102 +5448,300 @@ export namespace google { /** ResourceSearchResult description. */ public description: string; - /** ResourceSearchResult location. */ - public location: string; + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult kmsKey. */ + public kmsKey: string; + + /** ResourceSearchResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state. */ + public state: string; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName. */ + public parentFullResourceName: string; + + /** ResourceSearchResult versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** ResourceSearchResult attachedResources. */ + public attachedResources: google.cloud.asset.v1.IAttachedResource[]; + + /** ResourceSearchResult parentAssetType. */ + public parentAssetType: string; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Verifies a ResourceSearchResult 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VersionedResource. */ + interface IVersionedResource { + + /** VersionedResource version */ + version?: (string|null); + + /** VersionedResource resource */ + resource?: (google.protobuf.IStruct|null); + } + + /** Represents a VersionedResource. */ + class VersionedResource implements IVersionedResource { + + /** + * Constructs a new VersionedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IVersionedResource); + + /** VersionedResource version. */ + public version: string; + + /** VersionedResource resource. */ + public resource?: (google.protobuf.IStruct|null); + + /** + * Creates a new VersionedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IVersionedResource): google.cloud.asset.v1.VersionedResource; + + /** + * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedResource + * @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.asset.v1.VersionedResource; + + /** + * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedResource + * @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.asset.v1.VersionedResource; + + /** + * Verifies a VersionedResource 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 VersionedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.VersionedResource; - /** ResourceSearchResult labels. */ - public labels: { [k: string]: string }; + /** + * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. + * @param message VersionedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.VersionedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ResourceSearchResult networkTags. */ - public networkTags: string[]; + /** + * Converts this VersionedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ResourceSearchResult kmsKey. */ - public kmsKey: string; + /** Properties of an AttachedResource. */ + interface IAttachedResource { - /** ResourceSearchResult createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** AttachedResource assetType */ + assetType?: (string|null); - /** ResourceSearchResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** AttachedResource versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + } - /** ResourceSearchResult state. */ - public state: string; + /** Represents an AttachedResource. */ + class AttachedResource implements IAttachedResource { - /** ResourceSearchResult additionalAttributes. */ - public additionalAttributes?: (google.protobuf.IStruct|null); + /** + * Constructs a new AttachedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAttachedResource); - /** ResourceSearchResult parentFullResourceName. */ - public parentFullResourceName: string; + /** AttachedResource assetType. */ + public assetType: string; - /** ResourceSearchResult parentAssetType. */ - public parentAssetType: string; + /** AttachedResource versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; /** - * Creates a new ResourceSearchResult instance using the specified properties. + * Creates a new AttachedResource instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceSearchResult instance + * @returns AttachedResource instance */ - public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + public static create(properties?: google.cloud.asset.v1.IAttachedResource): google.cloud.asset.v1.AttachedResource; /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes an AttachedResource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceSearchResult + * @returns AttachedResource * @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.asset.v1.ResourceSearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AttachedResource; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes an AttachedResource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceSearchResult + * @returns AttachedResource * @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.asset.v1.ResourceSearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AttachedResource; /** - * Verifies a ResourceSearchResult message. + * Verifies an AttachedResource 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an AttachedResource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceSearchResult + * @returns AttachedResource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AttachedResource; /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @param message ResourceSearchResult + * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. + * @param message AttachedResource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AttachedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceSearchResult to JSON. + * Converts this AttachedResource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -16848,102 +17662,6 @@ export namespace google { 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 Struct. */ interface IStruct { @@ -17252,6 +17970,102 @@ export namespace google { 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 { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 24b08960267..359de06a6ac 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -494,9 +494,234 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeMove}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeMoveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeMoveResponse} [response] AnalyzeMoveResponse + */ + + /** + * Calls AnalyzeMove. + * @function analyzeMove + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} request AnalyzeMoveRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeMoveCallback} callback Node-style callback called with the error, if any, and AnalyzeMoveResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeMove = function analyzeMove(request, callback) { + return this.rpcCall(analyzeMove, $root.google.cloud.asset.v1.AnalyzeMoveRequest, $root.google.cloud.asset.v1.AnalyzeMoveResponse, request, callback); + }, "name", { value: "AnalyzeMove" }); + + /** + * Calls AnalyzeMove. + * @function analyzeMove + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} request AnalyzeMoveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); + v1.AnalyzeIamPolicyLongrunningMetadata = (function() { + + /** + * Properties of an AnalyzeIamPolicyLongrunningMetadata. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyLongrunningMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] AnalyzeIamPolicyLongrunningMetadata createTime + */ + + /** + * Constructs a new AnalyzeIamPolicyLongrunningMetadata. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyLongrunningMetadata. + * @implements IAnalyzeIamPolicyLongrunningMetadata + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata=} [properties] Properties to set + */ + function AnalyzeIamPolicyLongrunningMetadata(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]]; + } + + /** + * AnalyzeIamPolicyLongrunningMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @instance + */ + AnalyzeIamPolicyLongrunningMetadata.prototype.createTime = null; + + /** + * Creates a new AnalyzeIamPolicyLongrunningMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata instance + */ + AnalyzeIamPolicyLongrunningMetadata.create = function create(properties) { + return new AnalyzeIamPolicyLongrunningMetadata(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata} message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningMetadata.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(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata} message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningMetadata.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.asset.v1.AnalyzeIamPolicyLongrunningMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyLongrunningMetadata message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyLongrunningMetadata.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; + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyLongrunningMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata + */ + AnalyzeIamPolicyLongrunningMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} message AnalyzeIamPolicyLongrunningMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyLongrunningMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.createTime = null; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this AnalyzeIamPolicyLongrunningMetadata to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyLongrunningMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalyzeIamPolicyLongrunningMetadata; + })(); + v1.ExportAssetsRequest = (function() { /** @@ -5614,6 +5839,7 @@ * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken * @property {string|null} [orderBy] SearchAllResourcesRequest orderBy + * @property {google.protobuf.IFieldMask|null} [readMask] SearchAllResourcesRequest readMask */ /** @@ -5680,6 +5906,14 @@ */ SearchAllResourcesRequest.prototype.orderBy = ""; + /** + * SearchAllResourcesRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.readMask = null; + /** * Creates a new SearchAllResourcesRequest instance using the specified properties. * @function create @@ -5717,6 +5951,8 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -5771,6 +6007,9 @@ case 6: message.orderBy = reader.string(); break; + case 8: + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -5828,6 +6067,11 @@ if (message.orderBy != null && message.hasOwnProperty("orderBy")) if (!$util.isString(message.orderBy)) return "orderBy: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } return null; }; @@ -5860,6 +6104,11 @@ message.pageToken = String(object.pageToken); if (object.orderBy != null) message.orderBy = String(object.orderBy); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } return message; }; @@ -5884,6 +6133,7 @@ object.pageSize = 0; object.pageToken = ""; object.orderBy = ""; + object.readMask = null; } if (message.scope != null && message.hasOwnProperty("scope")) object.scope = message.scope; @@ -5900,6 +6150,8 @@ object.pageToken = message.pageToken; if (message.orderBy != null && message.hasOwnProperty("orderBy")) object.orderBy = message.orderBy; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); return object; }; @@ -10017,6 +10269,1187 @@ return AnalyzeIamPolicyLongrunningResponse; })(); + v1.AnalyzeMoveRequest = (function() { + + /** + * Properties of an AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveRequest + * @property {string|null} [resource] AnalyzeMoveRequest resource + * @property {string|null} [destinationParent] AnalyzeMoveRequest destinationParent + * @property {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null} [view] AnalyzeMoveRequest view + */ + + /** + * Constructs a new AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveRequest. + * @implements IAnalyzeMoveRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + */ + function AnalyzeMoveRequest(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]]; + } + + /** + * AnalyzeMoveRequest resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.resource = ""; + + /** + * AnalyzeMoveRequest destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.destinationParent = ""; + + /** + * AnalyzeMoveRequest view. + * @member {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} view + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.view = 0; + + /** + * Creates a new AnalyzeMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest instance + */ + AnalyzeMoveRequest.create = function create(properties) { + return new AnalyzeMoveRequest(properties); + }; + + /** + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.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.asset.v1.AnalyzeMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.destinationParent = reader.string(); + break; + case 3: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeMoveRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + */ + AnalyzeMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + switch (object.view) { + case "ANALYSIS_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeMoveRequest} message AnalyzeMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.destinationParent = ""; + object.view = options.enums === String ? "ANALYSIS_VIEW_UNSPECIFIED" : 0; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + return object; + }; + + /** + * Converts this AnalyzeMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AnalysisView enum. + * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView + * @enum {number} + * @property {number} ANALYSIS_VIEW_UNSPECIFIED=0 ANALYSIS_VIEW_UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} BASIC=2 BASIC value + */ + AnalyzeMoveRequest.AnalysisView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANALYSIS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "BASIC"] = 2; + return values; + })(); + + return AnalyzeMoveRequest; + })(); + + v1.AnalyzeMoveResponse = (function() { + + /** + * Properties of an AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveResponse + * @property {Array.|null} [moveAnalysis] AnalyzeMoveResponse moveAnalysis + */ + + /** + * Constructs a new AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveResponse. + * @implements IAnalyzeMoveResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + */ + function AnalyzeMoveResponse(properties) { + this.moveAnalysis = []; + 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]]; + } + + /** + * AnalyzeMoveResponse moveAnalysis. + * @member {Array.} moveAnalysis + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @instance + */ + AnalyzeMoveResponse.prototype.moveAnalysis = $util.emptyArray; + + /** + * Creates a new AnalyzeMoveResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse instance + */ + AnalyzeMoveResponse.create = function create(properties) { + return new AnalyzeMoveResponse(properties); + }; + + /** + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moveAnalysis != null && message.moveAnalysis.length) + for (var i = 0; i < message.moveAnalysis.length; ++i) + $root.google.cloud.asset.v1.MoveAnalysis.encode(message.moveAnalysis[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveResponse.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.asset.v1.AnalyzeMoveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.moveAnalysis && message.moveAnalysis.length)) + message.moveAnalysis = []; + message.moveAnalysis.push($root.google.cloud.asset.v1.MoveAnalysis.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeMoveResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeMoveResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moveAnalysis != null && message.hasOwnProperty("moveAnalysis")) { + if (!Array.isArray(message.moveAnalysis)) + return "moveAnalysis: array expected"; + for (var i = 0; i < message.moveAnalysis.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveAnalysis.verify(message.moveAnalysis[i]); + if (error) + return "moveAnalysis." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + */ + AnalyzeMoveResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveResponse) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeMoveResponse(); + if (object.moveAnalysis) { + if (!Array.isArray(object.moveAnalysis)) + throw TypeError(".google.cloud.asset.v1.AnalyzeMoveResponse.moveAnalysis: array expected"); + message.moveAnalysis = []; + for (var i = 0; i < object.moveAnalysis.length; ++i) { + if (typeof object.moveAnalysis[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeMoveResponse.moveAnalysis: object expected"); + message.moveAnalysis[i] = $root.google.cloud.asset.v1.MoveAnalysis.fromObject(object.moveAnalysis[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeMoveResponse} message AnalyzeMoveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeMoveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.moveAnalysis = []; + if (message.moveAnalysis && message.moveAnalysis.length) { + object.moveAnalysis = []; + for (var j = 0; j < message.moveAnalysis.length; ++j) + object.moveAnalysis[j] = $root.google.cloud.asset.v1.MoveAnalysis.toObject(message.moveAnalysis[j], options); + } + return object; + }; + + /** + * Converts this AnalyzeMoveResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeMoveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalyzeMoveResponse; + })(); + + v1.MoveAnalysis = (function() { + + /** + * Properties of a MoveAnalysis. + * @memberof google.cloud.asset.v1 + * @interface IMoveAnalysis + * @property {string|null} [displayName] MoveAnalysis displayName + * @property {google.cloud.asset.v1.IMoveAnalysisResult|null} [analysis] MoveAnalysis analysis + * @property {google.rpc.IStatus|null} [error] MoveAnalysis error + */ + + /** + * Constructs a new MoveAnalysis. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveAnalysis. + * @implements IMoveAnalysis + * @constructor + * @param {google.cloud.asset.v1.IMoveAnalysis=} [properties] Properties to set + */ + function MoveAnalysis(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]]; + } + + /** + * MoveAnalysis displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + MoveAnalysis.prototype.displayName = ""; + + /** + * MoveAnalysis analysis. + * @member {google.cloud.asset.v1.IMoveAnalysisResult|null|undefined} analysis + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + MoveAnalysis.prototype.analysis = null; + + /** + * MoveAnalysis error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + MoveAnalysis.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MoveAnalysis result. + * @member {"analysis"|"error"|undefined} result + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + Object.defineProperty(MoveAnalysis.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["analysis", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MoveAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.IMoveAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis instance + */ + MoveAnalysis.create = function create(properties) { + return new MoveAnalysis(properties); + }; + + /** + * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.IMoveAnalysis} message MoveAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.analysis != null && Object.hasOwnProperty.call(message, "analysis")) + $root.google.cloud.asset.v1.MoveAnalysisResult.encode(message.analysis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.IMoveAnalysis} message MoveAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysis.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.asset.v1.MoveAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + message.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.decode(reader, reader.uint32()); + break; + case 3: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAnalysis message. + * @function verify + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.analysis != null && message.hasOwnProperty("analysis")) { + properties.result = 1; + { + var error = $root.google.cloud.asset.v1.MoveAnalysisResult.verify(message.analysis); + if (error) + return "analysis." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + return null; + }; + + /** + * Creates a MoveAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis + */ + MoveAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveAnalysis) + return object; + var message = new $root.google.cloud.asset.v1.MoveAnalysis(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.analysis != null) { + if (typeof object.analysis !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysis.analysis: object expected"); + message.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.fromObject(object.analysis); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysis.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.MoveAnalysis} message MoveAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.analysis != null && message.hasOwnProperty("analysis")) { + object.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.toObject(message.analysis, options); + if (options.oneofs) + object.result = "analysis"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + return object; + }; + + /** + * Converts this MoveAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + * @returns {Object.} JSON object + */ + MoveAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveAnalysis; + })(); + + v1.MoveAnalysisResult = (function() { + + /** + * Properties of a MoveAnalysisResult. + * @memberof google.cloud.asset.v1 + * @interface IMoveAnalysisResult + * @property {Array.|null} [blockers] MoveAnalysisResult blockers + * @property {Array.|null} [warnings] MoveAnalysisResult warnings + */ + + /** + * Constructs a new MoveAnalysisResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveAnalysisResult. + * @implements IMoveAnalysisResult + * @constructor + * @param {google.cloud.asset.v1.IMoveAnalysisResult=} [properties] Properties to set + */ + function MoveAnalysisResult(properties) { + this.blockers = []; + this.warnings = []; + 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]]; + } + + /** + * MoveAnalysisResult blockers. + * @member {Array.} blockers + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + */ + MoveAnalysisResult.prototype.blockers = $util.emptyArray; + + /** + * MoveAnalysisResult warnings. + * @member {Array.} warnings + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + */ + MoveAnalysisResult.prototype.warnings = $util.emptyArray; + + /** + * Creates a new MoveAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.IMoveAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult instance + */ + MoveAnalysisResult.create = function create(properties) { + return new MoveAnalysisResult(properties); + }; + + /** + * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.IMoveAnalysisResult} message MoveAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysisResult.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) + $root.google.cloud.asset.v1.MoveImpact.encode(message.blockers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.cloud.asset.v1.MoveImpact.encode(message.warnings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.IMoveAnalysisResult} message MoveAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.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.asset.v1.MoveAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAnalysisResult.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) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.blockers[i]); + if (error) + return "blockers." + error; + } + } + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + return null; + }; + + /** + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + */ + MoveAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); + if (object.blockers) { + if (!Array.isArray(object.blockers)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: array expected"); + message.blockers = []; + for (var i = 0; i < object.blockers.length; ++i) { + if (typeof object.blockers[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: object expected"); + message.blockers[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.blockers[i]); + } + } + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: object expected"); + message.warnings[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.warnings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.MoveAnalysisResult} message MoveAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.blockers = []; + object.warnings = []; + } + if (message.blockers && message.blockers.length) { + object.blockers = []; + for (var j = 0; j < message.blockers.length; ++j) + object.blockers[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.blockers[j], options); + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.warnings[j], options); + } + return object; + }; + + /** + * Converts this MoveAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + MoveAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveAnalysisResult; + })(); + + v1.MoveImpact = (function() { + + /** + * Properties of a MoveImpact. + * @memberof google.cloud.asset.v1 + * @interface IMoveImpact + * @property {string|null} [detail] MoveImpact detail + */ + + /** + * Constructs a new MoveImpact. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveImpact. + * @implements IMoveImpact + * @constructor + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + */ + function MoveImpact(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]]; + } + + /** + * MoveImpact detail. + * @member {string} detail + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + */ + MoveImpact.prototype.detail = ""; + + /** + * Creates a new MoveImpact instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact instance + */ + MoveImpact.create = function create(properties) { + return new MoveImpact(properties); + }; + + /** + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.detail); + return writer; + }; + + /** + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.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.asset.v1.MoveImpact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.detail = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveImpact message. + * @function verify + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveImpact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + */ + MoveImpact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveImpact) + return object; + var message = new $root.google.cloud.asset.v1.MoveImpact(); + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.MoveImpact} message MoveImpact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveImpact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.detail = ""; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + return object; + }; + + /** + * Converts this MoveImpact to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + * @returns {Object.} JSON object + */ + MoveImpact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveImpact; + })(); + /** * ContentType enum. * @name google.cloud.asset.v1.ContentType @@ -11461,6 +12894,8 @@ * @property {string|null} [state] ResourceSearchResult state * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes * @property {string|null} [parentFullResourceName] ResourceSearchResult parentFullResourceName + * @property {Array.|null} [versionedResources] ResourceSearchResult versionedResources + * @property {Array.|null} [attachedResources] ResourceSearchResult attachedResources * @property {string|null} [parentAssetType] ResourceSearchResult parentAssetType */ @@ -11476,6 +12911,8 @@ this.folders = []; this.labels = {}; this.networkTags = []; + this.versionedResources = []; + this.attachedResources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11610,6 +13047,22 @@ */ ResourceSearchResult.prototype.parentFullResourceName = ""; + /** + * ResourceSearchResult versionedResources. + * @member {Array.} versionedResources + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.versionedResources = $util.emptyArray; + + /** + * ResourceSearchResult attachedResources. + * @member {Array.} attachedResources + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.attachedResources = $util.emptyArray; + /** * ResourceSearchResult parentAssetType. * @member {string} parentAssetType @@ -11670,6 +13123,9 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.state); + if (message.versionedResources != null && message.versionedResources.length) + for (var i = 0; i < message.versionedResources.length; ++i) + $root.google.cloud.asset.v1.VersionedResource.encode(message.versionedResources[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); if (message.folders != null && message.folders.length) for (var i = 0; i < message.folders.length; ++i) writer.uint32(/* id 17, wireType 2 =*/138).string(message.folders[i]); @@ -11677,6 +13133,9 @@ writer.uint32(/* id 18, wireType 2 =*/146).string(message.organization); if (message.parentFullResourceName != null && Object.hasOwnProperty.call(message, "parentFullResourceName")) writer.uint32(/* id 19, wireType 2 =*/154).string(message.parentFullResourceName); + if (message.attachedResources != null && message.attachedResources.length) + for (var i = 0; i < message.attachedResources.length; ++i) + $root.google.cloud.asset.v1.AttachedResource.encode(message.attachedResources[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); return writer; @@ -11784,6 +13243,16 @@ case 19: message.parentFullResourceName = reader.string(); break; + case 16: + if (!(message.versionedResources && message.versionedResources.length)) + message.versionedResources = []; + message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); + break; + case 20: + if (!(message.attachedResources && message.attachedResources.length)) + message.attachedResources = []; + message.attachedResources.push($root.google.cloud.asset.v1.AttachedResource.decode(reader, reader.uint32())); + break; case 103: message.parentAssetType = reader.string(); break; @@ -11889,6 +13358,24 @@ if (message.parentFullResourceName != null && message.hasOwnProperty("parentFullResourceName")) if (!$util.isString(message.parentFullResourceName)) return "parentFullResourceName: string expected"; + if (message.versionedResources != null && message.hasOwnProperty("versionedResources")) { + if (!Array.isArray(message.versionedResources)) + return "versionedResources: array expected"; + for (var i = 0; i < message.versionedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.VersionedResource.verify(message.versionedResources[i]); + if (error) + return "versionedResources." + error; + } + } + if (message.attachedResources != null && message.hasOwnProperty("attachedResources")) { + if (!Array.isArray(message.attachedResources)) + return "attachedResources: array expected"; + for (var i = 0; i < message.attachedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.AttachedResource.verify(message.attachedResources[i]); + if (error) + return "attachedResources." + error; + } + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) if (!$util.isString(message.parentAssetType)) return "parentAssetType: string expected"; @@ -11963,6 +13450,26 @@ } if (object.parentFullResourceName != null) message.parentFullResourceName = String(object.parentFullResourceName); + if (object.versionedResources) { + if (!Array.isArray(object.versionedResources)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.versionedResources: array expected"); + message.versionedResources = []; + for (var i = 0; i < object.versionedResources.length; ++i) { + if (typeof object.versionedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.versionedResources: object expected"); + message.versionedResources[i] = $root.google.cloud.asset.v1.VersionedResource.fromObject(object.versionedResources[i]); + } + } + if (object.attachedResources) { + if (!Array.isArray(object.attachedResources)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.attachedResources: array expected"); + message.attachedResources = []; + for (var i = 0; i < object.attachedResources.length; ++i) { + if (typeof object.attachedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.attachedResources: object expected"); + message.attachedResources[i] = $root.google.cloud.asset.v1.AttachedResource.fromObject(object.attachedResources[i]); + } + } if (object.parentAssetType != null) message.parentAssetType = String(object.parentAssetType); return message; @@ -11983,7 +13490,9 @@ var object = {}; if (options.arrays || options.defaults) { object.networkTags = []; + object.versionedResources = []; object.folders = []; + object.attachedResources = []; } if (options.objects || options.defaults) object.labels = {}; @@ -12036,6 +13545,11 @@ object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.state != null && message.hasOwnProperty("state")) object.state = message.state; + if (message.versionedResources && message.versionedResources.length) { + object.versionedResources = []; + for (var j = 0; j < message.versionedResources.length; ++j) + object.versionedResources[j] = $root.google.cloud.asset.v1.VersionedResource.toObject(message.versionedResources[j], options); + } if (message.folders && message.folders.length) { object.folders = []; for (var j = 0; j < message.folders.length; ++j) @@ -12045,6 +13559,11 @@ object.organization = message.organization; if (message.parentFullResourceName != null && message.hasOwnProperty("parentFullResourceName")) object.parentFullResourceName = message.parentFullResourceName; + if (message.attachedResources && message.attachedResources.length) { + object.attachedResources = []; + for (var j = 0; j < message.attachedResources.length; ++j) + object.attachedResources[j] = $root.google.cloud.asset.v1.AttachedResource.toObject(message.attachedResources[j], options); + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) object.parentAssetType = message.parentAssetType; return object; @@ -12064,6 +13583,452 @@ return ResourceSearchResult; })(); + v1.VersionedResource = (function() { + + /** + * Properties of a VersionedResource. + * @memberof google.cloud.asset.v1 + * @interface IVersionedResource + * @property {string|null} [version] VersionedResource version + * @property {google.protobuf.IStruct|null} [resource] VersionedResource resource + */ + + /** + * Constructs a new VersionedResource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a VersionedResource. + * @implements IVersionedResource + * @constructor + * @param {google.cloud.asset.v1.IVersionedResource=} [properties] Properties to set + */ + function VersionedResource(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]]; + } + + /** + * VersionedResource version. + * @member {string} version + * @memberof google.cloud.asset.v1.VersionedResource + * @instance + */ + VersionedResource.prototype.version = ""; + + /** + * VersionedResource resource. + * @member {google.protobuf.IStruct|null|undefined} resource + * @memberof google.cloud.asset.v1.VersionedResource + * @instance + */ + VersionedResource.prototype.resource = null; + + /** + * Creates a new VersionedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.IVersionedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource instance + */ + VersionedResource.create = function create(properties) { + return new VersionedResource(properties); + }; + + /** + * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.IVersionedResource} message VersionedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.protobuf.Struct.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.IVersionedResource} message VersionedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedResource.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.asset.v1.VersionedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.resource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedResource message. + * @function verify + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.protobuf.Struct.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a VersionedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource + */ + VersionedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.VersionedResource) + return object; + var message = new $root.google.cloud.asset.v1.VersionedResource(); + if (object.version != null) + message.version = String(object.version); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.VersionedResource.resource: object expected"); + message.resource = $root.google.protobuf.Struct.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.VersionedResource} message VersionedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.resource = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.protobuf.Struct.toObject(message.resource, options); + return object; + }; + + /** + * Converts this VersionedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.VersionedResource + * @instance + * @returns {Object.} JSON object + */ + VersionedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionedResource; + })(); + + v1.AttachedResource = (function() { + + /** + * Properties of an AttachedResource. + * @memberof google.cloud.asset.v1 + * @interface IAttachedResource + * @property {string|null} [assetType] AttachedResource assetType + * @property {Array.|null} [versionedResources] AttachedResource versionedResources + */ + + /** + * Constructs a new AttachedResource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AttachedResource. + * @implements IAttachedResource + * @constructor + * @param {google.cloud.asset.v1.IAttachedResource=} [properties] Properties to set + */ + function AttachedResource(properties) { + this.versionedResources = []; + 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]]; + } + + /** + * AttachedResource assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.AttachedResource + * @instance + */ + AttachedResource.prototype.assetType = ""; + + /** + * AttachedResource versionedResources. + * @member {Array.} versionedResources + * @memberof google.cloud.asset.v1.AttachedResource + * @instance + */ + AttachedResource.prototype.versionedResources = $util.emptyArray; + + /** + * Creates a new AttachedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.IAttachedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource instance + */ + AttachedResource.create = function create(properties) { + return new AttachedResource(properties); + }; + + /** + * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.IAttachedResource} message AttachedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetType); + if (message.versionedResources != null && message.versionedResources.length) + for (var i = 0; i < message.versionedResources.length; ++i) + $root.google.cloud.asset.v1.VersionedResource.encode(message.versionedResources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.IAttachedResource} message AttachedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedResource.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.asset.v1.AttachedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetType = reader.string(); + break; + case 3: + if (!(message.versionedResources && message.versionedResources.length)) + message.versionedResources = []; + message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedResource message. + * @function verify + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.versionedResources != null && message.hasOwnProperty("versionedResources")) { + if (!Array.isArray(message.versionedResources)) + return "versionedResources: array expected"; + for (var i = 0; i < message.versionedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.VersionedResource.verify(message.versionedResources[i]); + if (error) + return "versionedResources." + error; + } + } + return null; + }; + + /** + * Creates an AttachedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource + */ + AttachedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AttachedResource) + return object; + var message = new $root.google.cloud.asset.v1.AttachedResource(); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.versionedResources) { + if (!Array.isArray(object.versionedResources)) + throw TypeError(".google.cloud.asset.v1.AttachedResource.versionedResources: array expected"); + message.versionedResources = []; + for (var i = 0; i < object.versionedResources.length; ++i) { + if (typeof object.versionedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AttachedResource.versionedResources: object expected"); + message.versionedResources[i] = $root.google.cloud.asset.v1.VersionedResource.fromObject(object.versionedResources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.AttachedResource} message AttachedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionedResources = []; + if (options.defaults) + object.assetType = ""; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.versionedResources && message.versionedResources.length) { + object.versionedResources = []; + for (var j = 0; j < message.versionedResources.length; ++j) + object.versionedResources[j] = $root.google.cloud.asset.v1.VersionedResource.toObject(message.versionedResources[j], options); + } + return object; + }; + + /** + * Converts this AttachedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AttachedResource + * @instance + * @returns {Object.} JSON object + */ + AttachedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttachedResource; + })(); + v1.IamPolicySearchResult = (function() { /** @@ -42523,225 +44488,6 @@ return Timestamp; })(); - 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.Struct = (function() { /** @@ -43556,6 +45302,225 @@ return ListValue; })(); + 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() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index f16023d6f43..f9d2d38da98 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -230,7 +230,7 @@ "(google.api.http).post": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning", "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata" }, "parsedOptions": [ { @@ -242,10 +242,35 @@ { "(google.longrunning.operation_info)": { "response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", - "metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest" + "metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata" } } ] + }, + "AnalyzeMove": { + "requestType": "AnalyzeMoveRequest", + "responseType": "AnalyzeMoveResponse", + "options": { + "(google.api.http).get": "/v1/{resource=*/*}:analyzeMove" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{resource=*/*}:analyzeMove" + } + } + ] + } + } + }, + "AnalyzeIamPolicyLongrunningMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -693,6 +718,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1070,6 +1102,92 @@ "AnalyzeIamPolicyLongrunningResponse": { "fields": {} }, + "AnalyzeMoveRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destinationParent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "view": { + "type": "AnalysisView", + "id": 3 + } + }, + "nested": { + "AnalysisView": { + "values": { + "ANALYSIS_VIEW_UNSPECIFIED": 0, + "FULL": 1, + "BASIC": 2 + } + } + } + }, + "AnalyzeMoveResponse": { + "fields": { + "moveAnalysis": { + "rule": "repeated", + "type": "MoveAnalysis", + "id": 1 + } + } + }, + "MoveAnalysis": { + "oneofs": { + "result": { + "oneof": [ + "analysis", + "error" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "analysis": { + "type": "MoveAnalysisResult", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 3 + } + } + }, + "MoveAnalysisResult": { + "fields": { + "blockers": { + "rule": "repeated", + "type": "MoveImpact", + "id": 1 + }, + "warnings": { + "rule": "repeated", + "type": "MoveImpact", + "id": 2 + } + } + }, + "MoveImpact": { + "fields": { + "detail": { + "type": "string", + "id": 1 + } + } + }, "ContentType": { "values": { "CONTENT_TYPE_UNSPECIFIED": 0, @@ -1291,12 +1409,47 @@ "type": "string", "id": 19 }, + "versionedResources": { + "rule": "repeated", + "type": "VersionedResource", + "id": 16 + }, + "attachedResources": { + "rule": "repeated", + "type": "AttachedResource", + "id": 20 + }, "parentAssetType": { "type": "string", "id": 103 } } }, + "VersionedResource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + }, + "AttachedResource": { + "fields": { + "assetType": { + "type": "string", + "id": 1 + }, + "versionedResources": { + "rule": "repeated", + "type": "VersionedResource", + "id": 3 + } + } + }, "IamPolicySearchResult": { "fields": { "resource": { @@ -4314,18 +4467,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Struct": { "fields": { "fields": { @@ -4389,6 +4530,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index b70e9b62431..bc759ef5d86 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -160,6 +160,12 @@ export class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + accessLevelPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/accessLevels/{access_level}' + ), + accessPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}' + ), folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), @@ -169,6 +175,9 @@ export class AssetServiceClient { projectFeedPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/feeds/{feed}' ), + servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' + ), }; // Some of the methods on this service return "paged" results, @@ -214,7 +223,7 @@ export class AssetServiceClient { '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse' ) as gax.protobuf.Type; const analyzeIamPolicyLongrunningMetadata = protoFilesRoot.lookup( - '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest' + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata' ) as gax.protobuf.Type; this.descriptors.longrunning = { @@ -296,6 +305,7 @@ export class AssetServiceClient { 'searchAllIamPolicies', 'analyzeIamPolicy', 'analyzeIamPolicyLongrunning', + 'analyzeMove', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -1040,6 +1050,105 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.analyzeIamPolicy(request, options, callback); } + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, + {} | undefined + ] + >; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Analyze moving a resource to a specified destination without kicking off + * the actual move. The analysis is best effort depending on the user's + * permissions of viewing different hierarchical policies and configurations. + * The policies and configuration are subject to change before the actual + * resource migration takes place. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * Required. Name of the resource to perform the analysis against. + * Only GCP Project are supported as of today. Hence, this can only be Project + * ID (such as "projects/my-project-id") or a Project Number (such as + * "projects/12345"). + * @param {string} request.destinationParent + * Required. Name of the GCP Folder or Organization to reparent the target + * resource. The analysis will be performed against hypothetically moving the + * resource to this specified desitination parent. This can only be a Folder + * number (such as "folders/123") or an Organization number (such as + * "organizations/123"). + * @param {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} request.view + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + * @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 [AnalyzeMoveResponse]{@link google.cloud.asset.v1.AnalyzeMoveResponse}. + * 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.analyzeMove(request); + */ + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | 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({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeMove(request, options, callback); + } exportAssets( request?: protos.google.cloud.asset.v1.IExportAssetsRequest, @@ -1231,7 +1340,7 @@ export class AssetServiceClient { [ LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined @@ -1243,7 +1352,7 @@ export class AssetServiceClient { callback: Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1254,7 +1363,7 @@ export class AssetServiceClient { callback: Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1269,7 +1378,7 @@ export class AssetServiceClient { * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation * status. We recommend intervals of at least 2 seconds with exponential * backoff retry to poll the operation result. The metadata contains the - * request to help callers to map responses to requests. + * metadata for the long-running operation. * * @param {Object} request * The request object that will be sent. @@ -1297,7 +1406,7 @@ export class AssetServiceClient { | Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1305,7 +1414,7 @@ export class AssetServiceClient { callback?: Callback< LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1314,7 +1423,7 @@ export class AssetServiceClient { [ LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined @@ -1362,7 +1471,7 @@ export class AssetServiceClient { ): Promise< LROperation< protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata > > { const request = new operationsProtos.google.longrunning.GetOperationRequest( @@ -1376,7 +1485,7 @@ export class AssetServiceClient { ); return decodeOperation as LROperation< protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata >; } listAssets( @@ -1741,8 +1850,8 @@ export class AssetServiceClient { * encryption key whose name contains the word "key". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. - * * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state - * doesn't contain "ACTIVE" as a word. + * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain + * "ACTIVE" as a word. * * `createTime<1609459200` to find Cloud resources that were created before * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of * "2021-01-01 00:00:00 UTC" in seconds. @@ -1788,6 +1897,7 @@ export class AssetServiceClient { * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: + * * * name * * assetType * * project @@ -1800,9 +1910,39 @@ export class AssetServiceClient { * * state * * parentFullResourceName * * parentAssetType + * * All the other fields such as repeated fields (e.g., `networkTags`), map * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * + * The read_mask paths must be valid field paths listed but not limited to + * (both snake_case and camelCase are supported): + * + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * labels + * * networkTags + * * kmsKey + * * createTime + * * updateTime + * * state + * * additionalAttributes + * * versionedResources + * + * If read_mask is not specified, all fields except versionedResources will + * be returned. + * If only '*' is specified, all fields including versionedResources will be + * returned. + * Any invalid field path will trigger INVALID_ARGUMENT error. * @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. @@ -1901,8 +2041,8 @@ export class AssetServiceClient { * encryption key whose name contains the word "key". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. - * * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state - * doesn't contain "ACTIVE" as a word. + * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain + * "ACTIVE" as a word. * * `createTime<1609459200` to find Cloud resources that were created before * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of * "2021-01-01 00:00:00 UTC" in seconds. @@ -1948,6 +2088,7 @@ export class AssetServiceClient { * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: + * * * name * * assetType * * project @@ -1960,9 +2101,39 @@ export class AssetServiceClient { * * state * * parentFullResourceName * * parentAssetType + * * All the other fields such as repeated fields (e.g., `networkTags`), map * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * + * The read_mask paths must be valid field paths listed but not limited to + * (both snake_case and camelCase are supported): + * + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * labels + * * networkTags + * * kmsKey + * * createTime + * * updateTime + * * state + * * additionalAttributes + * * versionedResources + * + * If read_mask is not specified, all fields except versionedResources will + * be returned. + * If only '*' is specified, all fields including versionedResources will be + * returned. + * Any invalid field path will trigger INVALID_ARGUMENT error. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2039,8 +2210,8 @@ export class AssetServiceClient { * encryption key whose name contains the word "key". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. - * * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state - * doesn't contain "ACTIVE" as a word. + * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain + * "ACTIVE" as a word. * * `createTime<1609459200` to find Cloud resources that were created before * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of * "2021-01-01 00:00:00 UTC" in seconds. @@ -2086,6 +2257,7 @@ export class AssetServiceClient { * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: + * * * name * * assetType * * project @@ -2098,9 +2270,39 @@ export class AssetServiceClient { * * state * * parentFullResourceName * * parentAssetType + * * All the other fields such as repeated fields (e.g., `networkTags`), map * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * + * The read_mask paths must be valid field paths listed but not limited to + * (both snake_case and camelCase are supported): + * + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * labels + * * networkTags + * * kmsKey + * * createTime + * * updateTime + * * state + * * additionalAttributes + * * versionedResources + * + * If read_mask is not specified, all fields except versionedResources will + * be returned. + * If only '*' is specified, all fields including versionedResources will be + * returned. + * Any invalid field path will trigger INVALID_ARGUMENT error. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -2600,6 +2802,68 @@ export class AssetServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified accessLevel resource name string. + * + * @param {string} access_policy + * @param {string} access_level + * @returns {string} Resource name string. + */ + accessLevelPath(accessPolicy: string, accessLevel: string) { + return this.pathTemplates.accessLevelPathTemplate.render({ + access_policy: accessPolicy, + access_level: accessLevel, + }); + } + + /** + * Parse the access_policy from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName) + .access_policy; + } + + /** + * Parse the access_level from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_level. + */ + matchAccessLevelFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName) + .access_level; + } + + /** + * Return a fully-qualified accessPolicy resource name string. + * + * @param {string} access_policy + * @returns {string} Resource name string. + */ + accessPolicyPath(accessPolicy: string) { + return this.pathTemplates.accessPolicyPathTemplate.render({ + access_policy: accessPolicy, + }); + } + + /** + * Parse the access_policy from AccessPolicy resource. + * + * @param {string} accessPolicyName + * A fully-qualified path representing AccessPolicy resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessPolicyName(accessPolicyName: string) { + return this.pathTemplates.accessPolicyPathTemplate.match(accessPolicyName) + .access_policy; + } + /** * Return a fully-qualified folderFeed resource name string. * @@ -2715,6 +2979,46 @@ export class AssetServiceClient { .feed; } + /** + * Return a fully-qualified servicePerimeter resource name string. + * + * @param {string} access_policy + * @param {string} service_perimeter + * @returns {string} Resource name string. + */ + servicePerimeterPath(accessPolicy: string, servicePerimeter: string) { + return this.pathTemplates.servicePerimeterPathTemplate.render({ + access_policy: accessPolicy, + service_perimeter: servicePerimeter, + }); + } + + /** + * Parse the access_policy from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match( + servicePerimeterName + ).access_policy; + } + + /** + * Parse the service_perimeter from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the service_perimeter. + */ + matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match( + servicePerimeterName + ).service_perimeter; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index e192e970d3f..ced7e2fd6b7 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -82,6 +82,10 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "AnalyzeMove": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/src/v1/gapic_metadata.json b/packages/google-cloud-asset/src/v1/gapic_metadata.json index 2fdd04eb95a..68aa629a313 100644 --- a/packages/google-cloud-asset/src/v1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1/gapic_metadata.json @@ -45,6 +45,11 @@ "analyzeIamPolicy" ] }, + "AnalyzeMove": { + "methods": [ + "analyzeMove" + ] + }, "ExportAssets": { "methods": [ "exportAssets" @@ -116,6 +121,11 @@ "analyzeIamPolicy" ] }, + "AnalyzeMove": { + "methods": [ + "analyzeMove" + ] + }, "ExportAssets": { "methods": [ "exportAssets" diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 117005ceef5..b4a12952a22 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -62,6 +62,7 @@ export class AssetServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; assetServiceStub?: Promise<{[name: string]: Function}>; /** @@ -153,6 +154,21 @@ export class AssetServiceClient { // 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 = { + accessLevelPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/accessLevels/{access_level}' + ), + accessPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}' + ), + servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' + ), + }; + // 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. @@ -551,6 +567,111 @@ export class AssetServiceClient { callSettings ) as AsyncIterable; } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified accessLevel resource name string. + * + * @param {string} access_policy + * @param {string} access_level + * @returns {string} Resource name string. + */ + accessLevelPath(accessPolicy: string, accessLevel: string) { + return this.pathTemplates.accessLevelPathTemplate.render({ + access_policy: accessPolicy, + access_level: accessLevel, + }); + } + + /** + * Parse the access_policy from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName) + .access_policy; + } + + /** + * Parse the access_level from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_level. + */ + matchAccessLevelFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName) + .access_level; + } + + /** + * Return a fully-qualified accessPolicy resource name string. + * + * @param {string} access_policy + * @returns {string} Resource name string. + */ + accessPolicyPath(accessPolicy: string) { + return this.pathTemplates.accessPolicyPathTemplate.render({ + access_policy: accessPolicy, + }); + } + + /** + * Parse the access_policy from AccessPolicy resource. + * + * @param {string} accessPolicyName + * A fully-qualified path representing AccessPolicy resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessPolicyName(accessPolicyName: string) { + return this.pathTemplates.accessPolicyPathTemplate.match(accessPolicyName) + .access_policy; + } + + /** + * Return a fully-qualified servicePerimeter resource name string. + * + * @param {string} access_policy + * @param {string} service_perimeter + * @returns {string} Resource name string. + */ + servicePerimeterPath(accessPolicy: string, servicePerimeter: string) { + return this.pathTemplates.servicePerimeterPathTemplate.render({ + access_policy: accessPolicy, + service_perimeter: servicePerimeter, + }); + } + + /** + * Parse the access_policy from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match( + servicePerimeterName + ).access_policy; + } + + /** + * Parse the service_perimeter from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the service_perimeter. + */ + matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match( + servicePerimeterName + ).service_perimeter; + } /** * Terminate the gRPC channel and close the client. diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 4d82a3018c2..8f0f62a9364 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -1006,6 +1006,117 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('analyzeMove', () => { + it('invokes analyzeMove without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveResponse() + ); + client.innerApiCalls.analyzeMove = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeMove(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeMove without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveResponse() + ); + client.innerApiCalls.analyzeMove = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeMove( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IAnalyzeMoveResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeMove with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeMove = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeMove(request), expectedError); + assert( + (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('exportAssets', () => { it('invokes exportAssets without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ @@ -1262,7 +1373,7 @@ describe('v1.AssetServiceClient', () => { err?: Error | null, result?: LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata > | null ) => { if (err) { @@ -1275,7 +1386,7 @@ describe('v1.AssetServiceClient', () => { }); const operation = (await promise) as LROperation< protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -2300,6 +2411,96 @@ describe('v1.AssetServiceClient', () => { }); describe('Path templates', () => { + describe('accessLevel', () => { + const fakePath = '/rendered/path/accessLevel'; + const expectedParameters = { + access_policy: 'accessPolicyValue', + access_level: 'accessLevelValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessLevelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accessLevelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accessLevelPath', () => { + const result = client.accessLevelPath( + 'accessPolicyValue', + 'accessLevelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accessLevelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccessPolicyFromAccessLevelName', () => { + const result = client.matchAccessPolicyFromAccessLevelName(fakePath); + assert.strictEqual(result, 'accessPolicyValue'); + assert( + (client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAccessLevelFromAccessLevelName', () => { + const result = client.matchAccessLevelFromAccessLevelName(fakePath); + assert.strictEqual(result, 'accessLevelValue'); + assert( + (client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('accessPolicy', () => { + const fakePath = '/rendered/path/accessPolicy'; + const expectedParameters = { + access_policy: 'accessPolicyValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accessPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accessPolicyPath', () => { + const result = client.accessPolicyPath('accessPolicyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accessPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccessPolicyFromAccessPolicyName', () => { + const result = client.matchAccessPolicyFromAccessPolicyName(fakePath); + assert.strictEqual(result, 'accessPolicyValue'); + assert( + (client.pathTemplates.accessPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('folderFeed', () => { const fakePath = '/rendered/path/folderFeed'; const expectedParameters = { @@ -2453,5 +2654,62 @@ describe('v1.AssetServiceClient', () => { ); }); }); + + describe('servicePerimeter', () => { + const fakePath = '/rendered/path/servicePerimeter'; + const expectedParameters = { + access_policy: 'accessPolicyValue', + service_perimeter: 'servicePerimeterValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servicePerimeterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servicePerimeterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servicePerimeterPath', () => { + const result = client.servicePerimeterPath( + 'accessPolicyValue', + 'servicePerimeterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.servicePerimeterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccessPolicyFromServicePerimeterName', () => { + const result = + client.matchAccessPolicyFromServicePerimeterName(fakePath); + assert.strictEqual(result, 'accessPolicyValue'); + assert( + (client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServicePerimeterFromServicePerimeterName', () => { + const result = + client.matchServicePerimeterFromServicePerimeterName(fakePath); + assert.strictEqual(result, 'servicePerimeterValue'); + assert( + (client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index afba2ecd1bb..c990f9918b7 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -479,4 +479,153 @@ describe('v1p5beta1.AssetServiceClient', () => { ); }); }); + + describe('Path templates', () => { + describe('accessLevel', () => { + const fakePath = '/rendered/path/accessLevel'; + const expectedParameters = { + access_policy: 'accessPolicyValue', + access_level: 'accessLevelValue', + }; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessLevelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accessLevelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accessLevelPath', () => { + const result = client.accessLevelPath( + 'accessPolicyValue', + 'accessLevelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accessLevelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccessPolicyFromAccessLevelName', () => { + const result = client.matchAccessPolicyFromAccessLevelName(fakePath); + assert.strictEqual(result, 'accessPolicyValue'); + assert( + (client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAccessLevelFromAccessLevelName', () => { + const result = client.matchAccessLevelFromAccessLevelName(fakePath); + assert.strictEqual(result, 'accessLevelValue'); + assert( + (client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('accessPolicy', () => { + const fakePath = '/rendered/path/accessPolicy'; + const expectedParameters = { + access_policy: 'accessPolicyValue', + }; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.accessPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('accessPolicyPath', () => { + const result = client.accessPolicyPath('accessPolicyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.accessPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccessPolicyFromAccessPolicyName', () => { + const result = client.matchAccessPolicyFromAccessPolicyName(fakePath); + assert.strictEqual(result, 'accessPolicyValue'); + assert( + (client.pathTemplates.accessPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('servicePerimeter', () => { + const fakePath = '/rendered/path/servicePerimeter'; + const expectedParameters = { + access_policy: 'accessPolicyValue', + service_perimeter: 'servicePerimeterValue', + }; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servicePerimeterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servicePerimeterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servicePerimeterPath', () => { + const result = client.servicePerimeterPath( + 'accessPolicyValue', + 'servicePerimeterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.servicePerimeterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccessPolicyFromServicePerimeterName', () => { + const result = + client.matchAccessPolicyFromServicePerimeterName(fakePath); + assert.strictEqual(result, 'accessPolicyValue'); + assert( + (client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServicePerimeterFromServicePerimeterName', () => { + const result = + client.matchServicePerimeterFromServicePerimeterName(fakePath); + assert.strictEqual(result, 'servicePerimeterValue'); + assert( + (client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); }); From 6a669d3c87c5d32e220309777484acc7867aae1e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 13:42:37 -0700 Subject: [PATCH 344/429] chore: release 3.15.5 (#536) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 68e98d4692a..449578a676a 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.15.5](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.4...v3.15.5) (2021-08-13) + + +### Bug Fixes + +* failing tests for LRO check methods ([#530](https://www.github.com/googleapis/nodejs-asset/issues/530)) ([c756cd1](https://www.github.com/googleapis/nodejs-asset/commit/c756cd12f9c5b2133c15ddec68936f737c0fa77c)) + ### [3.15.4](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.3...v3.15.4) (2021-08-11) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 82033b635f1..bb016b588b7 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.15.4", + "version": "3.15.5", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index a3e53586c13..9cc1169ff28 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.15.4", + "@google-cloud/asset": "^3.15.5", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From ec747d8bd688667e751b69de3625535a495fcd35 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 16 Aug 2021 21:00:14 +0000 Subject: [PATCH 345/429] feat: Release of relationships in v1, Add content type Relationship to support relationship export (#537) Committer: lvv@ PiperOrigin-RevId: 391065985 Source-Link: https://github.com/googleapis/googleapis/commit/b9e69f850f1c8b8c247078d90b92abdcb6aabffc Source-Link: https://github.com/googleapis/googleapis-gen/commit/6d0f250faeeb6f1458268235858cb245ace43063 --- .../google/cloud/asset/v1/asset_service.proto | 78 +- .../protos/google/cloud/asset/v1/assets.proto | 67 + .../google-cloud-asset/protos/protos.d.ts | 531 +++++-- packages/google-cloud-asset/protos/protos.js | 1387 ++++++++++++++--- .../google-cloud-asset/protos/protos.json | 107 +- .../src/v1/asset_service_client.ts | 81 + 6 files changed, 1916 insertions(+), 335 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 73ffa9e47e3..80a3da247fe 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -193,9 +193,8 @@ service AssetService { // Represents the metadata of the longrunning operation for the // AnalyzeIamPolicyLongrunning rpc. message AnalyzeIamPolicyLongrunningMetadata { - // The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Export asset request. @@ -244,6 +243,23 @@ message ExportAssetsRequest { // Required. Output configuration indicating where the results will be output to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; + + // A list of relationship types to export, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it snapshots specified relationships. It returns an error if + // any of the [relationship_types] doesn't belong to the supported + // relationship types of the [asset_types] or if any of the [asset_types] + // doesn't belong to the source types of the [relationship_types]. + // * Otherwise: + // it snapshots the supported relationships for all [asset_types] or returns + // an error if any of the [asset_types] has no relationship support. + // An unspecified asset types field means all supported asset_types. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 6; } // The export asset response. This message is returned by the @@ -316,6 +332,23 @@ message ListAssetsRequest { // unspecified for the first `ListAssetsRequest`. It is a continuation of a // prior `ListAssets` call, and the API should return the next page of assets. string page_token = 6; + + // A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it snapshots specified relationships. It returns an error if + // any of the [relationship_types] doesn't belong to the supported + // relationship types of the [asset_types] or if any of the [asset_types] + // doesn't belong to the source types of the [relationship_types]. + // * Otherwise: + // it snapshots the supported relationships for all [asset_types] or returns + // an error if any of the [asset_types] has no relationship support. + // An unspecified asset types field means all supported asset_types. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types and relationship types. + repeated string relationship_types = 7; } // ListAssets response. @@ -364,6 +397,24 @@ message BatchGetAssetsHistoryRequest { // returned. The returned results contain all temporal assets whose time // window overlap with read_time_window. TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it outputs specified relationships' history on the [asset_names]. It + // returns an error if any of the [relationship_types] doesn't belong to the + // supported relationship types of the [asset_names] or if any of the + // [asset_names]'s types doesn't belong to the source types of the + // [relationship_types]. + // * Otherwise: + // it outputs the supported relationships' history on the [asset_names] or + // returns an error if any of the [asset_names]'s types has no relationship + // support. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 5 [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -682,6 +733,24 @@ message Feed { // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) // for detailed instructions. google.type.Expr condition = 6; + + // A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it outputs specified relationship updates on the [asset_names] or the + // [asset_types]. It returns an error if any of the [relationship_types] + // doesn't belong to the supported relationship types of the [asset_names] or + // [asset_types], or any of the [asset_names] or the [asset_types] doesn't + // belong to the source types of the [relationship_types]. + // * Otherwise: + // it outputs the supported relationships of the types of [asset_names] and + // [asset_types] or returns an error if any of the [asset_names] or the + // [asset_types] has no replationship support. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types and relationship types. + repeated string relationship_types = 7; } // Search all resources request. @@ -1353,4 +1422,7 @@ enum ContentType { // The runtime OS Inventory information. OS_INVENTORY = 6; + + // The related resources. + RELATIONSHIP = 7; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 7a9d47df011..97bc4872dee 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -23,9 +23,11 @@ import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -158,6 +160,10 @@ message Asset { // for more information. google.cloud.osconfig.v1.Inventory os_inventory = 12; + // The related assets of the asset of one relationship type. + // One asset only represents one type of relationship. + RelatedAssets related_assets = 13; + // The ancestry path of an asset in Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // represented as a list of relative resource names. An ancestry path starts @@ -219,6 +225,67 @@ message Resource { string location = 8; } +// The detailed related assets with the `relationship_type`. +message RelatedAssets { + // The detailed relationship attributes. + RelationshipAttributes relationship_attributes = 1; + + // The peer resources of the relationship. + repeated RelatedAsset assets = 2; +} + +// The relationship attributes which include `type`, `source_resource_type`, +// `target_resource_type` and `action`. +message RelationshipAttributes { + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string type = 4; + + // The source asset type. Example: `compute.googleapis.com/Instance` + string source_resource_type = 1; + + // The target asset type. Example: `compute.googleapis.com/Disk` + string target_resource_type = 2; + + // The detail of the relationship, e.g. `contains`, `attaches` + string action = 3; +} + +// An asset identify in Google Cloud which contains its name, type and +// ancestors. An asset can be any resource in the Google Cloud [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message RelatedAsset { + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string asset = 1 [(google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Asset" + }]; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // The ancestors of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 3; +} + // A result of Resource Search, containing information of a cloud resource. message ResourceSearchResult { // The full resource name of this resource. Example: diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 3ee73be55b6..7fc0460681e 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -430,6 +430,9 @@ export namespace google { /** ExportAssetsRequest outputConfig */ outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents an ExportAssetsRequest. */ @@ -456,6 +459,9 @@ export namespace google { /** ExportAssetsRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** ExportAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set @@ -649,6 +655,9 @@ export namespace google { /** ListAssetsRequest pageToken */ pageToken?: (string|null); + + /** ListAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents a ListAssetsRequest. */ @@ -678,6 +687,9 @@ export namespace google { /** ListAssetsRequest pageToken. */ public pageToken: string; + /** ListAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new ListAssetsRequest instance using the specified properties. * @param [properties] Properties to set @@ -865,6 +877,9 @@ export namespace google { /** BatchGetAssetsHistoryRequest readTimeWindow */ readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** BatchGetAssetsHistoryRequest relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents a BatchGetAssetsHistoryRequest. */ @@ -888,6 +903,9 @@ export namespace google { /** BatchGetAssetsHistoryRequest readTimeWindow. */ public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + /** BatchGetAssetsHistoryRequest relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set @@ -2405,6 +2423,9 @@ export namespace google { /** Feed condition */ condition?: (google.type.IExpr|null); + + /** Feed relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents a Feed. */ @@ -2434,6 +2455,9 @@ export namespace google { /** Feed condition. */ public condition?: (google.type.IExpr|null); + /** Feed relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new Feed instance using the specified properties. * @param [properties] Properties to set @@ -4853,7 +4877,8 @@ export namespace google { IAM_POLICY = 2, ORG_POLICY = 4, ACCESS_POLICY = 5, - OS_INVENTORY = 6 + OS_INVENTORY = 6, + RELATIONSHIP = 7 } /** Properties of a TemporalAsset. */ @@ -5111,6 +5136,9 @@ export namespace google { /** Asset osInventory */ osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset relatedAssets */ + relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + /** Asset ancestors */ ancestors?: (string[]|null); } @@ -5154,6 +5182,9 @@ export namespace google { /** Asset osInventory. */ public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset relatedAssets. */ + public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + /** Asset ancestors. */ public ancestors: string[]; @@ -5357,6 +5388,312 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a RelatedAssets. */ + interface IRelatedAssets { + + /** RelatedAssets relationshipAttributes */ + relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets */ + assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); + } + + /** Represents a RelatedAssets. */ + class RelatedAssets implements IRelatedAssets { + + /** + * Constructs a new RelatedAssets. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAssets); + + /** RelatedAssets relationshipAttributes. */ + public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets. */ + public assets: google.cloud.asset.v1.IRelatedAsset[]; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAssets instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAssets + * @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.asset.v1.RelatedAssets; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAssets + * @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.asset.v1.RelatedAssets; + + /** + * Verifies a RelatedAssets 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 RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAssets + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @param message RelatedAssets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAssets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelationshipAttributes. */ + interface IRelationshipAttributes { + + /** RelationshipAttributes type */ + type?: (string|null); + + /** RelationshipAttributes sourceResourceType */ + sourceResourceType?: (string|null); + + /** RelationshipAttributes targetResourceType */ + targetResourceType?: (string|null); + + /** RelationshipAttributes action */ + action?: (string|null); + } + + /** Represents a RelationshipAttributes. */ + class RelationshipAttributes implements IRelationshipAttributes { + + /** + * Constructs a new RelationshipAttributes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); + + /** RelationshipAttributes type. */ + public type: string; + + /** RelationshipAttributes sourceResourceType. */ + public sourceResourceType: string; + + /** RelationshipAttributes targetResourceType. */ + public targetResourceType: string; + + /** RelationshipAttributes action. */ + public action: string; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @param [properties] Properties to set + * @returns RelationshipAttributes instance + */ + public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelationshipAttributes + * @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.asset.v1.RelationshipAttributes; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelationshipAttributes + * @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.asset.v1.RelationshipAttributes; + + /** + * Verifies a RelationshipAttributes 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 RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelationshipAttributes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @param message RelationshipAttributes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelationshipAttributes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedAsset. */ + interface IRelatedAsset { + + /** RelatedAsset asset */ + asset?: (string|null); + + /** RelatedAsset assetType */ + assetType?: (string|null); + + /** RelatedAsset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents a RelatedAsset. */ + class RelatedAsset implements IRelatedAsset { + + /** + * Constructs a new RelatedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAsset); + + /** RelatedAsset asset. */ + public asset: string; + + /** RelatedAsset assetType. */ + public assetType: string; + + /** RelatedAsset ancestors. */ + public ancestors: string[]; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAsset instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAsset + * @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.asset.v1.RelatedAsset; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAsset + * @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.asset.v1.RelatedAsset; + + /** + * Verifies a RelatedAsset 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 RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @param message RelatedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ResourceSearchResult. */ interface IResourceSearchResult { @@ -17662,6 +17999,102 @@ export namespace google { 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 Struct. */ interface IStruct { @@ -17970,102 +18403,6 @@ export namespace google { 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 { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 359de06a6ac..a0d518d21ce 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -733,6 +733,7 @@ * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes * @property {google.cloud.asset.v1.ContentType|null} [contentType] ExportAssetsRequest contentType * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * @property {Array.|null} [relationshipTypes] ExportAssetsRequest relationshipTypes */ /** @@ -745,6 +746,7 @@ */ function ExportAssetsRequest(properties) { this.assetTypes = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -791,6 +793,14 @@ */ ExportAssetsRequest.prototype.outputConfig = null; + /** + * ExportAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new ExportAssetsRequest instance using the specified properties. * @function create @@ -826,6 +836,9 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.relationshipTypes[i]); return writer; }; @@ -877,6 +890,11 @@ case 5: message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); break; + case 6: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -937,6 +955,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { @@ -944,6 +963,13 @@ if (error) return "outputConfig." + error; } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -998,12 +1024,23 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.outputConfig: object expected"); message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -1020,8 +1057,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.assetTypes = []; + object.relationshipTypes = []; + } if (options.defaults) { object.parent = ""; object.readTime = null; @@ -1041,6 +1080,11 @@ object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -1317,6 +1361,7 @@ * @property {google.cloud.asset.v1.ContentType|null} [contentType] ListAssetsRequest contentType * @property {number|null} [pageSize] ListAssetsRequest pageSize * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {Array.|null} [relationshipTypes] ListAssetsRequest relationshipTypes */ /** @@ -1329,6 +1374,7 @@ */ function ListAssetsRequest(properties) { this.assetTypes = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1383,6 +1429,14 @@ */ ListAssetsRequest.prototype.pageToken = ""; + /** + * ListAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new ListAssetsRequest instance using the specified properties. * @function create @@ -1420,6 +1474,9 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.relationshipTypes[i]); return writer; }; @@ -1474,6 +1531,11 @@ case 6: message.pageToken = reader.string(); break; + case 7: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1534,6 +1596,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -1542,6 +1605,13 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -1596,11 +1666,22 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -1617,8 +1698,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.assetTypes = []; + object.relationshipTypes = []; + } if (options.defaults) { object.parent = ""; object.readTime = null; @@ -1641,6 +1724,11 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -1927,6 +2015,7 @@ * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames * @property {google.cloud.asset.v1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + * @property {Array.|null} [relationshipTypes] BatchGetAssetsHistoryRequest relationshipTypes */ /** @@ -1939,6 +2028,7 @@ */ function BatchGetAssetsHistoryRequest(properties) { this.assetNames = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1977,6 +2067,14 @@ */ BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + /** + * BatchGetAssetsHistoryRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @function create @@ -2010,6 +2108,9 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.relationshipTypes[i]); return writer; }; @@ -2058,6 +2159,11 @@ case 4: message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); break; + case 5: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -2113,6 +2219,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { @@ -2120,6 +2227,13 @@ if (error) return "readTimeWindow." + error; } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -2169,12 +2283,23 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.readTimeWindow != null) { if (typeof object.readTimeWindow !== "object") throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -2191,8 +2316,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.assetNames = []; + object.relationshipTypes = []; + } if (options.defaults) { object.parent = ""; object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; @@ -2209,6 +2336,11 @@ object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -5464,6 +5596,7 @@ * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig * @property {google.type.IExpr|null} [condition] Feed condition + * @property {Array.|null} [relationshipTypes] Feed relationshipTypes */ /** @@ -5477,6 +5610,7 @@ function Feed(properties) { this.assetNames = []; this.assetTypes = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5531,6 +5665,14 @@ */ Feed.prototype.condition = null; + /** + * Feed relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new Feed instance using the specified properties. * @function create @@ -5569,6 +5711,9 @@ $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.relationshipTypes[i]); return writer; }; @@ -5625,6 +5770,11 @@ case 6: message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; + case 7: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -5687,6 +5837,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { @@ -5699,6 +5850,13 @@ if (error) return "condition." + error; } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -5755,6 +5913,10 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.feedOutputConfig != null) { if (typeof object.feedOutputConfig !== "object") @@ -5766,6 +5928,13 @@ throw TypeError(".google.cloud.asset.v1.Feed.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition); } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.Feed.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -5785,6 +5954,7 @@ if (options.arrays || options.defaults) { object.assetNames = []; object.assetTypes = []; + object.relationshipTypes = []; } if (options.defaults) { object.name = ""; @@ -5810,6 +5980,11 @@ object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); if (message.condition != null && message.hasOwnProperty("condition")) object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -11460,6 +11635,7 @@ * @property {number} ORG_POLICY=4 ORG_POLICY value * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value * @property {number} OS_INVENTORY=6 OS_INVENTORY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value */ v1.ContentType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -11469,6 +11645,7 @@ values[valuesById[4] = "ORG_POLICY"] = 4; values[valuesById[5] = "ACCESS_POLICY"] = 5; values[valuesById[6] = "OS_INVENTORY"] = 6; + values[valuesById[7] = "RELATIONSHIP"] = 7; return values; })(); @@ -12047,6 +12224,7 @@ * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory + * @property {google.cloud.asset.v1.IRelatedAssets|null} [relatedAssets] Asset relatedAssets * @property {Array.|null} [ancestors] Asset ancestors */ @@ -12147,6 +12325,14 @@ */ Asset.prototype.osInventory = null; + /** + * Asset relatedAssets. + * @member {google.cloud.asset.v1.IRelatedAssets|null|undefined} relatedAssets + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.relatedAssets = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -12217,6 +12403,8 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.osInventory != null && Object.hasOwnProperty.call(message, "osInventory")) $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.relatedAssets != null && Object.hasOwnProperty.call(message, "relatedAssets")) + $root.google.cloud.asset.v1.RelatedAssets.encode(message.relatedAssets, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -12283,6 +12471,9 @@ case 12: message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); break; + case 13: + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -12387,6 +12578,11 @@ if (error) return "osInventory." + error; } + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) { + var error = $root.google.cloud.asset.v1.RelatedAssets.verify(message.relatedAssets); + if (error) + return "relatedAssets." + error; + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -12458,6 +12654,11 @@ throw TypeError(".google.cloud.asset.v1.Asset.osInventory: object expected"); message.osInventory = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.osInventory); } + if (object.relatedAssets != null) { + if (typeof object.relatedAssets !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.relatedAssets: object expected"); + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.fromObject(object.relatedAssets); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -12492,6 +12693,7 @@ object.iamPolicy = null; object.updateTime = null; object.osInventory = null; + object.relatedAssets = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12530,6 +12732,8 @@ object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.osInventory != null && message.hasOwnProperty("osInventory")) object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) + object.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.toObject(message.relatedAssets, options); return object; }; @@ -12872,6 +13076,745 @@ return Resource; })(); + v1.RelatedAssets = (function() { + + /** + * Properties of a RelatedAssets. + * @memberof google.cloud.asset.v1 + * @interface IRelatedAssets + * @property {google.cloud.asset.v1.IRelationshipAttributes|null} [relationshipAttributes] RelatedAssets relationshipAttributes + * @property {Array.|null} [assets] RelatedAssets assets + */ + + /** + * Constructs a new RelatedAssets. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedAssets. + * @implements IRelatedAssets + * @constructor + * @param {google.cloud.asset.v1.IRelatedAssets=} [properties] Properties to set + */ + function RelatedAssets(properties) { + this.assets = []; + 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]]; + } + + /** + * RelatedAssets relationshipAttributes. + * @member {google.cloud.asset.v1.IRelationshipAttributes|null|undefined} relationshipAttributes + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.relationshipAttributes = null; + + /** + * RelatedAssets assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.assets = $util.emptyArray; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets instance + */ + RelatedAssets.create = function create(properties) { + return new RelatedAssets(properties); + }; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relationshipAttributes != null && Object.hasOwnProperty.call(message, "relationshipAttributes")) + $root.google.cloud.asset.v1.RelationshipAttributes.encode(message.relationshipAttributes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.RelatedAsset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.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.asset.v1.RelatedAssets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAssets message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAssets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) { + var error = $root.google.cloud.asset.v1.RelationshipAttributes.verify(message.relationshipAttributes); + if (error) + return "relationshipAttributes." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + */ + RelatedAssets.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedAssets) + return object; + var message = new $root.google.cloud.asset.v1.RelatedAssets(); + if (object.relationshipAttributes != null) { + if (typeof object.relationshipAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedAssets.relationshipAttributes: object expected"); + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.fromObject(object.relationshipAttributes); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.RelatedAssets.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedAssets.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.RelatedAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.RelatedAssets} message RelatedAssets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAssets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) + object.relationshipAttributes = null; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) + object.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.toObject(message.relationshipAttributes, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.RelatedAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this RelatedAssets to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + * @returns {Object.} JSON object + */ + RelatedAssets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedAssets; + })(); + + v1.RelationshipAttributes = (function() { + + /** + * Properties of a RelationshipAttributes. + * @memberof google.cloud.asset.v1 + * @interface IRelationshipAttributes + * @property {string|null} [type] RelationshipAttributes type + * @property {string|null} [sourceResourceType] RelationshipAttributes sourceResourceType + * @property {string|null} [targetResourceType] RelationshipAttributes targetResourceType + * @property {string|null} [action] RelationshipAttributes action + */ + + /** + * Constructs a new RelationshipAttributes. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelationshipAttributes. + * @implements IRelationshipAttributes + * @constructor + * @param {google.cloud.asset.v1.IRelationshipAttributes=} [properties] Properties to set + */ + function RelationshipAttributes(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]]; + } + + /** + * RelationshipAttributes type. + * @member {string} type + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.type = ""; + + /** + * RelationshipAttributes sourceResourceType. + * @member {string} sourceResourceType + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.sourceResourceType = ""; + + /** + * RelationshipAttributes targetResourceType. + * @member {string} targetResourceType + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.targetResourceType = ""; + + /** + * RelationshipAttributes action. + * @member {string} action + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.action = ""; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes instance + */ + RelationshipAttributes.create = function create(properties) { + return new RelationshipAttributes(properties); + }; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceResourceType != null && Object.hasOwnProperty.call(message, "sourceResourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceResourceType); + if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetResourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + return writer; + }; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.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.asset.v1.RelationshipAttributes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.type = reader.string(); + break; + case 1: + message.sourceResourceType = reader.string(); + break; + case 2: + message.targetResourceType = reader.string(); + break; + case 3: + message.action = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelationshipAttributes message. + * @function verify + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelationshipAttributes.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.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + if (!$util.isString(message.sourceResourceType)) + return "sourceResourceType: string expected"; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + if (!$util.isString(message.targetResourceType)) + return "targetResourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + return null; + }; + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + */ + RelationshipAttributes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelationshipAttributes) + return object; + var message = new $root.google.cloud.asset.v1.RelationshipAttributes(); + if (object.type != null) + message.type = String(object.type); + if (object.sourceResourceType != null) + message.sourceResourceType = String(object.sourceResourceType); + if (object.targetResourceType != null) + message.targetResourceType = String(object.targetResourceType); + if (object.action != null) + message.action = String(object.action); + return message; + }; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.RelationshipAttributes} message RelationshipAttributes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelationshipAttributes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceResourceType = ""; + object.targetResourceType = ""; + object.action = ""; + object.type = ""; + } + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + object.sourceResourceType = message.sourceResourceType; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + object.targetResourceType = message.targetResourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this RelationshipAttributes to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + * @returns {Object.} JSON object + */ + RelationshipAttributes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelationshipAttributes; + })(); + + v1.RelatedAsset = (function() { + + /** + * Properties of a RelatedAsset. + * @memberof google.cloud.asset.v1 + * @interface IRelatedAsset + * @property {string|null} [asset] RelatedAsset asset + * @property {string|null} [assetType] RelatedAsset assetType + * @property {Array.|null} [ancestors] RelatedAsset ancestors + */ + + /** + * Constructs a new RelatedAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedAsset. + * @implements IRelatedAsset + * @constructor + * @param {google.cloud.asset.v1.IRelatedAsset=} [properties] Properties to set + */ + function RelatedAsset(properties) { + this.ancestors = []; + 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]]; + } + + /** + * RelatedAsset asset. + * @member {string} asset + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.asset = ""; + + /** + * RelatedAsset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.assetType = ""; + + /** + * RelatedAsset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset instance + */ + RelatedAsset.create = function create(properties) { + return new RelatedAsset(properties); + }; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.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.asset.v1.RelatedAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAsset message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + */ + RelatedAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedAsset) + return object; + var message = new $root.google.cloud.asset.v1.RelatedAsset(); + if (object.asset != null) + message.asset = String(object.asset); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.RelatedAsset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.RelatedAsset} message RelatedAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.asset = ""; + object.assetType = ""; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this RelatedAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + * @returns {Object.} JSON object + */ + RelatedAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedAsset; + })(); + v1.ResourceSearchResult = (function() { /** @@ -44488,6 +45431,225 @@ return Timestamp; })(); + 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.Struct = (function() { /** @@ -45302,225 +46464,6 @@ return ListValue; })(); - 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() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index f9d2d38da98..725e85c1faa 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -303,6 +303,11 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 6 } } }, @@ -352,6 +357,11 @@ "pageToken": { "type": "string", "id": 6 + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 7 } } }, @@ -400,6 +410,14 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -671,6 +689,11 @@ "condition": { "type": "google.type.Expr", "id": 6 + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 7 } } }, @@ -1195,7 +1218,8 @@ "IAM_POLICY": 2, "ORG_POLICY": 4, "ACCESS_POLICY": 5, - "OS_INVENTORY": 6 + "OS_INVENTORY": 6, + "RELATIONSHIP": 7 } }, "TemporalAsset": { @@ -1301,6 +1325,10 @@ "type": "google.cloud.osconfig.v1.Inventory", "id": 12 }, + "relatedAssets": { + "type": "RelatedAssets", + "id": 13 + }, "ancestors": { "rule": "repeated", "type": "string", @@ -1340,6 +1368,59 @@ } } }, + "RelatedAssets": { + "fields": { + "relationshipAttributes": { + "type": "RelationshipAttributes", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "RelatedAsset", + "id": 2 + } + } + }, + "RelationshipAttributes": { + "fields": { + "type": { + "type": "string", + "id": 4 + }, + "sourceResourceType": { + "type": "string", + "id": 1 + }, + "targetResourceType": { + "type": "string", + "id": 2 + }, + "action": { + "type": "string", + "id": 3 + } + } + }, + "RelatedAsset": { + "fields": { + "asset": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Asset" + } + }, + "assetType": { + "type": "string", + "id": 2 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, "ResourceSearchResult": { "fields": { "name": { @@ -4467,6 +4548,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Struct": { "fields": { "fields": { @@ -4530,18 +4623,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Duration": { "fields": { "seconds": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index bc759ef5d86..f6016afb811 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -455,6 +455,23 @@ export class AssetServiceClient { * If start_time is not set, the snapshot of the assets at end_time will be * returned. The returned results contain all temporal assets whose time * window overlap with read_time_window. + * @param {string[]} [request.relationshipTypes] + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. * @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. @@ -1235,6 +1252,22 @@ export class AssetServiceClient { * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig * Required. Output configuration indicating where the results will be output to. + * @param {string[]} request.relationshipTypes + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. * @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. @@ -1561,6 +1594,22 @@ export class AssetServiceClient { * The `next_page_token` returned from the previous `ListAssetsResponse`, or * unspecified for the first `ListAssetsRequest`. It is a continuation of a * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. * @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. @@ -1658,6 +1707,22 @@ export class AssetServiceClient { * The `next_page_token` returned from the previous `ListAssetsResponse`, or * unspecified for the first `ListAssetsRequest`. It is a continuation of a * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1737,6 +1802,22 @@ export class AssetServiceClient { * The `next_page_token` returned from the previous `ListAssetsResponse`, or * unspecified for the first `ListAssetsRequest`. It is a continuation of a * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} From d9bfb7bb6d7974377968e8659fe73f7a3d64bcf7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 16 Aug 2021 21:08:27 +0000 Subject: [PATCH 346/429] chore: release 3.16.0 (#539) :robot: I have created a release \*beep\* \*boop\* --- ## [3.16.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.5...v3.16.0) (2021-08-16) ### Features * Release of relationships in v1, Add content type Relationship to support relationship export ([#537](https://www.github.com/googleapis/nodejs-asset/issues/537)) ([873aae6](https://www.github.com/googleapis/nodejs-asset/commit/873aae6f9b846a16b5695b692e8ad668d684dc6c)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 449578a676a..f9f304cc0cb 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.16.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.5...v3.16.0) (2021-08-16) + + +### Features + +* Release of relationships in v1, Add content type Relationship to support relationship export ([#537](https://www.github.com/googleapis/nodejs-asset/issues/537)) ([873aae6](https://www.github.com/googleapis/nodejs-asset/commit/873aae6f9b846a16b5695b692e8ad668d684dc6c)) + ### [3.15.5](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.4...v3.15.5) (2021-08-13) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index bb016b588b7..8e00e557d76 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.15.5", + "version": "3.16.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 9cc1169ff28..ee2e8b05ef3 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.15.5", + "@google-cloud/asset": "^3.16.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 374b12366ce56e77d49bd2df747e8baeac782e1f Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 17 Aug 2021 13:38:46 -0400 Subject: [PATCH 347/429] fix(deps): require google-gax v2.24.1 (#538) Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 8e00e557d76..f77cb036a96 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -44,7 +44,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 8cca81cf950a972b340e2bedd72d6dff64037caf 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:46:23 +0000 Subject: [PATCH 348/429] chore: release 3.16.1 (#540) :robot: I have created a release \*beep\* \*boop\* --- ### [3.16.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.16.0...v3.16.1) (2021-08-17) ### Bug Fixes * **deps:** require google-gax v2.24.1 ([#538](https://www.github.com/googleapis/nodejs-asset/issues/538)) ([c6397db](https://www.github.com/googleapis/nodejs-asset/commit/c6397db52e9a6c4b43071c79b9809e9b874097a1)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index f9f304cc0cb..11626da6bf4 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.16.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.16.0...v3.16.1) (2021-08-17) + + +### Bug Fixes + +* **deps:** require google-gax v2.24.1 ([#538](https://www.github.com/googleapis/nodejs-asset/issues/538)) ([c6397db](https://www.github.com/googleapis/nodejs-asset/commit/c6397db52e9a6c4b43071c79b9809e9b874097a1)) + ## [3.16.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.15.5...v3.16.0) (2021-08-16) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index f77cb036a96..ef3b948eafd 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.16.0", + "version": "3.16.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ee2e8b05ef3..30b73631f3c 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.16.0", + "@google-cloud/asset": "^3.16.1", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 5c01b2a181f8f742c5cbb9a20b141b03abbf8ad8 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:30:15 +0000 Subject: [PATCH 349/429] feat: turns on self-signed JWT feature flag (#542) - [ ] 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 --- packages/google-cloud-asset/src/v1/asset_service_client.ts | 7 +++++++ .../src/v1p1beta1/asset_service_client.ts | 6 ++++++ .../src/v1p2beta1/asset_service_client.ts | 6 ++++++ .../src/v1p4beta1/asset_service_client.ts | 7 +++++++ .../src/v1p5beta1/asset_service_client.ts | 6 ++++++ 5 files changed, 32 insertions(+) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index f6016afb811..8c115bb4b07 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -133,6 +133,12 @@ export class AssetServiceClient { // 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; @@ -3112,6 +3118,7 @@ export class AssetServiceClient { return this.assetServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index a749e2e655d..4ad954dd9b3 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -130,6 +130,12 @@ export class AssetServiceClient { // 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; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index f3e6ca6b1a2..43e4ace69e8 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -122,6 +122,12 @@ export class AssetServiceClient { // 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; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index e9741134f50..8f682983863 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -128,6 +128,12 @@ export class AssetServiceClient { // 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; @@ -576,6 +582,7 @@ export class AssetServiceClient { return this.assetServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index b4a12952a22..b3bafc68aa2 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -131,6 +131,12 @@ export class AssetServiceClient { // 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; From ad982574318433061f2198edd8780b3d76399a8e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Aug 2021 08:30:34 -0700 Subject: [PATCH 350/429] chore: release 3.17.0 (#543) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 11626da6bf4..18a6c88c384 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.17.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.16.1...v3.17.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#542](https://www.github.com/googleapis/nodejs-asset/issues/542)) ([4c4137f](https://www.github.com/googleapis/nodejs-asset/commit/4c4137f78ebdd870c027118d2d966149b7beb9b7)) + ### [3.16.1](https://www.github.com/googleapis/nodejs-asset/compare/v3.16.0...v3.16.1) (2021-08-17) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ef3b948eafd..ec0e5d3f32c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.16.1", + "version": "3.17.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 30b73631f3c..5badda552c9 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.16.1", + "@google-cloud/asset": "^3.17.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 4753855bbba0c7390e44f56aa587171388e66c07 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 24 Aug 2021 09:59:24 -0700 Subject: [PATCH 351/429] chore: add internal repo team (#544) *chore: add internal repo team Co-authored-by: Owl Bot --- packages/google-cloud-asset/.repo-metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index 697794be066..b50a912ff0c 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -10,5 +10,6 @@ "distribution_name": "@google-cloud/asset", "api_id": "cloudasset.googleapis.com", "requires_billing": true, - "default_version": "v1" + "default_version": "v1", + "codeowner_team": "@googleapis/cloud-asset-team" } From 898924c772d316e8b645deb6b3980dcd28751963 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 10:52:34 -0500 Subject: [PATCH 352/429] feat: Update osconfig v1 and v1alpha with WindowsApplication (#548) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Update osconfig v1 and v1alpha with WindowsApplication Committer: @coodie PiperOrigin-RevId: 393730900 Source-Link: https://github.com/googleapis/googleapis/commit/69fe13f7ca3ca96f34e042596c11e40bb3277924 Source-Link: https://github.com/googleapis/googleapis-gen/commit/69509318baafc42cbe4253dd9b53d56dd5a8f8ad * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/osconfig/v1/inventory.proto | 29 + .../google-cloud-asset/protos/protos.d.ts | 224 ++++++- packages/google-cloud-asset/protos/protos.js | 551 +++++++++++++++++- .../google-cloud-asset/protos/protos.json | 54 +- 4 files changed, 851 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto index ba3318e70e4..11c998acb01 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.osconfig.v1; import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; option csharp_namespace = "Google.Cloud.OsConfig.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; @@ -152,6 +153,9 @@ message Inventory { // Details of a COS package. VersionedPackage cos_package = 8; + + // Details of a Windows Application + WindowsApplication windows_application = 9; } } @@ -247,6 +251,31 @@ message Inventory { google.protobuf.Timestamp install_time = 5; } + // Contains information about a Windows application as retrieved from the + // Windows Registry. For more information about these fields, see + // + // [Windows Installer Properties for the Uninstall + // Registry](https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key){: + // class="external" } + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + // Base level operating system information for the VM. OsInfo os_info = 1; diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 7fc0460681e..d8b69b72c86 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -13427,6 +13427,9 @@ export namespace google { /** SoftwarePackage cosPackage */ cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication */ + windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); } /** Represents a SoftwarePackage. */ @@ -13462,8 +13465,11 @@ export namespace google { /** SoftwarePackage cosPackage. */ public cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + /** SoftwarePackage windowsApplication. */ + public windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); + /** SoftwarePackage details. */ - public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"); + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"); /** * Creates a new SoftwarePackage instance using the specified properties. @@ -14090,6 +14096,120 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a WindowsApplication. */ + interface IWindowsApplication { + + /** WindowsApplication displayName */ + displayName?: (string|null); + + /** WindowsApplication displayVersion */ + displayVersion?: (string|null); + + /** WindowsApplication publisher */ + publisher?: (string|null); + + /** WindowsApplication installDate */ + installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink */ + helpLink?: (string|null); + } + + /** Represents a WindowsApplication. */ + class WindowsApplication implements IWindowsApplication { + + /** + * Constructs a new WindowsApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication); + + /** WindowsApplication displayName. */ + public displayName: string; + + /** WindowsApplication displayVersion. */ + public displayVersion: string; + + /** WindowsApplication publisher. */ + public publisher: string; + + /** WindowsApplication installDate. */ + public installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink. */ + public helpLink: string; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsApplication instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsApplication + * @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.osconfig.v1.Inventory.WindowsApplication; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsApplication + * @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.osconfig.v1.Inventory.WindowsApplication; + + /** + * Verifies a WindowsApplication 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 WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @param message WindowsApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } @@ -19244,6 +19364,108 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @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.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @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.type.Date; + + /** + * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace identity. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index a0d518d21ce..a4e23a3b7ad 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -32930,6 +32930,7 @@ * @property {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage * @property {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null} [windowsApplication] SoftwarePackage windowsApplication */ /** @@ -33011,17 +33012,25 @@ */ SoftwarePackage.prototype.cosPackage = null; + /** + * SoftwarePackage windowsApplication. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null|undefined} windowsApplication + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.windowsApplication = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * SoftwarePackage details. - * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|undefined} details + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"|undefined} details * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage * @instance */ Object.defineProperty(SoftwarePackage.prototype, "details", { - get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage"]), + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage", "windowsApplication"]), set: $util.oneOfSetter($oneOfFields) }); @@ -33065,6 +33074,8 @@ $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.windowsApplication != null && Object.hasOwnProperty.call(message, "windowsApplication")) + $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.encode(message.windowsApplication, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -33123,6 +33134,9 @@ case 8: message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); break; + case 9: + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -33237,6 +33251,16 @@ return "cosPackage." + error; } } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.verify(message.windowsApplication); + if (error) + return "windowsApplication." + error; + } + } return null; }; @@ -33292,6 +33316,11 @@ throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.cosPackage: object expected"); message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.cosPackage); } + if (object.windowsApplication != null) { + if (typeof object.windowsApplication !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.windowsApplication: object expected"); + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.fromObject(object.windowsApplication); + } return message; }; @@ -33348,6 +33377,11 @@ if (options.oneofs) object.details = "cosPackage"; } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + object.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.toObject(message.windowsApplication, options); + if (options.oneofs) + object.details = "windowsApplication"; + } return object; }; @@ -34744,6 +34778,287 @@ return WindowsQuickFixEngineeringPackage; })(); + Inventory.WindowsApplication = (function() { + + /** + * Properties of a WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsApplication + * @property {string|null} [displayName] WindowsApplication displayName + * @property {string|null} [displayVersion] WindowsApplication displayVersion + * @property {string|null} [publisher] WindowsApplication publisher + * @property {google.type.IDate|null} [installDate] WindowsApplication installDate + * @property {string|null} [helpLink] WindowsApplication helpLink + */ + + /** + * Constructs a new WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsApplication. + * @implements IWindowsApplication + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + */ + function WindowsApplication(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]]; + } + + /** + * WindowsApplication displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayName = ""; + + /** + * WindowsApplication displayVersion. + * @member {string} displayVersion + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayVersion = ""; + + /** + * WindowsApplication publisher. + * @member {string} publisher + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.publisher = ""; + + /** + * WindowsApplication installDate. + * @member {google.type.IDate|null|undefined} installDate + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.installDate = null; + + /** + * WindowsApplication helpLink. + * @member {string} helpLink + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.helpLink = ""; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication instance + */ + WindowsApplication.create = function create(properties) { + return new WindowsApplication(properties); + }; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.displayVersion != null && Object.hasOwnProperty.call(message, "displayVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayVersion); + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publisher); + if (message.installDate != null && Object.hasOwnProperty.call(message, "installDate")) + $root.google.type.Date.encode(message.installDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.helpLink != null && Object.hasOwnProperty.call(message, "helpLink")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.helpLink); + return writer; + }; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.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.osconfig.v1.Inventory.WindowsApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + message.displayVersion = reader.string(); + break; + case 3: + message.publisher = reader.string(); + break; + case 4: + message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 5: + message.helpLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsApplication message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + if (!$util.isString(message.displayVersion)) + return "displayVersion: string expected"; + if (message.publisher != null && message.hasOwnProperty("publisher")) + if (!$util.isString(message.publisher)) + return "publisher: string expected"; + if (message.installDate != null && message.hasOwnProperty("installDate")) { + var error = $root.google.type.Date.verify(message.installDate); + if (error) + return "installDate." + error; + } + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + if (!$util.isString(message.helpLink)) + return "helpLink: string expected"; + return null; + }; + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + */ + WindowsApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsApplication) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsApplication(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.displayVersion != null) + message.displayVersion = String(object.displayVersion); + if (object.publisher != null) + message.publisher = String(object.publisher); + if (object.installDate != null) { + if (typeof object.installDate !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsApplication.installDate: object expected"); + message.installDate = $root.google.type.Date.fromObject(object.installDate); + } + if (object.helpLink != null) + message.helpLink = String(object.helpLink); + return message; + }; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsApplication} message WindowsApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.displayVersion = ""; + object.publisher = ""; + object.installDate = null; + object.helpLink = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + object.displayVersion = message.displayVersion; + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = message.publisher; + if (message.installDate != null && message.hasOwnProperty("installDate")) + object.installDate = $root.google.type.Date.toObject(message.installDate, options); + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + object.helpLink = message.helpLink; + return object; + }; + + /** + * Converts this WindowsApplication to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + * @returns {Object.} JSON object + */ + WindowsApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsApplication; + })(); + return Inventory; })(); @@ -48531,6 +48846,238 @@ return Expr; })(); + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(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]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.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.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.year = reader.int32(); + break; + case 2: + message.month = reader.int32(); + break; + case 3: + message.day = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Date; + })(); + return type; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 725e85c1faa..d0a6e9232d6 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3269,7 +3269,8 @@ "zypperPatch", "wuaPackage", "qfePackage", - "cosPackage" + "cosPackage", + "windowsApplication" ] } }, @@ -3305,6 +3306,10 @@ "cosPackage": { "type": "VersionedPackage", "id": 8 + }, + "windowsApplication": { + "type": "WindowsApplication", + "id": 9 } } }, @@ -3420,6 +3425,30 @@ "id": 5 } } + }, + "WindowsApplication": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "displayVersion": { + "type": "string", + "id": 2 + }, + "publisher": { + "type": "string", + "id": 3 + }, + "installDate": { + "type": "google.type.Date", + "id": 4 + }, + "helpLink": { + "type": "string", + "id": 5 + } + } } } } @@ -4771,11 +4800,12 @@ }, "type": { "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "go_package": "google.golang.org/genproto/googleapis/type/date;date", "java_multiple_files": true, - "java_outer_classname": "ExprProto", + "java_outer_classname": "DateProto", "java_package": "com.google.type", - "objc_class_prefix": "GTP" + "objc_class_prefix": "GTP", + "cc_enable_arenas": true }, "nested": { "Expr": { @@ -4797,6 +4827,22 @@ "id": 4 } } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } } } }, From 4708a3593f027874df42859fab72bfb13f4d0e82 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 31 Aug 2021 17:56:13 +0000 Subject: [PATCH 353/429] chore: release 3.18.0 (#549) :robot: I have created a release \*beep\* \*boop\* --- ## [3.18.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.17.0...v3.18.0) (2021-08-30) ### Features * Update osconfig v1 and v1alpha with WindowsApplication ([#548](https://www.github.com/googleapis/nodejs-asset/issues/548)) ([c096de8](https://www.github.com/googleapis/nodejs-asset/commit/c096de83a906953a08508a799014a37b2806da61)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 18a6c88c384..ba210ba3fea 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.18.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.17.0...v3.18.0) (2021-08-30) + + +### Features + +* Update osconfig v1 and v1alpha with WindowsApplication ([#548](https://www.github.com/googleapis/nodejs-asset/issues/548)) ([c096de8](https://www.github.com/googleapis/nodejs-asset/commit/c096de83a906953a08508a799014a37b2806da61)) + ## [3.17.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.16.1...v3.17.0) (2021-08-23) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index ec0e5d3f32c..cc84a6f4ad9 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.17.0", + "version": "3.18.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 5badda552c9..e624bdf4b92 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.17.0", + "@google-cloud/asset": "^3.18.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From b04098eeda4a64bdaa57b5ae06f98537524d8faa Mon Sep 17 00:00:00 2001 From: peter-zheng-g <43967553+peter-zheng-g@users.noreply.github.com> Date: Wed, 1 Sep 2021 17:40:31 -0700 Subject: [PATCH 354/429] build: make quickstart sample tests more stable (#547) * CloudAsset: Update asset lib to v1 for ListAssets sample code * CloudAsset: Fix flakiness of test of BatchGetAssetsHistory sample code * CloudAsset: Remove unneeded output line in sample test Co-authored-by: Benjamin E. Coe Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../google-cloud-asset/samples/test/sample.test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index ec52cc3b9ce..fa474f58dea 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -79,8 +79,14 @@ describe('quickstart sample tests', () => { // the newly created bucket: it('should get assets history successfully', async () => { const assetName = `//storage.googleapis.com/${bucketName}`; - const stdout = execSync(`node getBatchAssetHistory ${assetName}`); - assert.include(stdout, assetName); + let waitMs = 1000; + let included = false; + for (let retry = 0; retry < 3 && !included; ++retry) { + await sleep((waitMs *= 2)); + const stdout = execSync(`node getBatchAssetHistory ${assetName}`); + included = stdout.includes(assetName); + } + assert.ok(included); }); it('should run the quickstart', async () => { From cee68571ec58fe6ae2347a958eee1b2e89f5cd36 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 3 Sep 2021 08:50:31 -0700 Subject: [PATCH 355/429] feat: Release of relationships in v1, Add content type Relationship to support relationship search Committer: yuwangyw@ (#551) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Release of relationships in v1, Add content type Relationship to support relationship search Committer: yuwangyw@ PiperOrigin-RevId: 394579113 Source-Link: https://github.com/googleapis/googleapis/commit/9c7eb1f9a78060a15cc309ab51ee0600c2e6f4f7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/59343840421bcd9e507dec9b7e0aaa76ea71d2e6 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../protos/google/cloud/asset/v1/assets.proto | 24 + .../google-cloud-asset/protos/protos.d.ts | 192 +++++++ packages/google-cloud-asset/protos/protos.js | 484 +++++++++++++++++- .../google-cloud-asset/protos/protos.json | 26 + 4 files changed, 725 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 97bc4872dee..3d433b8f3fe 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -503,6 +503,14 @@ message ResourceSearchResult { // as to allow users to search on them. repeated AttachedResource attached_resources = 20; + // A map of related resources of this resource, keyed by the + // relationship type. A relationship type is in the format of + // {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + // `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + // See [supported relationship + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + map relationships = 21; + // The type of this resource's immediate parent, if there is one. // // To search against the `parent_asset_type`: @@ -558,6 +566,22 @@ message AttachedResource { repeated VersionedResource versioned_resources = 3; } +// The related resources of the primary resource. +message RelatedResources { + // The detailed related resources of the primary resource. + repeated RelatedResource related_resources = 1; +} + +// The detailed related resource. +message RelatedResource { + // The type of the asset. Example: `compute.googleapis.com/Instance` + string asset_type = 1; + + // The full resource name of the related resource. Example: + // `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + string full_resource_name = 2; +} + // A result of IAM Policy search, containing information of an IAM policy. message IamPolicySearchResult { // Explanation about the IAM policy search result. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index d8b69b72c86..fb0641b4475 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -5751,6 +5751,9 @@ export namespace google { /** ResourceSearchResult attachedResources */ attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); + /** ResourceSearchResult relationships */ + relationships?: ({ [k: string]: google.cloud.asset.v1.IRelatedResources }|null); + /** ResourceSearchResult parentAssetType */ parentAssetType?: (string|null); } @@ -5818,6 +5821,9 @@ export namespace google { /** ResourceSearchResult attachedResources. */ public attachedResources: google.cloud.asset.v1.IAttachedResource[]; + /** ResourceSearchResult relationships. */ + public relationships: { [k: string]: google.cloud.asset.v1.IRelatedResources }; + /** ResourceSearchResult parentAssetType. */ public parentAssetType: string; @@ -6084,6 +6090,192 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a RelatedResources. */ + interface IRelatedResources { + + /** RelatedResources relatedResources */ + relatedResources?: (google.cloud.asset.v1.IRelatedResource[]|null); + } + + /** Represents a RelatedResources. */ + class RelatedResources implements IRelatedResources { + + /** + * Constructs a new RelatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResources); + + /** RelatedResources relatedResources. */ + public relatedResources: google.cloud.asset.v1.IRelatedResource[]; + + /** + * Creates a new RelatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResources instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResources): google.cloud.asset.v1.RelatedResources; + + /** + * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResources + * @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.asset.v1.RelatedResources; + + /** + * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResources + * @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.asset.v1.RelatedResources; + + /** + * Verifies a RelatedResources 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 RelatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResources; + + /** + * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. + * @param message RelatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedResource. */ + interface IRelatedResource { + + /** RelatedResource assetType */ + assetType?: (string|null); + + /** RelatedResource fullResourceName */ + fullResourceName?: (string|null); + } + + /** Represents a RelatedResource. */ + class RelatedResource implements IRelatedResource { + + /** + * Constructs a new RelatedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResource); + + /** RelatedResource assetType. */ + public assetType: string; + + /** RelatedResource fullResourceName. */ + public fullResourceName: string; + + /** + * Creates a new RelatedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResource): google.cloud.asset.v1.RelatedResource; + + /** + * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResource + * @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.asset.v1.RelatedResource; + + /** + * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResource + * @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.asset.v1.RelatedResource; + + /** + * Verifies a RelatedResource 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 RelatedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResource; + + /** + * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. + * @param message RelatedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an IamPolicySearchResult. */ interface IIamPolicySearchResult { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index a4e23a3b7ad..f3f041fd8e0 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -13839,6 +13839,7 @@ * @property {string|null} [parentFullResourceName] ResourceSearchResult parentFullResourceName * @property {Array.|null} [versionedResources] ResourceSearchResult versionedResources * @property {Array.|null} [attachedResources] ResourceSearchResult attachedResources + * @property {Object.|null} [relationships] ResourceSearchResult relationships * @property {string|null} [parentAssetType] ResourceSearchResult parentAssetType */ @@ -13856,6 +13857,7 @@ this.networkTags = []; this.versionedResources = []; this.attachedResources = []; + this.relationships = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14006,6 +14008,14 @@ */ ResourceSearchResult.prototype.attachedResources = $util.emptyArray; + /** + * ResourceSearchResult relationships. + * @member {Object.} relationships + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.relationships = $util.emptyObject; + /** * ResourceSearchResult parentAssetType. * @member {string} parentAssetType @@ -14079,6 +14089,11 @@ if (message.attachedResources != null && message.attachedResources.length) for (var i = 0; i < message.attachedResources.length; ++i) $root.google.cloud.asset.v1.AttachedResource.encode(message.attachedResources[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.relationships != null && Object.hasOwnProperty.call(message, "relationships")) + for (var keys = Object.keys(message.relationships), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 21, wireType 2 =*/170).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.RelatedResources.encode(message.relationships[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); return writer; @@ -14196,6 +14211,28 @@ message.attachedResources = []; message.attachedResources.push($root.google.cloud.asset.v1.AttachedResource.decode(reader, reader.uint32())); break; + case 21: + if (message.relationships === $util.emptyObject) + message.relationships = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.RelatedResources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.relationships[key] = value; + break; case 103: message.parentAssetType = reader.string(); break; @@ -14319,6 +14356,16 @@ return "attachedResources." + error; } } + if (message.relationships != null && message.hasOwnProperty("relationships")) { + if (!$util.isObject(message.relationships)) + return "relationships: object expected"; + var key = Object.keys(message.relationships); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedResources.verify(message.relationships[key[i]]); + if (error) + return "relationships." + error; + } + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) if (!$util.isString(message.parentAssetType)) return "parentAssetType: string expected"; @@ -14413,6 +14460,16 @@ message.attachedResources[i] = $root.google.cloud.asset.v1.AttachedResource.fromObject(object.attachedResources[i]); } } + if (object.relationships) { + if (typeof object.relationships !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.relationships: object expected"); + message.relationships = {}; + for (var keys = Object.keys(object.relationships), i = 0; i < keys.length; ++i) { + if (typeof object.relationships[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.relationships: object expected"); + message.relationships[keys[i]] = $root.google.cloud.asset.v1.RelatedResources.fromObject(object.relationships[keys[i]]); + } + } if (object.parentAssetType != null) message.parentAssetType = String(object.parentAssetType); return message; @@ -14437,8 +14494,10 @@ object.folders = []; object.attachedResources = []; } - if (options.objects || options.defaults) + if (options.objects || options.defaults) { object.labels = {}; + object.relationships = {}; + } if (options.defaults) { object.name = ""; object.assetType = ""; @@ -14507,6 +14566,11 @@ for (var j = 0; j < message.attachedResources.length; ++j) object.attachedResources[j] = $root.google.cloud.asset.v1.AttachedResource.toObject(message.attachedResources[j], options); } + if (message.relationships && (keys2 = Object.keys(message.relationships)).length) { + object.relationships = {}; + for (var j = 0; j < keys2.length; ++j) + object.relationships[keys2[j]] = $root.google.cloud.asset.v1.RelatedResources.toObject(message.relationships[keys2[j]], options); + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) object.parentAssetType = message.parentAssetType; return object; @@ -14972,6 +15036,424 @@ return AttachedResource; })(); + v1.RelatedResources = (function() { + + /** + * Properties of a RelatedResources. + * @memberof google.cloud.asset.v1 + * @interface IRelatedResources + * @property {Array.|null} [relatedResources] RelatedResources relatedResources + */ + + /** + * Constructs a new RelatedResources. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedResources. + * @implements IRelatedResources + * @constructor + * @param {google.cloud.asset.v1.IRelatedResources=} [properties] Properties to set + */ + function RelatedResources(properties) { + this.relatedResources = []; + 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]]; + } + + /** + * RelatedResources relatedResources. + * @member {Array.} relatedResources + * @memberof google.cloud.asset.v1.RelatedResources + * @instance + */ + RelatedResources.prototype.relatedResources = $util.emptyArray; + + /** + * Creates a new RelatedResources instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.IRelatedResources=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources instance + */ + RelatedResources.create = function create(properties) { + return new RelatedResources(properties); + }; + + /** + * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.IRelatedResources} message RelatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedResources != null && message.relatedResources.length) + for (var i = 0; i < message.relatedResources.length; ++i) + $root.google.cloud.asset.v1.RelatedResource.encode(message.relatedResources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.IRelatedResources} message RelatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResources.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.asset.v1.RelatedResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.relatedResources && message.relatedResources.length)) + message.relatedResources = []; + message.relatedResources.push($root.google.cloud.asset.v1.RelatedResource.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedResources message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedResources != null && message.hasOwnProperty("relatedResources")) { + if (!Array.isArray(message.relatedResources)) + return "relatedResources: array expected"; + for (var i = 0; i < message.relatedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedResource.verify(message.relatedResources[i]); + if (error) + return "relatedResources." + error; + } + } + return null; + }; + + /** + * Creates a RelatedResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources + */ + RelatedResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedResources) + return object; + var message = new $root.google.cloud.asset.v1.RelatedResources(); + if (object.relatedResources) { + if (!Array.isArray(object.relatedResources)) + throw TypeError(".google.cloud.asset.v1.RelatedResources.relatedResources: array expected"); + message.relatedResources = []; + for (var i = 0; i < object.relatedResources.length; ++i) { + if (typeof object.relatedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedResources.relatedResources: object expected"); + message.relatedResources[i] = $root.google.cloud.asset.v1.RelatedResource.fromObject(object.relatedResources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.RelatedResources} message RelatedResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedResources = []; + if (message.relatedResources && message.relatedResources.length) { + object.relatedResources = []; + for (var j = 0; j < message.relatedResources.length; ++j) + object.relatedResources[j] = $root.google.cloud.asset.v1.RelatedResource.toObject(message.relatedResources[j], options); + } + return object; + }; + + /** + * Converts this RelatedResources to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedResources + * @instance + * @returns {Object.} JSON object + */ + RelatedResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedResources; + })(); + + v1.RelatedResource = (function() { + + /** + * Properties of a RelatedResource. + * @memberof google.cloud.asset.v1 + * @interface IRelatedResource + * @property {string|null} [assetType] RelatedResource assetType + * @property {string|null} [fullResourceName] RelatedResource fullResourceName + */ + + /** + * Constructs a new RelatedResource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedResource. + * @implements IRelatedResource + * @constructor + * @param {google.cloud.asset.v1.IRelatedResource=} [properties] Properties to set + */ + function RelatedResource(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]]; + } + + /** + * RelatedResource assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.RelatedResource + * @instance + */ + RelatedResource.prototype.assetType = ""; + + /** + * RelatedResource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.RelatedResource + * @instance + */ + RelatedResource.prototype.fullResourceName = ""; + + /** + * Creates a new RelatedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.IRelatedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource instance + */ + RelatedResource.create = function create(properties) { + return new RelatedResource(properties); + }; + + /** + * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.IRelatedResource} message RelatedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetType); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullResourceName); + return writer; + }; + + /** + * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.IRelatedResource} message RelatedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResource.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.asset.v1.RelatedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetType = reader.string(); + break; + case 2: + message.fullResourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedResource message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + return null; + }; + + /** + * Creates a RelatedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource + */ + RelatedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedResource) + return object; + var message = new $root.google.cloud.asset.v1.RelatedResource(); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + return message; + }; + + /** + * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.RelatedResource} message RelatedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.assetType = ""; + object.fullResourceName = ""; + } + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + return object; + }; + + /** + * Converts this RelatedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedResource + * @instance + * @returns {Object.} JSON object + */ + RelatedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedResource; + })(); + v1.IamPolicySearchResult = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index d0a6e9232d6..53bc37b149e 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1500,6 +1500,11 @@ "type": "AttachedResource", "id": 20 }, + "relationships": { + "keyType": "string", + "type": "RelatedResources", + "id": 21 + }, "parentAssetType": { "type": "string", "id": 103 @@ -1531,6 +1536,27 @@ } } }, + "RelatedResources": { + "fields": { + "relatedResources": { + "rule": "repeated", + "type": "RelatedResource", + "id": 1 + } + } + }, + "RelatedResource": { + "fields": { + "assetType": { + "type": "string", + "id": 1 + }, + "fullResourceName": { + "type": "string", + "id": 2 + } + } + }, "IamPolicySearchResult": { "fields": { "resource": { From 661c30f8594519c6764add797f3cae36943243fb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 7 Sep 2021 09:43:43 -0700 Subject: [PATCH 356/429] feat: add OSConfigZonalService API Committer: @jaiminsh (#553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add OSConfigZonalService API Committer: @jaiminsh PiperOrigin-RevId: 394704298 Source-Link: https://github.com/googleapis/googleapis/commit/31d2d3432d9a0b910d7858eab7720b63445f23b2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/aa3ce0901f686a71b68e427c6bb7a611b151b540 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/osconfig/v1/inventory.proto | 135 +- .../cloud/osconfig/v1/osconfig_service.proto | 1 + .../osconfig/v1/osconfig_zonal_service.proto | 74 + .../cloud/osconfig/v1/vulnerability.proto | 336 +++ .../google-cloud-asset/protos/protos.d.ts | 541 ++++- packages/google-cloud-asset/protos/protos.js | 2049 ++++++++++++----- .../google-cloud-asset/protos/protos.json | 122 +- .../src/v1/asset_service_client.ts | 55 + .../test/gapic_asset_service_v1.ts | 64 + 9 files changed, 2616 insertions(+), 761 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto index 11c998acb01..8f89d8b89b9 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.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. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.osconfig.v1; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; import "google/type/date.proto"; @@ -30,8 +32,19 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; // OS Config Inventory is a service for collecting and reporting operating // system and package information on VM instances. -// The inventory details of a VM. +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + // Operating system information for the VM. message OsInfo { // The VM hostname. @@ -154,7 +167,7 @@ message Inventory { // Details of a COS package. VersionedPackage cos_package = 8; - // Details of a Windows Application + // Details of Windows Application. WindowsApplication windows_application = 9; } } @@ -172,6 +185,21 @@ message Inventory { string version = 3; } + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + // Details related to a Windows Update package. // Field data and names are taken from Windows Update API IUpdate Interface: // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ @@ -218,21 +246,6 @@ message Inventory { google.protobuf.Timestamp last_deployment_change_time = 10; } - // Details related to a Zypper Patch. - message ZypperPatch { - // The name of the patch. - string patch_name = 5; - - // The category of the patch. - string category = 2; - - // The severity specified for this patch - string severity = 3; - - // Any summary information provided about this patch. - string summary = 4; - } - // Information related to a Quick Fix Engineering package. // Fields are taken from Windows QuickFixEngineering Interface and match // the source names: @@ -276,6 +289,12 @@ message Inventory { string help_link = 5; } + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Base level operating system information for the VM. OsInfo os_info = 1; @@ -284,4 +303,84 @@ message Inventory { // addressable inventory item and will change, when there is a new package // version. map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; } diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto index 2a654eaa2a4..88857b26b56 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -32,6 +32,7 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; option (google.api.resource_definition) = { type: "compute.googleapis.com/Instance" pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" }; // OS Config API diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000000..22219f53973 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,74 @@ +// 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000000..af86fbe098f --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,336 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +message CVSSv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index fb0641b4475..f22c061eff1 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -13221,11 +13221,17 @@ export namespace google { /** Properties of an Inventory. */ interface IInventory { + /** Inventory name */ + name?: (string|null); + /** Inventory osInfo */ osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); /** Inventory items */ items?: ({ [k: string]: google.cloud.osconfig.v1.Inventory.IItem }|null); + + /** Inventory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } /** Represents an Inventory. */ @@ -13237,12 +13243,18 @@ export namespace google { */ constructor(properties?: google.cloud.osconfig.v1.IInventory); + /** Inventory name. */ + public name: string; + /** Inventory osInfo. */ public osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); /** Inventory items. */ public items: { [k: string]: google.cloud.osconfig.v1.Inventory.IItem }; + /** Inventory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + /** * Creates a new Inventory instance using the specified properties. * @param [properties] Properties to set @@ -13836,6 +13848,114 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ZypperPatch. */ + interface IZypperPatch { + + /** ZypperPatch patchName */ + patchName?: (string|null); + + /** ZypperPatch category */ + category?: (string|null); + + /** ZypperPatch severity */ + severity?: (string|null); + + /** ZypperPatch summary */ + summary?: (string|null); + } + + /** Represents a ZypperPatch. */ + class ZypperPatch implements IZypperPatch { + + /** + * Constructs a new ZypperPatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); + + /** ZypperPatch patchName. */ + public patchName: string; + + /** ZypperPatch category. */ + public category: string; + + /** ZypperPatch severity. */ + public severity: string; + + /** ZypperPatch summary. */ + public summary: string; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperPatch instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperPatch + * @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.osconfig.v1.Inventory.ZypperPatch; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperPatch + * @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.osconfig.v1.Inventory.ZypperPatch; + + /** + * Verifies a ZypperPatch 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 ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperPatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @param message ZypperPatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperPatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a WindowsUpdatePackage. */ interface IWindowsUpdatePackage { @@ -14073,114 +14193,6 @@ export namespace google { } } - /** Properties of a ZypperPatch. */ - interface IZypperPatch { - - /** ZypperPatch patchName */ - patchName?: (string|null); - - /** ZypperPatch category */ - category?: (string|null); - - /** ZypperPatch severity */ - severity?: (string|null); - - /** ZypperPatch summary */ - summary?: (string|null); - } - - /** Represents a ZypperPatch. */ - class ZypperPatch implements IZypperPatch { - - /** - * Constructs a new ZypperPatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); - - /** ZypperPatch patchName. */ - public patchName: string; - - /** ZypperPatch category. */ - public category: string; - - /** ZypperPatch severity. */ - public severity: string; - - /** ZypperPatch summary. */ - public summary: string; - - /** - * Creates a new ZypperPatch instance using the specified properties. - * @param [properties] Properties to set - * @returns ZypperPatch instance - */ - public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; - - /** - * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. - * @param message ZypperPatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. - * @param message ZypperPatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ZypperPatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ZypperPatch - * @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.osconfig.v1.Inventory.ZypperPatch; - - /** - * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ZypperPatch - * @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.osconfig.v1.Inventory.ZypperPatch; - - /** - * Verifies a ZypperPatch 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 ZypperPatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ZypperPatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; - - /** - * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. - * @param message ZypperPatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ZypperPatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a WindowsQuickFixEngineeringPackage. */ interface IWindowsQuickFixEngineeringPackage { @@ -14403,6 +14415,319 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Properties of a GetInventoryRequest. */ + interface IGetInventoryRequest { + + /** GetInventoryRequest name */ + name?: (string|null); + + /** GetInventoryRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + } + + /** Represents a GetInventoryRequest. */ + class GetInventoryRequest implements IGetInventoryRequest { + + /** + * Constructs a new GetInventoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetInventoryRequest); + + /** GetInventoryRequest name. */ + public name: string; + + /** GetInventoryRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInventoryRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetInventoryRequest): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInventoryRequest + * @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.osconfig.v1.GetInventoryRequest; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInventoryRequest + * @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.osconfig.v1.GetInventoryRequest; + + /** + * Verifies a GetInventoryRequest 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 GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInventoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @param message GetInventoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInventoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInventoriesRequest. */ + interface IListInventoriesRequest { + + /** ListInventoriesRequest parent */ + parent?: (string|null); + + /** ListInventoriesRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + + /** ListInventoriesRequest pageSize */ + pageSize?: (number|null); + + /** ListInventoriesRequest pageToken */ + pageToken?: (string|null); + + /** ListInventoriesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInventoriesRequest. */ + class ListInventoriesRequest implements IListInventoriesRequest { + + /** + * Constructs a new ListInventoriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesRequest); + + /** ListInventoriesRequest parent. */ + public parent: string; + + /** ListInventoriesRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** ListInventoriesRequest pageSize. */ + public pageSize: number; + + /** ListInventoriesRequest pageToken. */ + public pageToken: string; + + /** ListInventoriesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesRequest): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesRequest + * @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.osconfig.v1.ListInventoriesRequest; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesRequest + * @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.osconfig.v1.ListInventoriesRequest; + + /** + * Verifies a ListInventoriesRequest 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 ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @param message ListInventoriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInventoriesResponse. */ + interface IListInventoriesResponse { + + /** ListInventoriesResponse inventories */ + inventories?: (google.cloud.osconfig.v1.IInventory[]|null); + + /** ListInventoriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInventoriesResponse. */ + class ListInventoriesResponse implements IListInventoriesResponse { + + /** + * Constructs a new ListInventoriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesResponse); + + /** ListInventoriesResponse inventories. */ + public inventories: google.cloud.osconfig.v1.IInventory[]; + + /** ListInventoriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesResponse): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesResponse + * @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.osconfig.v1.ListInventoriesResponse; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesResponse + * @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.osconfig.v1.ListInventoriesResponse; + + /** + * Verifies a ListInventoriesResponse 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 ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @param message ListInventoriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** InventoryView enum. */ + enum InventoryView { + INVENTORY_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } } } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index f3f041fd8e0..ddcb086fea6 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -32380,8 +32380,10 @@ * Properties of an Inventory. * @memberof google.cloud.osconfig.v1 * @interface IInventory + * @property {string|null} [name] Inventory name * @property {google.cloud.osconfig.v1.Inventory.IOsInfo|null} [osInfo] Inventory osInfo * @property {Object.|null} [items] Inventory items + * @property {google.protobuf.ITimestamp|null} [updateTime] Inventory updateTime */ /** @@ -32400,6 +32402,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * Inventory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.name = ""; + /** * Inventory osInfo. * @member {google.cloud.osconfig.v1.Inventory.IOsInfo|null|undefined} osInfo @@ -32416,6 +32426,14 @@ */ Inventory.prototype.items = $util.emptyObject; + /** + * Inventory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.updateTime = null; + /** * Creates a new Inventory instance using the specified properties. * @function create @@ -32447,6 +32465,10 @@ writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.osconfig.v1.Inventory.Item.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + 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(); return writer; }; @@ -32481,6 +32503,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.name = reader.string(); + break; case 1: message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); break; @@ -32506,6 +32531,9 @@ } message.items[key] = value; break; + case 4: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -32541,6 +32569,9 @@ Inventory.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.osInfo != null && message.hasOwnProperty("osInfo")) { var error = $root.google.cloud.osconfig.v1.Inventory.OsInfo.verify(message.osInfo); if (error) @@ -32556,6 +32587,11 @@ return "items." + error; } } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } return null; }; @@ -32571,6 +32607,8 @@ if (object instanceof $root.google.cloud.osconfig.v1.Inventory) return object; var message = new $root.google.cloud.osconfig.v1.Inventory(); + if (object.name != null) + message.name = String(object.name); if (object.osInfo != null) { if (typeof object.osInfo !== "object") throw TypeError(".google.cloud.osconfig.v1.Inventory.osInfo: object expected"); @@ -32586,6 +32624,11 @@ message.items[keys[i]] = $root.google.cloud.osconfig.v1.Inventory.Item.fromObject(object.items[keys[i]]); } } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } return message; }; @@ -32604,8 +32647,11 @@ var object = {}; if (options.objects || options.defaults) object.items = {}; - if (options.defaults) + if (options.defaults) { object.osInfo = null; + object.name = ""; + object.updateTime = null; + } if (message.osInfo != null && message.hasOwnProperty("osInfo")) object.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.toObject(message.osInfo, options); var keys2; @@ -32614,6 +32660,10 @@ for (var j = 0; j < keys2.length; ++j) object.items[keys2[j]] = $root.google.cloud.osconfig.v1.Inventory.Item.toObject(message.items[keys2[j]], options); } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; @@ -34113,35 +34163,27 @@ return VersionedPackage; })(); - Inventory.WindowsUpdatePackage = (function() { + Inventory.ZypperPatch = (function() { /** - * Properties of a WindowsUpdatePackage. + * Properties of a ZypperPatch. * @memberof google.cloud.osconfig.v1.Inventory - * @interface IWindowsUpdatePackage - * @property {string|null} [title] WindowsUpdatePackage title - * @property {string|null} [description] WindowsUpdatePackage description - * @property {Array.|null} [categories] WindowsUpdatePackage categories - * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds - * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl - * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls - * @property {string|null} [updateId] WindowsUpdatePackage updateId - * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber - * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + * @interface IZypperPatch + * @property {string|null} [patchName] ZypperPatch patchName + * @property {string|null} [category] ZypperPatch category + * @property {string|null} [severity] ZypperPatch severity + * @property {string|null} [summary] ZypperPatch summary */ /** - * Constructs a new WindowsUpdatePackage. + * Constructs a new ZypperPatch. * @memberof google.cloud.osconfig.v1.Inventory - * @classdesc Represents a WindowsUpdatePackage. - * @implements IWindowsUpdatePackage + * @classdesc Represents a ZypperPatch. + * @implements IZypperPatch * @constructor - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set */ - function WindowsUpdatePackage(properties) { - this.categories = []; - this.kbArticleIds = []; - this.moreInfoUrls = []; + function ZypperPatch(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34149,188 +34191,114 @@ } /** - * WindowsUpdatePackage title. - * @member {string} title - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.title = ""; - - /** - * WindowsUpdatePackage description. - * @member {string} description - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.description = ""; - - /** - * WindowsUpdatePackage categories. - * @member {Array.} categories - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.categories = $util.emptyArray; - - /** - * WindowsUpdatePackage kbArticleIds. - * @member {Array.} kbArticleIds - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; - - /** - * WindowsUpdatePackage supportUrl. - * @member {string} supportUrl - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @instance - */ - WindowsUpdatePackage.prototype.supportUrl = ""; - - /** - * WindowsUpdatePackage moreInfoUrls. - * @member {Array.} moreInfoUrls - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + ZypperPatch.prototype.patchName = ""; /** - * WindowsUpdatePackage updateId. - * @member {string} updateId - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.updateId = ""; + ZypperPatch.prototype.category = ""; /** - * WindowsUpdatePackage revisionNumber. - * @member {number} revisionNumber - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.revisionNumber = 0; + ZypperPatch.prototype.severity = ""; /** - * WindowsUpdatePackage lastDeploymentChangeTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance */ - WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + ZypperPatch.prototype.summary = ""; /** - * Creates a new WindowsUpdatePackage instance using the specified properties. + * Creates a new ZypperPatch instance using the specified properties. * @function create - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance */ - WindowsUpdatePackage.create = function create(properties) { - return new WindowsUpdatePackage(properties); + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); }; /** - * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. * @function encode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WindowsUpdatePackage.encode = function encode(message, writer) { + ZypperPatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.kbArticleIds != null && message.kbArticleIds.length) - for (var i = 0; i < message.kbArticleIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); - if (message.moreInfoUrls != null && message.moreInfoUrls.length) - for (var i = 0; i < message.moreInfoUrls.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); - if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); - if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); - if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) - $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); return writer; }; /** - * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * Decodes a ZypperPatch message from the specified reader or buffer. * @function decode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WindowsUpdatePackage.decode = function decode(reader, length) { + ZypperPatch.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.osconfig.v1.Inventory.WindowsUpdatePackage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.title = reader.string(); + case 5: + message.patchName = reader.string(); break; case 2: - message.description = reader.string(); + message.category = reader.string(); break; case 3: - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + message.severity = reader.string(); break; case 4: - if (!(message.kbArticleIds && message.kbArticleIds.length)) - message.kbArticleIds = []; - message.kbArticleIds.push(reader.string()); - break; - case 11: - message.supportUrl = reader.string(); - break; - case 5: - if (!(message.moreInfoUrls && message.moreInfoUrls.length)) - message.moreInfoUrls = []; - message.moreInfoUrls.push(reader.string()); - break; - case 6: - message.updateId = reader.string(); - break; - case 7: - message.revisionNumber = reader.int32(); - break; - case 10: - message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.summary = reader.string(); break; default: reader.skipType(tag & 7); @@ -34341,548 +34309,332 @@ }; /** - * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { + ZypperPatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WindowsUpdatePackage message. + * Verifies a ZypperPatch message. * @function verify - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WindowsUpdatePackage.verify = function verify(message) { + ZypperPatch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) { - var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); - if (error) - return "categories." + error; - } - } - if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { - if (!Array.isArray(message.kbArticleIds)) - return "kbArticleIds: array expected"; - for (var i = 0; i < message.kbArticleIds.length; ++i) - if (!$util.isString(message.kbArticleIds[i])) - return "kbArticleIds: string[] expected"; - } - if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) - if (!$util.isString(message.supportUrl)) - return "supportUrl: string expected"; - if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { - if (!Array.isArray(message.moreInfoUrls)) - return "moreInfoUrls: array expected"; - for (var i = 0; i < message.moreInfoUrls.length; ++i) - if (!$util.isString(message.moreInfoUrls[i])) - return "moreInfoUrls: string[] expected"; - } - if (message.updateId != null && message.hasOwnProperty("updateId")) - if (!$util.isString(message.updateId)) - return "updateId: string expected"; - if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) - if (!$util.isInteger(message.revisionNumber)) - return "revisionNumber: integer expected"; - if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); - if (error) - return "lastDeploymentChangeTime." + error; - } + if (message.patchName != null && message.hasOwnProperty("patchName")) + if (!$util.isString(message.patchName)) + return "patchName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; return null; }; /** - * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static * @param {Object.} object Plain object - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch */ - WindowsUpdatePackage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + ZypperPatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) return object; - var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) { - if (typeof object.categories[i] !== "object") - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); - message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); - } - } - if (object.kbArticleIds) { - if (!Array.isArray(object.kbArticleIds)) - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); - message.kbArticleIds = []; - for (var i = 0; i < object.kbArticleIds.length; ++i) - message.kbArticleIds[i] = String(object.kbArticleIds[i]); - } - if (object.supportUrl != null) - message.supportUrl = String(object.supportUrl); - if (object.moreInfoUrls) { - if (!Array.isArray(object.moreInfoUrls)) - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); - message.moreInfoUrls = []; - for (var i = 0; i < object.moreInfoUrls.length; ++i) - message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); - } - if (object.updateId != null) - message.updateId = String(object.updateId); - if (object.revisionNumber != null) - message.revisionNumber = object.revisionNumber | 0; - if (object.lastDeploymentChangeTime != null) { - if (typeof object.lastDeploymentChangeTime !== "object") - throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); - message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); - } + var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + if (object.patchName != null) + message.patchName = String(object.patchName); + if (object.category != null) + message.category = String(object.category); + if (object.severity != null) + message.severity = String(object.severity); + if (object.summary != null) + message.summary = String(object.summary); return message; }; /** - * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WindowsUpdatePackage.toObject = function toObject(message, options) { + ZypperPatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.categories = []; - object.kbArticleIds = []; - object.moreInfoUrls = []; - } if (options.defaults) { - object.title = ""; - object.description = ""; - object.updateId = ""; - object.revisionNumber = 0; - object.lastDeploymentChangeTime = null; - object.supportUrl = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); - } - if (message.kbArticleIds && message.kbArticleIds.length) { - object.kbArticleIds = []; - for (var j = 0; j < message.kbArticleIds.length; ++j) - object.kbArticleIds[j] = message.kbArticleIds[j]; - } - if (message.moreInfoUrls && message.moreInfoUrls.length) { - object.moreInfoUrls = []; - for (var j = 0; j < message.moreInfoUrls.length; ++j) - object.moreInfoUrls[j] = message.moreInfoUrls[j]; + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; } - if (message.updateId != null && message.hasOwnProperty("updateId")) - object.updateId = message.updateId; - if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) - object.revisionNumber = message.revisionNumber; - if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) - object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); - if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) - object.supportUrl = message.supportUrl; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.patchName != null && message.hasOwnProperty("patchName")) + object.patchName = message.patchName; return object; }; /** - * Converts this WindowsUpdatePackage to JSON. + * Converts this ZypperPatch to JSON. * @function toJSON - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch * @instance * @returns {Object.} JSON object */ - WindowsUpdatePackage.prototype.toJSON = function toJSON() { + ZypperPatch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - WindowsUpdatePackage.WindowsUpdateCategory = (function() { - - /** - * Properties of a WindowsUpdateCategory. - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @interface IWindowsUpdateCategory - * @property {string|null} [id] WindowsUpdateCategory id - * @property {string|null} [name] WindowsUpdateCategory name - */ + return ZypperPatch; + })(); - /** - * Constructs a new WindowsUpdateCategory. - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - * @classdesc Represents a WindowsUpdateCategory. - * @implements IWindowsUpdateCategory - * @constructor - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set - */ - function WindowsUpdateCategory(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]]; - } + Inventory.WindowsUpdatePackage = (function() { - /** - * WindowsUpdateCategory id. - * @member {string} id - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @instance - */ - WindowsUpdateCategory.prototype.id = ""; + /** + * Properties of a WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsUpdatePackage + * @property {string|null} [title] WindowsUpdatePackage title + * @property {string|null} [description] WindowsUpdatePackage description + * @property {Array.|null} [categories] WindowsUpdatePackage categories + * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds + * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl + * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls + * @property {string|null} [updateId] WindowsUpdatePackage updateId + * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber + * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + */ - /** - * WindowsUpdateCategory name. - * @member {string} name - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @instance - */ - WindowsUpdateCategory.prototype.name = ""; + /** + * Constructs a new WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsUpdatePackage. + * @implements IWindowsUpdatePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + */ + function WindowsUpdatePackage(properties) { + this.categories = []; + this.kbArticleIds = []; + this.moreInfoUrls = []; + 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 WindowsUpdateCategory instance using the specified properties. - * @function create - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance - */ - WindowsUpdateCategory.create = function create(properties) { - return new WindowsUpdateCategory(properties); - }; - - /** - * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. - * @function encode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WindowsUpdateCategory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; - - /** - * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WindowsUpdateCategory message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WindowsUpdateCategory.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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WindowsUpdateCategory message. - * @function verify - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WindowsUpdateCategory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory - */ - WindowsUpdateCategory.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - return object; - var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @static - * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WindowsUpdateCategory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this WindowsUpdateCategory to JSON. - * @function toJSON - * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - * @instance - * @returns {Object.} JSON object - */ - WindowsUpdateCategory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WindowsUpdateCategory; - })(); + /** + * WindowsUpdatePackage title. + * @member {string} title + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.title = ""; - return WindowsUpdatePackage; - })(); + /** + * WindowsUpdatePackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.description = ""; - Inventory.ZypperPatch = (function() { + /** + * WindowsUpdatePackage categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.categories = $util.emptyArray; /** - * Properties of a ZypperPatch. - * @memberof google.cloud.osconfig.v1.Inventory - * @interface IZypperPatch - * @property {string|null} [patchName] ZypperPatch patchName - * @property {string|null} [category] ZypperPatch category - * @property {string|null} [severity] ZypperPatch severity - * @property {string|null} [summary] ZypperPatch summary + * WindowsUpdatePackage kbArticleIds. + * @member {Array.} kbArticleIds + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance */ + WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; /** - * Constructs a new ZypperPatch. - * @memberof google.cloud.osconfig.v1.Inventory - * @classdesc Represents a ZypperPatch. - * @implements IZypperPatch - * @constructor - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * WindowsUpdatePackage supportUrl. + * @member {string} supportUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance */ - function ZypperPatch(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]]; - } + WindowsUpdatePackage.prototype.supportUrl = ""; /** - * ZypperPatch patchName. - * @member {string} patchName - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage moreInfoUrls. + * @member {Array.} moreInfoUrls + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.patchName = ""; + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; /** - * ZypperPatch category. - * @member {string} category - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.category = ""; + WindowsUpdatePackage.prototype.updateId = ""; /** - * ZypperPatch severity. - * @member {string} severity - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.severity = ""; + WindowsUpdatePackage.prototype.revisionNumber = 0; /** - * ZypperPatch summary. - * @member {string} summary - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance */ - ZypperPatch.prototype.summary = ""; + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; /** - * Creates a new ZypperPatch instance using the specified properties. + * Creates a new WindowsUpdatePackage instance using the specified properties. * @function create - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance */ - ZypperPatch.create = function create(properties) { - return new ZypperPatch(properties); + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); }; /** - * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. * @function encode - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ZypperPatch.encode = function encode(message, writer) { + WindowsUpdatePackage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); - if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); - if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kbArticleIds != null && message.kbArticleIds.length) + for (var i = 0; i < message.kbArticleIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); + if (message.moreInfoUrls != null && message.moreInfoUrls.length) + for (var i = 0; i < message.moreInfoUrls.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); + if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); + if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) + $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); return writer; }; /** - * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ZypperPatch message from the specified reader or buffer. + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. * @function decode - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ZypperPatch.decode = function decode(reader, length) { + WindowsUpdatePackage.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.osconfig.v1.Inventory.ZypperPatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.patchName = reader.string(); + case 1: + message.title = reader.string(); break; case 2: - message.category = reader.string(); + message.description = reader.string(); break; case 3: - message.severity = reader.string(); + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); break; case 4: - message.summary = reader.string(); + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + case 11: + message.supportUrl = reader.string(); + break; + case 5: + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + case 6: + message.updateId = reader.string(); + break; + case 7: + message.revisionNumber = reader.int32(); + break; + case 10: + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -34893,112 +34645,410 @@ }; /** - * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ZypperPatch.decodeDelimited = function decodeDelimited(reader) { + WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ZypperPatch message. + * Verifies a WindowsUpdatePackage message. * @function verify - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ZypperPatch.verify = function verify(message) { + WindowsUpdatePackage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.patchName != null && message.hasOwnProperty("patchName")) - if (!$util.isString(message.patchName)) - return "patchName: string expected"; - if (message.category != null && message.hasOwnProperty("category")) - if (!$util.isString(message.category)) - return "category: string expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - if (!$util.isString(message.severity)) - return "severity: string expected"; - if (message.summary != null && message.hasOwnProperty("summary")) - if (!$util.isString(message.summary)) - return "summary: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { + if (!Array.isArray(message.kbArticleIds)) + return "kbArticleIds: array expected"; + for (var i = 0; i < message.kbArticleIds.length; ++i) + if (!$util.isString(message.kbArticleIds[i])) + return "kbArticleIds: string[] expected"; + } + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + if (!$util.isString(message.supportUrl)) + return "supportUrl: string expected"; + if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { + if (!Array.isArray(message.moreInfoUrls)) + return "moreInfoUrls: array expected"; + for (var i = 0; i < message.moreInfoUrls.length; ++i) + if (!$util.isString(message.moreInfoUrls[i])) + return "moreInfoUrls: string[] expected"; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + if (!$util.isString(message.updateId)) + return "updateId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); + if (error) + return "lastDeploymentChangeTime." + error; + } return null; }; /** - * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static * @param {Object.} object Plain object - * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage */ - ZypperPatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) + WindowsUpdatePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) return object; - var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); - if (object.patchName != null) - message.patchName = String(object.patchName); - if (object.category != null) - message.category = String(object.category); - if (object.severity != null) - message.severity = String(object.severity); - if (object.summary != null) - message.summary = String(object.summary); + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); + message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); + } + } + if (object.kbArticleIds) { + if (!Array.isArray(object.kbArticleIds)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); + message.kbArticleIds = []; + for (var i = 0; i < object.kbArticleIds.length; ++i) + message.kbArticleIds[i] = String(object.kbArticleIds[i]); + } + if (object.supportUrl != null) + message.supportUrl = String(object.supportUrl); + if (object.moreInfoUrls) { + if (!Array.isArray(object.moreInfoUrls)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); + message.moreInfoUrls = []; + for (var i = 0; i < object.moreInfoUrls.length; ++i) + message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); + } + if (object.updateId != null) + message.updateId = String(object.updateId); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; + if (object.lastDeploymentChangeTime != null) { + if (typeof object.lastDeploymentChangeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); + } return message; }; /** - * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @static - * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ZypperPatch.toObject = function toObject(message, options) { + WindowsUpdatePackage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.kbArticleIds = []; + object.moreInfoUrls = []; + } if (options.defaults) { - object.category = ""; - object.severity = ""; - object.summary = ""; - object.patchName = ""; + object.title = ""; + object.description = ""; + object.updateId = ""; + object.revisionNumber = 0; + object.lastDeploymentChangeTime = null; + object.supportUrl = ""; } - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = message.severity; - if (message.summary != null && message.hasOwnProperty("summary")) - object.summary = message.summary; - if (message.patchName != null && message.hasOwnProperty("patchName")) - object.patchName = message.patchName; - return object; - }; - - /** - * Converts this ZypperPatch to JSON. + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); + } + if (message.kbArticleIds && message.kbArticleIds.length) { + object.kbArticleIds = []; + for (var j = 0; j < message.kbArticleIds.length; ++j) + object.kbArticleIds[j] = message.kbArticleIds[j]; + } + if (message.moreInfoUrls && message.moreInfoUrls.length) { + object.moreInfoUrls = []; + for (var j = 0; j < message.moreInfoUrls.length; ++j) + object.moreInfoUrls[j] = message.moreInfoUrls[j]; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + object.updateId = message.updateId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) + object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + object.supportUrl = message.supportUrl; + return object; + }; + + /** + * Converts this WindowsUpdatePackage to JSON. * @function toJSON - * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage * @instance * @returns {Object.} JSON object */ - ZypperPatch.prototype.toJSON = function toJSON() { + WindowsUpdatePackage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ZypperPatch; + WindowsUpdatePackage.WindowsUpdateCategory = (function() { + + /** + * Properties of a WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @interface IWindowsUpdateCategory + * @property {string|null} [id] WindowsUpdateCategory id + * @property {string|null} [name] WindowsUpdateCategory name + */ + + /** + * Constructs a new WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @classdesc Represents a WindowsUpdateCategory. + * @implements IWindowsUpdateCategory + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + */ + function WindowsUpdateCategory(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]]; + } + + /** + * WindowsUpdateCategory id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.id = ""; + + /** + * WindowsUpdateCategory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.name = ""; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance + */ + WindowsUpdateCategory.create = function create(properties) { + return new WindowsUpdateCategory(properties); + }; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateCategory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateCategory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + */ + WindowsUpdateCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WindowsUpdateCategory; + })(); + + return WindowsUpdatePackage; })(); Inventory.WindowsQuickFixEngineeringPackage = (function() { @@ -35544,6 +35594,775 @@ return Inventory; })(); + v1.GetInventoryRequest = (function() { + + /** + * Properties of a GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetInventoryRequest + * @property {string|null} [name] GetInventoryRequest name + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] GetInventoryRequest view + */ + + /** + * Constructs a new GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetInventoryRequest. + * @implements IGetInventoryRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + */ + function GetInventoryRequest(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]]; + } + + /** + * GetInventoryRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.name = ""; + + /** + * GetInventoryRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.view = 0; + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest instance + */ + GetInventoryRequest.create = function create(properties) { + return new GetInventoryRequest(properties); + }; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.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.osconfig.v1.GetInventoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInventoryRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInventoryRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + */ + GetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetInventoryRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetInventoryRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.GetInventoryRequest} message GetInventoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInventoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetInventoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInventoryRequest; + })(); + + v1.ListInventoriesRequest = (function() { + + /** + * Properties of a ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesRequest + * @property {string|null} [parent] ListInventoriesRequest parent + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] ListInventoriesRequest view + * @property {number|null} [pageSize] ListInventoriesRequest pageSize + * @property {string|null} [pageToken] ListInventoriesRequest pageToken + * @property {string|null} [filter] ListInventoriesRequest filter + */ + + /** + * Constructs a new ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesRequest. + * @implements IListInventoriesRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + */ + function ListInventoriesRequest(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]]; + } + + /** + * ListInventoriesRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.parent = ""; + + /** + * ListInventoriesRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.view = 0; + + /** + * ListInventoriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageSize = 0; + + /** + * ListInventoriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageToken = ""; + + /** + * ListInventoriesRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.filter = ""; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest instance + */ + ListInventoriesRequest.create = function create(properties) { + return new ListInventoriesRequest(properties); + }; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + 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 ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.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.osconfig.v1.ListInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.view = reader.int32(); + 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 ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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 ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + */ + ListInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + 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 ListInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesRequest} message ListInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + 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 ListInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInventoriesRequest; + })(); + + v1.ListInventoriesResponse = (function() { + + /** + * Properties of a ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesResponse + * @property {Array.|null} [inventories] ListInventoriesResponse inventories + * @property {string|null} [nextPageToken] ListInventoriesResponse nextPageToken + */ + + /** + * Constructs a new ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesResponse. + * @implements IListInventoriesResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + */ + function ListInventoriesResponse(properties) { + this.inventories = []; + 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]]; + } + + /** + * ListInventoriesResponse inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.inventories = $util.emptyArray; + + /** + * ListInventoriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse instance + */ + ListInventoriesResponse.create = function create(properties) { + return new ListInventoriesResponse(properties); + }; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.encode(message.inventories[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 ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.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.osconfig.v1.ListInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + */ + ListInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesResponse(); + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.inventories[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesResponse} message ListInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inventories = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1.Inventory.toObject(message.inventories[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInventoriesResponse; + })(); + + /** + * InventoryView enum. + * @name google.cloud.osconfig.v1.InventoryView + * @enum {number} + * @property {number} INVENTORY_VIEW_UNSPECIFIED=0 INVENTORY_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.InventoryView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVENTORY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + return v1; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 53bc37b149e..80deb782604 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3181,7 +3181,18 @@ }, "nested": { "Inventory": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/Inventory", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/inventory" + }, "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "osInfo": { "type": "OsInfo", "id": 1 @@ -3190,6 +3201,13 @@ "keyType": "string", "type": "Item", "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -3355,6 +3373,26 @@ } } }, + "ZypperPatch": { + "fields": { + "patchName": { + "type": "string", + "id": 5 + }, + "category": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "string", + "id": 3 + }, + "summary": { + "type": "string", + "id": 4 + } + } + }, "WindowsUpdatePackage": { "fields": { "title": { @@ -3412,26 +3450,6 @@ } } }, - "ZypperPatch": { - "fields": { - "patchName": { - "type": "string", - "id": 5 - }, - "category": { - "type": "string", - "id": 2 - }, - "severity": { - "type": "string", - "id": 3 - }, - "summary": { - "type": "string", - "id": 4 - } - } - }, "WindowsQuickFixEngineeringPackage": { "fields": { "caption": { @@ -3477,6 +3495,70 @@ } } } + }, + "GetInventoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/Inventory" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + } + } + }, + "ListInventoriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListInventoriesResponse": { + "fields": { + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "InventoryView": { + "values": { + "INVENTORY_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } } } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 8c115bb4b07..a27708e9e7d 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -175,6 +175,9 @@ export class AssetServiceClient { folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), + inventoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/inventory' + ), organizationFeedPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), @@ -2988,6 +2991,58 @@ export class AssetServiceClient { return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; } + /** + * Return a fully-qualified inventory resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + inventoryPath(project: string, location: string, instance: string) { + return this.pathTemplates.inventoryPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .project; + } + + /** + * Parse the location from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .location; + } + + /** + * Parse the instance from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName) + .instance; + } + /** * Return a fully-qualified organizationFeed resource name string. * diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 8f0f62a9364..d3bcf99e463 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -2550,6 +2550,70 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('inventory', () => { + const fakePath = '/rendered/path/inventory'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inventoryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.inventoryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('inventoryPath', () => { + const result = client.inventoryPath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.inventoryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInventoryName', () => { + const result = client.matchProjectFromInventoryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInventoryName', () => { + const result = client.matchLocationFromInventoryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInventoryName', () => { + const result = client.matchInstanceFromInventoryName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('organizationFeed', () => { const fakePath = '/rendered/path/organizationFeed'; const expectedParameters = { From 05bae339fdc8ef61c0416e0ce31c99473e90a159 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Sep 2021 16:50:13 +0000 Subject: [PATCH 357/429] chore: release 3.19.0 (#552) :robot: I have created a release \*beep\* \*boop\* --- ## [3.19.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.18.0...v3.19.0) (2021-09-07) ### Features * add OSConfigZonalService API Committer: [@jaiminsh](https://www.github.com/jaiminsh) ([#553](https://www.github.com/googleapis/nodejs-asset/issues/553)) ([1ab2458](https://www.github.com/googleapis/nodejs-asset/commit/1ab2458b63ebe46b8aa8edbd2b1837e793d531f1)) * Release of relationships in v1, Add content type Relationship to support relationship search Committer: yuwangyw@ ([#551](https://www.github.com/googleapis/nodejs-asset/issues/551)) ([56526b0](https://www.github.com/googleapis/nodejs-asset/commit/56526b02d14d15fd6fc469cd614bff9098f3789b)) --- 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-asset/CHANGELOG.md | 8 ++++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index ba210ba3fea..6ce7638295d 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.19.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.18.0...v3.19.0) (2021-09-07) + + +### Features + +* add OSConfigZonalService API Committer: [@jaiminsh](https://www.github.com/jaiminsh) ([#553](https://www.github.com/googleapis/nodejs-asset/issues/553)) ([1ab2458](https://www.github.com/googleapis/nodejs-asset/commit/1ab2458b63ebe46b8aa8edbd2b1837e793d531f1)) +* Release of relationships in v1, Add content type Relationship to support relationship search Committer: yuwangyw@ ([#551](https://www.github.com/googleapis/nodejs-asset/issues/551)) ([56526b0](https://www.github.com/googleapis/nodejs-asset/commit/56526b02d14d15fd6fc469cd614bff9098f3789b)) + ## [3.18.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.17.0...v3.18.0) (2021-08-30) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index cc84a6f4ad9..de0573db185 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.18.0", + "version": "3.19.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index e624bdf4b92..45fc6eadb92 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 180000" }, "dependencies": { - "@google-cloud/asset": "^3.18.0", + "@google-cloud/asset": "^3.19.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 0829ce4a51d8b99aef487fdc993cce31b04f3589 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 14:40:41 -0700 Subject: [PATCH 358/429] chore: relocate owl bot post processor (#558) chore: relocate owl bot post processor --- packages/google-cloud-asset/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.github/.OwlBot.yaml b/packages/google-cloud-asset/.github/.OwlBot.yaml index 8661997bd93..5d77fab0c9d 100644 --- a/packages/google-cloud-asset/.github/.OwlBot.yaml +++ b/packages/google-cloud-asset/.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 67950ff5b6537a46cf1cbba9ca2761f1a69e3fe5 Mon Sep 17 00:00:00 2001 From: lvvvvvf <53883181+lvvvvvf@users.noreply.github.com> Date: Tue, 28 Sep 2021 10:32:57 -0700 Subject: [PATCH 359/429] samples: add relationship support samples (#560) --- packages/google-cloud-asset/README.md | 1 + packages/google-cloud-asset/samples/README.md | 26 ++++++++++++-- .../samples/test/sample.test.js | 34 ++++++++++++++++--- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index d30519cd46b..30f841e8d65 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -101,6 +101,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/tree/ | Create Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/createFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) | | Delete Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/deleteFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) | | Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | +| Export Assets To BigQuery | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssetsBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssetsBigquery.js,samples/README.md) | | Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | | Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | | List Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index f1b21c7214d..7d4134da420 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -18,6 +18,7 @@ * [Create Feed](#create-feed) * [Delete Feed](#delete-feed) * [Export Assets](#export-assets) + * [Export Assets To BigQuery](#export-assets-to-bigquery) * [Get Batch Asset History](#get-batch-asset-history) * [Get Feed](#get-feed) * [List Assets](#list-assets) @@ -110,7 +111,7 @@ View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samp __Usage:__ -`node createFeed "storage.googleapis.com/", projects//topics/` +`node createFeed "storage.googleapis.com/", projects//topics/, "RESOURCE"` ----- @@ -148,7 +149,26 @@ View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samp __Usage:__ -`node exportAssets.js ` +`node exportAssets.js ` + + +----- + + + + +### Export Assets To BigQuery + +Export asserts to specified BigQuery table. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssetsBigquery.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssetsBigquery.js,samples/README.md) + +__Usage:__ + + +`node exportAssetsBigquery.js ` ----- @@ -205,7 +225,7 @@ View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samp __Usage:__ -`node listAssets ` +`node listAssets ` ----- diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index fa474f58dea..343b8b17123 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -1,4 +1,4 @@ -// Copyright 2018 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. @@ -25,6 +25,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const storage = new Storage(); const bucketName = `asset-nodejs-${uuid.v4()}`; const bucket = storage.bucket(bucketName); +const fileSuffix = `${uuid.v4()}`; const {BigQuery} = require('@google-cloud/bigquery'); const bigquery = new BigQuery(); @@ -61,14 +62,30 @@ describe('quickstart sample tests', () => { }); it('should export assets to specified path', async () => { - const dumpFilePath = `gs://${bucketName}/my-assets.txt`; + const dumpFilePath = `gs://${bucketName}/my-assets-${fileSuffix}.txt`; execSync(`node exportAssets ${dumpFilePath}`); let waitMs = 1000; let exists = false; let file; for (let retry = 0; retry < 3 && !exists; ++retry) { await sleep((waitMs *= 2)); - file = await bucket.file('my-assets.txt'); + file = await bucket.file(`my-assets-${fileSuffix}.txt`); + exists = await file.exists(); + } + assert.ok(exists); + await file.delete(); + }); + + it('should export asset relationships to specified path', async () => { + const dumpFilePath = `gs://${bucketName}/my-relationships-${fileSuffix}.txt`; + const contentType = 'RELATIONSHIP'; + execSync(`node exportAssets ${dumpFilePath} ${contentType}`); + let waitMs = 1000; + let exists = false; + let file; + for (let retry = 0; retry < 3 && !exists; ++retry) { + await sleep((waitMs *= 2)); + file = await bucket.file(`my-relationships-${fileSuffix}.txt`); exists = await file.exists(); } assert.ok(exists); @@ -83,7 +100,9 @@ describe('quickstart sample tests', () => { let included = false; for (let retry = 0; retry < 3 && !included; ++retry) { await sleep((waitMs *= 2)); - const stdout = execSync(`node getBatchAssetHistory ${assetName}`); + const stdout = execSync( + `node getBatchAssetHistory ${assetName} 'RESOURCE'` + ); included = stdout.includes(assetName); } assert.ok(included); @@ -109,10 +128,15 @@ describe('quickstart sample tests', () => { it('should list assets successfully', async () => { const assetType = 'storage.googleapis.com/Bucket'; - const stdout = execSync(`node listAssets ${assetType}`); + const stdout = execSync(`node listAssets ${assetType} 'RESOURCE'`); assert.include(stdout, assetType); }); + it('should list asset relationship successfully', async () => { + const stdout = execSync("node listAssets '' 'RELATIONSHIP'"); + assert.include(stdout, 'relatedAsset'); + }); + it('should analyze iam policy successfully', async () => { const stdout = execSync('node analyzeIamPolicy'); assert.include(stdout, '//cloudresourcemanager.googleapis.com/projects'); From c901d2a78b7be8684893c5f50441d2ca7bdc1f76 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 23:24:15 +0000 Subject: [PATCH 360/429] docs(samples): add auto-generated samples for Node with api short name in region tag (#562) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- .../v1/asset_service.analyze_iam_policy.js | 63 ++++++ ..._service.analyze_iam_policy_longrunning.js | 58 ++++++ .../v1/asset_service.analyze_move.js | 69 +++++++ .../asset_service.batch_get_assets_history.js | 95 +++++++++ .../generated/v1/asset_service.create_feed.js | 71 +++++++ .../generated/v1/asset_service.delete_feed.js | 55 ++++++ .../v1/asset_service.export_assets.js | 109 +++++++++++ .../generated/v1/asset_service.get_feed.js | 55 ++++++ .../generated/v1/asset_service.list_assets.js | 116 +++++++++++ .../generated/v1/asset_service.list_feeds.js | 54 ++++++ .../asset_service.search_all_iam_policies.js | 149 ++++++++++++++ .../v1/asset_service.search_all_resources.js | 182 ++++++++++++++++++ .../generated/v1/asset_service.update_feed.js | 63 ++++++ .../asset_service.search_all_iam_policies.js | 80 ++++++++ .../asset_service.search_all_resources.js | 89 +++++++++ .../v1p2beta1/asset_service.create_feed.js | 71 +++++++ .../v1p2beta1/asset_service.delete_feed.js | 55 ++++++ .../v1p2beta1/asset_service.get_feed.js | 55 ++++++ .../v1p2beta1/asset_service.list_feeds.js | 54 ++++++ .../v1p2beta1/asset_service.update_feed.js | 63 ++++++ .../asset_service.analyze_iam_policy.js | 56 ++++++ ...sset_service.export_iam_policy_analysis.js | 62 ++++++ .../v1p5beta1/asset_service.list_assets.js | 89 +++++++++ .../google-cloud-asset/samples/package.json | 2 +- .../src/v1/asset_service_client.ts | 18 +- .../src/v1p1beta1/asset_service_client.ts | 12 +- .../src/v1p5beta1/asset_service_client.ts | 6 +- 27 files changed, 1838 insertions(+), 13 deletions(-) create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js create mode 100644 packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js new file mode 100644 index 00000000000..5d7f2cc17da --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -0,0 +1,63 @@ +// 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(analysisQuery) { + // [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request query. + */ + // const analysisQuery = '' + /** + * Optional. Amount of time executable has to complete. See JSON representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * execution timeout, you will get a response with partial result. + * Otherwise, your query's execution will continue until the RPC deadline. + * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * Default is empty. + */ + // const executionTimeout = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function analyzeIamPolicy() { + // Construct request + const request = { + analysisQuery, + }; + + // Run request + const response = await assetClient.analyzeIamPolicy(request); + console.log(response); + } + + analyzeIamPolicy(); + // [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js new file mode 100644 index 00000000000..6570bd6220d --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -0,0 +1,58 @@ +// 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(analysisQuery, outputConfig) { + // [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request query. + */ + // const analysisQuery = '' + /** + * Required. Output configuration indicating where the results will be output to. + */ + // const outputConfig = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function analyzeIamPolicyLongrunning() { + // Construct request + const request = { + analysisQuery, + outputConfig, + }; + + // Run request + const [operation] = await assetClient.analyzeIamPolicyLongrunning(request); + const [response] = await operation.promise(); + console.log(response); + } + + analyzeIamPolicyLongrunning(); + // [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js new file mode 100644 index 00000000000..0df32716ef5 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js @@ -0,0 +1,69 @@ +// 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(resource, destinationParent) { + // [START cloudasset_v1_generated_AssetService_AnalyzeMove_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource to perform the analysis against. + * Only GCP Project are supported as of today. Hence, this can only be Project + * ID (such as "projects/my-project-id") or a Project Number (such as + * "projects/12345"). + */ + // const resource = 'abc123' + /** + * Required. Name of the GCP Folder or Organization to reparent the target + * resource. The analysis will be performed against hypothetically moving the + * resource to this specified desitination parent. This can only be a Folder + * number (such as "folders/123") or an Organization number (such as + * "organizations/123"). + */ + // const destinationParent = 'abc123' + /** + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + */ + // const view = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function analyzeMove() { + // Construct request + const request = { + resource, + destinationParent, + }; + + // Run request + const response = await assetClient.analyzeMove(request); + console.log(response); + } + + analyzeMove(); + // [END cloudasset_v1_generated_AssetService_AnalyzeMove_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js new file mode 100644 index 00000000000..651d1555c8e --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js @@ -0,0 +1,95 @@ +// 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 cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + */ + // const parent = 'abc123' + /** + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + */ + // const assetNames = 'abc123' + /** + * Optional. The content type. + */ + // const contentType = '' + /** + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + */ + // const readTimeWindow = '' + /** + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + */ + // const relationshipTypes = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function batchGetAssetsHistory() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.batchGetAssetsHistory(request); + console.log(response); + } + + batchGetAssetsHistory(); + // [END cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js new file mode 100644 index 00000000000..05d24467524 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.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, feedId, feed) { + // [START cloudasset_v1_generated_AssetService_CreateFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + */ + // const feedId = 'abc123' + /** + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const feed = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function createFeed() { + // Construct request + const request = { + parent, + feedId, + feed, + }; + + // Run request + const response = await assetClient.createFeed(request); + console.log(response); + } + + createFeed(); + // [END cloudasset_v1_generated_AssetService_CreateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js new file mode 100644 index 00000000000..e72349b3130 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js @@ -0,0 +1,55 @@ +// 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 cloudasset_v1_generated_AssetService_DeleteFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function deleteFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteFeed(request); + console.log(response); + } + + deleteFeed(); + // [END cloudasset_v1_generated_AssetService_DeleteFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js new file mode 100644 index 00000000000..ef338fd65fe --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -0,0 +1,109 @@ +// 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, outputConfig) { + // [START cloudasset_v1_generated_AssetService_ExportAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + */ + // const readTime = '' + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + */ + // const assetTypes = 'abc123' + /** + * Asset content type. If not specified, no content but the asset name will be + * returned. + */ + // const contentType = '' + /** + * Required. Output configuration indicating where the results will be output to. + */ + // const outputConfig = '' + /** + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + */ + // const relationshipTypes = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function exportAssets() { + // Construct request + const request = { + parent, + outputConfig, + }; + + // Run request + const [operation] = await assetClient.exportAssets(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportAssets(); + // [END cloudasset_v1_generated_AssetService_ExportAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js new file mode 100644 index 00000000000..eeda3a194ac --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js @@ -0,0 +1,55 @@ +// 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 cloudasset_v1_generated_AssetService_GetFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function getFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getFeed(request); + console.log(response); + } + + getFeed(); + // [END cloudasset_v1_generated_AssetService_GetFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js new file mode 100644 index 00000000000..84556de5da4 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -0,0 +1,116 @@ +// 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 cloudasset_v1_generated_AssetService_ListAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + */ + // const readTime = '' + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + */ + // const assetTypes = 'abc123' + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + */ + // const contentType = '' + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + */ + // const pageSize = 1234 + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + */ + // const pageToken = 'abc123' + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + */ + // const relationshipTypes = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function listAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assetClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAssets(); + // [END cloudasset_v1_generated_AssetService_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js new file mode 100644 index 00000000000..97476d935b1 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js @@ -0,0 +1,54 @@ +// 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 cloudasset_v1_generated_AssetService_ListFeeds_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function listFeeds() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.listFeeds(request); + console.log(response); + } + + listFeeds(); + // [END cloudasset_v1_generated_AssetService_ListFeeds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js new file mode 100644 index 00000000000..9b3dd1b53b1 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -0,0 +1,149 @@ +// 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(scope) { + // [START cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). + * Examples: + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the "user" + * member type. + */ + // const query = 'abc123' + /** + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + */ + // const assetTypes = 'abc123' + /** + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + */ + // const orderBy = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function searchAllIamPolicies() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = await assetClient.searchAllIamPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + searchAllIamPolicies(); + // [END cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js new file mode 100644 index 00000000000..16c28272e40 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -0,0 +1,182 @@ +// 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(scope) { + // [START cloudasset_v1_generated_AssetService_SearchAllResources_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * Examples: + * * `name:Important` to find Cloud resources whose name contains + * "Important" as a word. + * * `name=Important` to find the Cloud resource whose name is exactly + * "Important". + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix of any word in the field. + * * `location:us-west*` to find Cloud resources whose location contains both + * "us" and "west" as prefixes. + * * `labels:prod` to find Cloud resources whose labels contain "prod" as + * a key or value. + * * `labels.env:prod` to find Cloud resources that have a label "env" + * and its value is "prod". + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed + * encryption key whose name contains the word "key". + * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a + * word. + * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain + * "ACTIVE" as a word. + * * `createTime<1609459200` to find Cloud resources that were created before + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. + * * `updateTime>1609459200` to find Cloud resources that were updated after + * "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of + * "2021-01-01 00:00:00 UTC" in seconds. + * * `Important` to find Cloud resources that contain "Important" as a word + * in any of the searchable fields. + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any + * word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable + * fields and are also located in the "us-west1" region or the "global" + * location. + */ + // const query = 'abc123' + /** + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + */ + // const assetTypes = 'abc123' + /** + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only singular primitive fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * kmsKey + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * All the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not supported. + */ + // const orderBy = 'abc123' + /** + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * The read_mask paths must be valid field paths listed but not limited to + * (both snake_case and camelCase are supported): + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * labels + * * networkTags + * * kmsKey + * * createTime + * * updateTime + * * state + * * additionalAttributes + * * versionedResources + * If read_mask is not specified, all fields except versionedResources will + * be returned. + * If only '*' is specified, all fields including versionedResources will be + * returned. + * Any invalid field path will trigger INVALID_ARGUMENT error. + */ + // const readMask = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function searchAllResources() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = await assetClient.searchAllResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + searchAllResources(); + // [END cloudasset_v1_generated_AssetService_SearchAllResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js new file mode 100644 index 00000000000..fc0b5b5aff4 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -0,0 +1,63 @@ +// 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(feed, updateMask) { + // [START cloudasset_v1_generated_AssetService_UpdateFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + */ + // const feed = '' + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + */ + // const updateMask = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function updateFeed() { + // Construct request + const request = { + feed, + updateMask, + }; + + // Run request + const response = await assetClient.updateFeed(request); + console.log(response); + } + + updateFeed(); + // [END cloudasset_v1_generated_AssetService_UpdateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js new file mode 100644 index 00000000000..ce7a4481d43 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js @@ -0,0 +1,80 @@ +// 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(scope) { + // [START cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + */ + // const query = 'abc123' + /** + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p1beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function searchAllIamPolicies() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = await assetClient.searchAllIamPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + searchAllIamPolicies(); + // [END cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js new file mode 100644 index 00000000000..d5f28f1956c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js @@ -0,0 +1,89 @@ +// 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(scope) { + // [START cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. + */ + // const query = 'abc123' + /** + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + */ + // const assetTypes = 'abc123' + /** + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " desc" after the field name + * to indicate descending order. Redundant space characters are ignored. For + * example, " foo , bar desc ". + */ + // const orderBy = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p1beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function searchAllResources() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = await assetClient.searchAllResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + searchAllResources(); + // [END cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js new file mode 100644 index 00000000000..9cae8dd8cd8 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.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, feedId, feed) { + // [START cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + */ + // const feedId = 'abc123' + /** + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const feed = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function createFeed() { + // Construct request + const request = { + parent, + feedId, + feed, + }; + + // Run request + const response = await assetClient.createFeed(request); + console.log(response); + } + + createFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js new file mode 100644 index 00000000000..4b8c15b0146 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js @@ -0,0 +1,55 @@ +// 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 cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function deleteFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteFeed(request); + console.log(response); + } + + deleteFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js new file mode 100644 index 00000000000..c0fdb7a9e80 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js @@ -0,0 +1,55 @@ +// 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 cloudasset_v1p2beta1_generated_AssetService_GetFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function getFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getFeed(request); + console.log(response); + } + + getFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_GetFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js new file mode 100644 index 00000000000..c0e67b8d0ab --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js @@ -0,0 +1,54 @@ +// 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 cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function listFeeds() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.listFeeds(request); + console.log(response); + } + + listFeeds(); + // [END cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js new file mode 100644 index 00000000000..0cfbf0c2319 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js @@ -0,0 +1,63 @@ +// 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(feed, updateMask) { + // [START cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + */ + // const feed = '' + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + */ + // const updateMask = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function updateFeed() { + // Construct request + const request = { + feed, + updateMask, + }; + + // Run request + const response = await assetClient.updateFeed(request); + console.log(response); + } + + updateFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js new file mode 100644 index 00000000000..40f9fe5cab5 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js @@ -0,0 +1,56 @@ +// 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(analysisQuery) { + // [START cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request query. + */ + // const analysisQuery = '' + /** + * Optional. The request options. + */ + // const options = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function analyzeIamPolicy() { + // Construct request + const request = { + analysisQuery, + }; + + // Run request + const response = await assetClient.analyzeIamPolicy(request); + console.log(response); + } + + analyzeIamPolicy(); + // [END cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js new file mode 100644 index 00000000000..e72fda42aca --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js @@ -0,0 +1,62 @@ +// 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(analysisQuery, outputConfig) { + // [START cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request query. + */ + // const analysisQuery = '' + /** + * Optional. The request options. + */ + // const options = '' + /** + * Required. Output configuration indicating where the results will be output to. + */ + // const outputConfig = '' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function exportIamPolicyAnalysis() { + // Construct request + const request = { + analysisQuery, + outputConfig, + }; + + // Run request + const [operation] = await assetClient.exportIamPolicyAnalysis(request); + const [response] = await operation.promise(); + console.log(response); + } + + exportIamPolicyAnalysis(); + // [END cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js new file mode 100644 index 00000000000..b4424c7c9b3 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js @@ -0,0 +1,89 @@ +// 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 cloudasset_v1p5beta1_generated_AssetService_ListAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-number]" (such as "projects/my-project-id"), or + * "projects/[project-id]" (such as "projects/12345"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + */ + // const readTime = '' + /** + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + */ + // const assetTypes = 'abc123' + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + */ + // const contentType = '' + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + */ + // const pageSize = 1234 + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('asset').v1p5beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function listAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assetClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAssets(); + // [END cloudasset_v1p5beta1_generated_AssetService_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 45fc6eadb92..ae1ab6cf42a 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=8" + "node": ">=10" }, "files": [ "*.js" diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index a27708e9e7d..29343243d2b 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -1756,7 +1756,8 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as gax.GaxCall, @@ -1856,7 +1857,8 @@ export class AssetServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, @@ -2248,7 +2250,8 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllResources.createStream( this.innerApiCalls.searchAllResources as gax.GaxCall, @@ -2422,7 +2425,8 @@ export class AssetServiceClient { scope: request.scope || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, @@ -2742,7 +2746,8 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.createStream( this.innerApiCalls.searchAllIamPolicies as gax.GaxCall, @@ -2880,7 +2885,8 @@ export class AssetServiceClient { scope: request.scope || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 4ad954dd9b3..1cfca2194f5 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -490,7 +490,8 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllResources.createStream( this.innerApiCalls.searchAllResources as gax.GaxCall, @@ -561,7 +562,8 @@ export class AssetServiceClient { scope: request.scope || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, @@ -739,7 +741,8 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.createStream( this.innerApiCalls.searchAllIamPolicies as gax.GaxCall, @@ -805,7 +808,8 @@ export class AssetServiceClient { scope: request.scope || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index b3bafc68aa2..8db22838d81 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -494,7 +494,8 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as gax.GaxCall, @@ -565,7 +566,8 @@ export class AssetServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, From b6f6503576aea2f369539ae865a74bf522c4fd7c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 13 Oct 2021 12:50:42 -0400 Subject: [PATCH 361/429] test: extend timeout for flaky tests (#567) --- packages/google-cloud-asset/samples/package.json | 2 +- packages/google-cloud-asset/samples/test/sample.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ae1ab6cf42a..52399fdc65a 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -12,7 +12,7 @@ "repository": "googleapis/nodejs-asset", "private": true, "scripts": { - "test": "mocha --timeout 180000" + "test": "mocha --timeout 360000" }, "dependencies": { "@google-cloud/asset": "^3.19.0", diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 343b8b17123..21b1baf8378 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -64,7 +64,7 @@ describe('quickstart sample tests', () => { it('should export assets to specified path', async () => { const dumpFilePath = `gs://${bucketName}/my-assets-${fileSuffix}.txt`; execSync(`node exportAssets ${dumpFilePath}`); - let waitMs = 1000; + let waitMs = 4000; let exists = false; let file; for (let retry = 0; retry < 3 && !exists; ++retry) { @@ -80,7 +80,7 @@ describe('quickstart sample tests', () => { const dumpFilePath = `gs://${bucketName}/my-relationships-${fileSuffix}.txt`; const contentType = 'RELATIONSHIP'; execSync(`node exportAssets ${dumpFilePath} ${contentType}`); - let waitMs = 1000; + let waitMs = 4000; let exists = false; let file; for (let retry = 0; retry < 3 && !exists; ++retry) { @@ -162,7 +162,7 @@ describe('quickstart sample tests', () => { execSync( `node analyzeIamPolicyLongrunningBigquery ${datasetId} ${tablePrefix}` ); - let waitMs = 1000; + let waitMs = 4000; let metadataTable; let metadataTable_exists = false; let resultsTable; From a3a06ba9a2b420d89f0c4ae9b2e80ceb69b60c3a 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:46:29 +0000 Subject: [PATCH 362/429] build(node): update deps used during postprocessing (#1243) (#568) --- packages/google-cloud-asset/protos/protos.d.ts | 3 ++- packages/google-cloud-asset/protos/protos.js | 7 +++++++ packages/google-cloud-asset/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index f22c061eff1..bc05ce602f5 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -15082,7 +15082,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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index ddcb086fea6..c2bc14ca3a3 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -37296,6 +37296,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); @@ -37306,6 +37307,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; })(); @@ -43474,6 +43476,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -43578,6 +43581,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-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 80deb782604..7fafb533d28 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -3693,7 +3693,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -4336,6 +4337,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From a886a58e7928c758f06e7c016807144026458a24 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 15:32:01 -0700 Subject: [PATCH 363/429] feat: Update osconfig v1 and v1alpha RecurringSchedule.Frequency with DAILY frequency (#569) Committer: @coodie PiperOrigin-RevId: 403998997 Source-Link: https://github.com/googleapis/googleapis/commit/0dfce5e78775268bc729bb8276c0e20e66ef2a66 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ccde47918b4f132e7d995363d2c55f801d06b714 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2NkZTQ3OTE4YjRmMTMyZTdkOTk1MzYzZDJjNTVmODAxZDA2YjcxNCJ9 --- .../protos/google/cloud/osconfig/v1/patch_deployments.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto index d8bb84a91e5..8cf85288297 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -118,6 +118,10 @@ message RecurringSchedule { // Indicates that the frequency should be expressed in terms of // months. MONTHLY = 2; + + // Indicates that the frequency should be expressed in terms of + // days. + DAILY = 3; } // Required. Defines the time zone that `time_of_day` is relative to. From e525b4fccda8c5c00f7b3abfbb91c5384e4d6e39 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 22:42:13 +0000 Subject: [PATCH 364/429] chore: release 3.20.0 (#570) :robot: I have created a release \*beep\* \*boop\* --- ## [3.20.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.19.0...v3.20.0) (2021-10-19) ### Features * Update osconfig v1 and v1alpha RecurringSchedule.Frequency with DAILY frequency ([#569](https://www.github.com/googleapis/nodejs-asset/issues/569)) ([af03fd5](https://www.github.com/googleapis/nodejs-asset/commit/af03fd5c4fba4a258acf4c0332991bcb619fa10b)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 6ce7638295d..550df5632f3 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.20.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.19.0...v3.20.0) (2021-10-19) + + +### Features + +* Update osconfig v1 and v1alpha RecurringSchedule.Frequency with DAILY frequency ([#569](https://www.github.com/googleapis/nodejs-asset/issues/569)) ([af03fd5](https://www.github.com/googleapis/nodejs-asset/commit/af03fd5c4fba4a258acf4c0332991bcb619fa10b)) + ## [3.19.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.18.0...v3.19.0) (2021-09-07) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index de0573db185..92a52669414 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.19.0", + "version": "3.20.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 52399fdc65a..ee15b37a33b 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 360000" }, "dependencies": { - "@google-cloud/asset": "^3.19.0", + "@google-cloud/asset": "^3.20.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 765b4e40163e7e8a7ce58abf48628bb06d2d4d16 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 21 Oct 2021 11:30:18 -0400 Subject: [PATCH 365/429] chore(cloud-rad): delete api-extractor config (#571) --- .../google-cloud-asset/api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-asset/api-extractor.json diff --git a/packages/google-cloud-asset/api-extractor.json b/packages/google-cloud-asset/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-asset/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 66b3a3a368c5d3effc226b6319b2c8ab294353d9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:19:09 +0200 Subject: [PATCH 366/429] chore(deps): update dependency @types/node to v16 (#572) 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.0.0` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 92a52669414..c85d9e8b0cb 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", From 301b4473097aed00aae0f5e930a44fd504effac9 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 28 Oct 2021 08:47:27 -0700 Subject: [PATCH 367/429] test: address flaky test (#573) Not really sure why the test is flaky. Maybe without the await statement, the process exist before the console is written to. Fixies #565 --- packages/google-cloud-asset/samples/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 11bc75706db..ef8d3cb17d2 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -49,7 +49,7 @@ async function main(assetNames) { console.log(util.inspect(result, {depth: null})); // [END asset_quickstart] } - quickstart(); + await quickstart(); } main(...process.argv.slice(2)); From 82bb92cdfce32392c962f3931045dfdc70dbff16 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:48:28 +0100 Subject: [PATCH 368/429] chore(deps): update dependency sinon to v12 (#575) 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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c85d9e8b0cb..2ff94bc2514 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -60,7 +60,7 @@ "mocha": "^8.0.0", "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.8.3", "webpack": "^5.0.0", From ab772cdc9d2d7fcea90d2b1d5dddad853fe6c3b2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 09:50:07 -0800 Subject: [PATCH 369/429] feat: OSConfig: add OS policy assignment rpcs (#574) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: OSConfig: add OS policy assignment rpcs Committer: @adjackura PiperOrigin-RevId: 407422484 Source-Link: https://github.com/googleapis/googleapis/commit/c11bc3edab44a009dfafd13525d3a38548d823fa Source-Link: https://github.com/googleapis/googleapis-gen/commit/d2df80a5a61299ed2dff12bfaf2886619117e9ce Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDJkZjgwYTVhNjEyOTllZDJkZmYxMmJmYWYyODg2NjE5MTE3ZTljZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Takashi Matsuo --- .../google/cloud/osconfig/v1/os_policy.proto | 548 ++++++++++++++++++ .../v1/os_policy_assignment_reports.proto | 296 ++++++++++ .../osconfig/v1/os_policy_assignments.proto | 386 ++++++++++++ .../cloud/osconfig/v1/osconfig_service.proto | 18 +- .../osconfig/v1/osconfig_zonal_service.proto | 138 ++++- 5 files changed, 1375 insertions(+), 11 deletions(-) create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto create mode 100644 packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto new file mode 100644 index 00000000000..a07e251f6b9 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto @@ -0,0 +1,548 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// An OS policy defines the desired state configuration for a VM. +message OSPolicy { + // Filtering criteria to select VMs based on inventory details. + message InventoryFilter { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // An OS policy resource is used to define the desired state configuration + // and provides a specific functionality like installing/removing packages, + // executing a script etc. + // + // The system ensures that resources are always in their desired state by + // taking necessary actions if they have drifted from their desired state. + message Resource { + // A remote or local file. + message File { + // Specifies a file available via some URI. + message Remote { + // Required. URI from which to fetch the object. It should contain both + // the protocol and path following the format `{protocol}://{location}`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // SHA256 checksum of the remote file. + string sha256_checksum = 2; + } + + // Specifies a file available as a Cloud Storage Object. + message Gcs { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Generation number of the Cloud Storage object. + int64 generation = 3; + } + + // A specific type of file. + oneof type { + // A generic remote file. + Remote remote = 1; + + // A Cloud Storage object. + Gcs gcs = 2; + + // A local path within the VM to use. + string local_path = 3; + } + + // Defaults to false. When false, files are subject to validations + // based on the file type: + // + // Remote: A checksum must be specified. + // Cloud Storage: An object generation number must be specified. + bool allow_insecure = 4; + } + + // A resource that manages a system package. + message PackageResource { + // A deb package file. dpkg packages only support INSTALLED state. + message Deb { + // Required. A deb package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `dpkg -i package` + // - install when true: `apt-get update && apt-get -y install + // package.deb` + bool pull_deps = 2; + } + + // A package managed by APT. + // - install: `apt-get update && apt-get -y install [name]` + // - remove: `apt-get -y remove [name]` + message APT { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An RPM package file. RPM packages only support INSTALLED state. + message RPM { + // Required. An rpm package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `rpm --upgrade --replacepkgs package.rpm` + // - install when true: `yum -y install package.rpm` or + // `zypper -y install package.rpm` + bool pull_deps = 2; + } + + // A package managed by YUM. + // - install: `yum -y install package` + // - remove: `yum -y remove package` + message YUM { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by Zypper. + // - install: `zypper -y install package` + // - remove: `zypper -y rm package` + message Zypper { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by GooGet. + // - install: `googet -noconfirm install package` + // - remove: `googet -noconfirm remove package` + message GooGet { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An MSI package. MSI packages only support INSTALLED state. + message MSI { + // Required. The MSI package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Additional properties to use during installation. + // This should be in the format of Property=Setting. + // Appended to the defaults of `ACTION=INSTALL + // REBOOT=ReallySuppress`. + repeated string properties = 2; + } + + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + + // Required. The desired state the agent should maintain for this package. + DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // A system package. + oneof system_package { + // A package managed by Apt. + APT apt = 2; + + // A deb package file. + Deb deb = 3; + + // A package managed by YUM. + YUM yum = 4; + + // A package managed by Zypper. + Zypper zypper = 5; + + // An rpm package file. + RPM rpm = 6; + + // A package managed by GooGet. + GooGet googet = 7; + + // An MSI package. + MSI msi = 8; + } + } + + // A resource that manages a package repository. + message RepositoryResource { + // Represents a single apt package repository. These will be added to + // a repo file that will be managed at + // `/etc/apt/sources.list.d/google_osconfig.list`. + message AptRepository { + // Type of archive. + enum ArchiveType { + // Unspecified is invalid. + ARCHIVE_TYPE_UNSPECIFIED = 0; + + // Deb indicates that the archive contains binary files. + DEB = 1; + + // Deb-src indicates that the archive contains source files. + DEB_SRC = 2; + } + + // Required. Type of archive files in this repository. + ArchiveType archive_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI for this repository. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Distribution of this repository. + string distribution = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of components for this repository. Must contain at + // least one item. + repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; + + // URI of the key file for this repository. The agent maintains a + // keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. + string gpg_key = 5; + } + + // Represents a single yum package repository. These are added to a + // repo file that is managed at + // `/etc/yum.repos.d/google_osconfig.repo`. + message YumRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the yum config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for resource conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a single zypper package repository. These are added to a + // repo file that is managed at + // `/etc/zypp/repos.d/google_osconfig.repo`. + message ZypperRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the zypper config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for GuestPolicy conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a Goo package repository. These are added to a repo file + // that is managed at + // `C:/ProgramData/GooGet/repos/google_osconfig.repo`. + message GooRepository { + // Required. The name of the repository. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The url of the repository. + string url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A specific type of repository. + oneof repository { + // An Apt Repository. + AptRepository apt = 1; + + // A Yum Repository. + YumRepository yum = 2; + + // A Zypper Repository. + ZypperRepository zypper = 3; + + // A Goo Repository. + GooRepository goo = 4; + } + } + + // A resource that allows executing scripts on the VM. + // + // The `ExecResource` has 2 stages: `validate` and `enforce` and both stages + // accept a script as an argument to execute. + // + // When the `ExecResource` is applied by the agent, it first executes the + // script in the `validate` stage. The `validate` stage can signal that the + // `ExecResource` is already in the desired state by returning an exit code + // of `100`. If the `ExecResource` is not in the desired state, it should + // return an exit code of `101`. Any other exit code returned by this stage + // is considered an error. + // + // If the `ExecResource` is not in the desired state based on the exit code + // from the `validate` stage, the agent proceeds to execute the script from + // the `enforce` stage. If the `ExecResource` is already in the desired + // state, the `enforce` stage will not be run. + // Similar to `validate` stage, the `enforce` stage should return an exit + // code of `100` to indicate that the resource in now in its desired state. + // Any other exit code is considered an error. + // + // NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to + // have an explicit indicator of `in desired state`, `not in desired state` + // and errors. Because, for example, Powershell will always return an exit + // code of `0` unless an `exit` statement is provided in the script. So, for + // reasons of consistency and being explicit, exit codes `100` and `101` + // were chosen. + message ExecResource { + // A file or script to execute. + message Exec { + // The interpreter to use. + enum Interpreter { + // Defaults to NONE. + INTERPRETER_UNSPECIFIED = 0; + + // If an interpreter is not specified, the + // source is executed directly. This execution, without an + // interpreter, only succeeds for executables and scripts that have shebang lines. + NONE = 1; + + // Indicates that the script runs with `/bin/sh` on Linux and + // `cmd.exe` on Windows. + SHELL = 2; + + // Indicates that the script runs with PowerShell. + POWERSHELL = 3; + } + + // What to execute. + oneof source { + // A remote or local file. + File file = 1; + + // An inline script. + // The size of the script is limited to 1024 characters. + string script = 2; + } + + // Optional arguments to pass to the source during execution. + repeated string args = 3; + + // Required. The script interpreter to use. + Interpreter interpreter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Only recorded for enforce Exec. + // Path to an output file (that is created by this Exec) whose + // content will be recorded in OSPolicyResourceCompliance after a + // successful run. Absence or failure to read this file will result in + // this ExecResource being non-compliant. Output file size is limited to + // 100K bytes. + string output_file_path = 5; + } + + // Required. What to run to validate this resource is in the desired + // state. An exit code of 100 indicates "in desired state", and exit code + // of 101 indicates "not in desired state". Any other exit code indicates + // a failure running validate. + Exec validate = 1 [(google.api.field_behavior) = REQUIRED]; + + // What to run to bring this resource into the desired state. + // An exit code of 100 indicates "success", any other exit code indicates + // a failure running enforce. + Exec enforce = 2; + } + + // A resource that manages the state of a file. + message FileResource { + // Desired state of the file. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure file at path is present. + PRESENT = 1; + + // Ensure file at path is absent. + ABSENT = 2; + + // Ensure the contents of the file at path matches. If the file does + // not exist it will be created. + CONTENTS_MATCH = 3; + } + + // The source for the contents of the file. + oneof source { + // A remote or local source. + File file = 1; + + // A a file with this content. + // The size of the content is limited to 1024 characters. + string content = 2; + } + + // Required. The absolute path of the file within the VM. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Desired state of the file. + DesiredState state = 4 [(google.api.field_behavior) = REQUIRED]; + + // Consists of three octal digits which represent, in + // order, the permissions of the owner, group, and other users for the + // file (similarly to the numeric mode used in the linux chmod + // utility). Each digit represents a three bit number with the 4 bit + // corresponding to the read permissions, the 2 bit corresponds to the + // write bit, and the one bit corresponds to the execute permission. + // Default behavior is 755. + // + // Below are some examples of permissions and their associated values: + // read, write, and execute: 7 + // read and execute: 5 + // read and write: 6 + // read only: 4 + string permissions = 5; + } + + // Required. The id of the resource with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the OS policy. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Resource type. + oneof resource_type { + // Package resource + PackageResource pkg = 2; + + // Package repository resource + RepositoryResource repository = 3; + + // Exec resource + ExecResource exec = 4; + + // File resource + FileResource file = 5; + } + } + + // Resource groups provide a mechanism to group OS policy resources. + // + // Resource groups enable OS policy authors to create a single OS policy + // to be applied to VMs running different operating Systems. + // + // When the OS policy is applied to a target VM, the appropriate resource + // group within the OS policy is selected based on the `OSFilter` specified + // within the resource group. + message ResourceGroup { + // List of inventory filters for the resource group. + // + // The resources in this resource group are applied to the target VM if it + // satisfies at least one of the following inventory filters. + // + // For example, to apply this resource group to VMs running either `RHEL` or + // `CentOS` operating systems, specify 2 items for the list with following + // values: + // inventory_filters[0].os_short_name='rhel' and + // inventory_filters[1].os_short_name='centos' + // + // If the list is empty, this resource group will be applied to the target + // VM unconditionally. + repeated InventoryFilter inventory_filters = 1; + + // Required. List of resources configured for this resource group. + // The resources are executed in the exact order specified here. + repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + + // Required. The id of the OS policy with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the assignment. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Policy description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. Policy mode + Mode mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of resource groups for the policy. + // For a particular VM, resource groups are evaluated in the order specified + // and the first resource group that is applicable is selected and the rest + // are ignored. + // + // If none of the resource groups are applicable for a VM, the VM is + // considered to be non-compliant w.r.t this policy. This behavior can be + // toggled by the flag `allow_no_resource_group_match` + repeated ResourceGroup resource_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // This flag determines the OS policy compliance status when none of the + // resource groups within the policy are applicable for a VM. Set this value + // to `true` if the policy needs to be reported as compliant even if the + // policy has nothing to validate or enforce. + bool allow_no_resource_group_match = 5; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto new file mode 100644 index 00000000000..f610fc5a884 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -0,0 +1,296 @@ +// 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OSPolicyAssignmentReportsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}" +}; + +// Get a report of the OS policy assignment for a VM instance. +message GetOSPolicyAssignmentReportRequest { + // Required. API resource name for OS policy assignment report. + // + // Format: + // `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + // For `{assignment_id}`, the OSPolicyAssignment id must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + ]; +} + +// List the OS policy assignment reports for VM instances. +message ListOSPolicyAssignmentReportsRequest { + // Required. The parent resource name. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + // provided. If '-' is provided, the response will include + // OSPolicyAssignmentReports for all instances in the project/location. + // For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + // is provided, the response will include OSPolicyAssignmentReports for all + // OSPolicyAssignments in the project/location. + // Either {instance} or {assignment} must be `-`. + // + // For example: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + // returns all reports for the instance + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + // returns all the reports for the given assignment across all instances. + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + // returns all the reports for all assignments across all instances. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // If provided, this field specifies the criteria that must be met by the + // `OSPolicyAssignmentReport` API resource that is included in the response. + string filter = 3; + + // A pagination token returned from a previous call to the + // `ListOSPolicyAssignmentReports` method that indicates where this listing + // should continue from. + string page_token = 4; +} + +// A response message for listing OS Policy assignment reports including the +// page of results and page token. +message ListOSPolicyAssignmentReportsResponse { + // List of OS policy assignment reports. + repeated OSPolicyAssignmentReport os_policy_assignment_reports = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // report objects. + string next_page_token = 2; +} + +// A report of the OS policy assignment status for a given instance. +message OSPolicyAssignmentReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + // Compliance data for an OS policy resource. + message OSPolicyResourceCompliance { + // Step performed by the OS Config agent for configuring an + // `OSPolicy` resource to its desired state. + message OSPolicyResourceConfigStep { + // Supported configuration step types + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Checks for resource conflicts such as schema errors. + VALIDATION = 1; + + // Checks the current status of the desired state for a resource. + DESIRED_STATE_CHECK = 2; + + // Enforces the desired state for a resource that is not in desired + // state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-checks the status of the desired state. This check is done + // for a resource after the enforcement of all OS policies. + // + // This step is used to determine the final desired state status for + // the resource. It accounts for any resources that might have drifted + // from their desired state due to side effects from executing other + // resources. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Configuration step type. + Type type = 1; + + // An error message recorded during the execution of this step. + // Only populated if errors were encountered during this step execution. + string error_message = 2; + } + + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // Possible compliance states for a resource. + enum ComplianceState { + // The resource is in an unknown compliance state. + // + // To get more details about why the policy is in this state, review + // the output of the `compliance_state_reason` field. + UNKNOWN = 0; + + // Resource is compliant. + COMPLIANT = 1; + + // Resource is non-compliant. + NON_COMPLIANT = 2; + } + + // The ID of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration completed by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // The compliance state of the resource. + ComplianceState compliance_state = 3; + + // A reason for the resource to be in the given compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // The following values are supported when `compliance_state == UNKNOWN` + // + // * `execution-errors`: Errors were encountered by the agent while + // executing the resource and the compliance state couldn't be + // determined. + // * `execution-skipped-by-agent`: Resource execution was skipped by the + // agent because errors were encountered while executing prior resources + // in the OS policy. + // * `os-policy-execution-attempt-failed`: The execution of the OS policy + // containing this resource failed and the compliance state couldn't be + // determined. + string compliance_state_reason = 4; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 5; + } + } + + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + + // The OS policy id + string os_policy_id = 1; + + // The compliance state of the OS policy. + ComplianceState compliance_state = 2; + + // The reason for the OS policy to be in an unknown compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // If populated, the field can contain one of the following values: + // + // * `vm-not-running`: The VM was not running. + // * `os-policies-not-supported-by-agent`: The version of the OS Config + // agent running on the VM does not support running OS policies. + // * `no-agent-detected`: The OS Config agent is not detected for the VM. + // * `resource-execution-errors`: The OS Config agent encountered errors + // while executing one or more resources in the policy. See + // `os_policy_resource_compliances` for details. + // * `task-timeout`: The task sent to the agent to apply the policy timed + // out. + // * `unexpected-agent-state`: The OS Config agent did not report the final + // status of the task that attempted to apply the policy. Instead, the agent + // unexpectedly started working on a different task. This mostly happens + // when the agent or VM unexpectedly restarts while applying OS policies. + // * `internal-service-errors`: Internal service errors were encountered + // while attempting to apply the policy. + string compliance_state_reason = 3; + + // Compliance data for each resource within the policy that is applied to + // the VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 4; + } + + // The `OSPolicyAssignmentReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report` + string name = 1; + + // The Compute Engine VM instance name. + string instance = 2; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 3 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 4; + + // Timestamp for when the report was last generated. + google.protobuf.Timestamp update_time = 5; + + // Unique identifier of the last attempted run to apply the OS policies + // associated with this assignment on the VM. + // + // This ID is logged by the OS Config agent while applying the OS + // policies associated with this assignment on the VM. + // NOTE: If the service is unable to successfully connect to the agent for + // this run, then this id will not be available in the agent logs. + string last_run_id = 6; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto new file mode 100644 index 00000000000..157b8fd3989 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/os_policy.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyAssignmentsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS policy assignment is an API resource that is used to +// apply a set of OS policies to a dynamically targeted group of Compute Engine +// VM instances. +// +// An OS policy is used to define the desired state configuration for a +// Compute Engine VM instance through a set of configuration resources that +// provide capabilities such as installing or removing software packages, or +// executing a script. +// +// For more information, see [OS policy and OS policy +// assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). +message OSPolicyAssignment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }; + + // Message representing label set. + // * A label is a key value pair set for a VM. + // * A LabelSet is a set of labels. + // * Labels within a LabelSet are ANDed. In other words, a LabelSet is + // applicable for a VM only if it matches all the labels in the + // LabelSet. + // * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will + // only be applicable for those VMs with both labels + // present. + message LabelSet { + // Labels are identified by key/value pairs in this map. + // A VM should contain all the key/value pairs specified in this + // map to be selected. + map labels = 1; + } + + // Filters to select target VMs for an assignment. + // + // If more than one filter criteria is specified below, a VM will be selected + // if and only if it satisfies all of them. + message InstanceFilter { + // VM inventory details. + message Inventory { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // Target all VMs in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // List of label sets used for VM inclusion. + // + // If the list has more than one `LabelSet`, the VM is included if any + // of the label sets are applicable for the VM. + repeated LabelSet inclusion_labels = 2; + + // List of label sets used for VM exclusion. + // + // If the list has more than one label set, the VM is excluded if any + // of the label sets are applicable for the VM. + repeated LabelSet exclusion_labels = 3; + + // List of inventories to select VMs. + // + // A VM is selected if its inventory data matches at least one of the + // following inventories. + repeated Inventory inventories = 4; + } + + // Message to configure the rollout at the zonal level for the OS policy + // assignment. + message Rollout { + // Required. The maximum number (or percentage) of VMs per zone to disrupt + // at any given moment. + FixedOrPercent disruption_budget = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. This determines the minimum duration of time to wait after the + // configuration changes are applied through the current rollout. A + // VM continues to count towards the `disruption_budget` at least + // until this duration of time has passed after configuration changes are + // applied. + google.protobuf.Duration min_wait_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // OS policy assignment rollout state + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` + // + // This field is ignored when you create an OS policy assignment. + string name = 1; + + // OS policy assignment description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. List of OS policies to be applied to the VMs. + repeated OSPolicy os_policies = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Filter to select VMs. + InstanceFilter instance_filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rollout to deploy the OS policy assignment. + // A rollout is triggered in the following situations: + // 1) OSPolicyAssignment is created. + // 2) OSPolicyAssignment is updated and the update contains changes to one of + // the following fields: + // - instance_filter + // - os_policies + // 3) OSPolicyAssignment is deleted. + Rollout rollout = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The assignment revision ID + // A new revision is committed whenever a rollout is triggered for a OS policy + // assignment + string revision_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag for this OS policy assignment. + // If this is provided on update, it must match the server's etag. + string etag = 8; + + // Output only. OS policy assignment rollout state + RolloutState rollout_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision has been successfully rolled out + // in this zone and new VMs will be assigned OS policies from this revision. + // + // For a given OS policy assignment, there is only one revision with a value + // of `true` for this field. + bool baseline = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision deletes the OS policy assignment. + bool deleted = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that reconciliation is in progress for the revision. + // This value is `true` when the `rollout_state` is one of: + // * IN_PROGRESS + // * CANCELLING + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated unique id for the OS policy assignment + // resource. + string uid = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OS policy assignment operation metadata provided by OS policy assignment API +// methods that return long running operations. +message OSPolicyAssignmentOperationMetadata { + // The OS policy assignment API method. + enum APIMethod { + // Invalid value + API_METHOD_UNSPECIFIED = 0; + + // Create OS policy assignment API method + CREATE = 1; + + // Update OS policy assignment API method + UPDATE = 2; + + // Delete OS policy assignment API method + DELETE = 3; + } + + // State of the rollout + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Reference to the `OSPolicyAssignment` API resource. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 1 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // The OS policy assignment API method. + APIMethod api_method = 2; + + // State of the rollout + RolloutState rollout_state = 3; + + // Rollout start time + google.protobuf.Timestamp rollout_start_time = 4; + + // Rollout update time + google.protobuf.Timestamp rollout_update_time = 5; +} + +// A request message to create an OS policy assignment +message CreateOSPolicyAssignmentRequest { + // Required. The parent resource name in the form: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The OS policy assignment to be created. + OSPolicyAssignment os_policy_assignment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical name of the OS policy assignment in the project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string os_policy_assignment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message to update an OS policy assignment +message UpdateOSPolicyAssignmentRequest { + // Required. The updated OS policy assignment. + OSPolicyAssignment os_policy_assignment = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the assignment should be + // updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message to get an OS policy assignment +message GetOSPolicyAssignmentRequest { + // Required. The resource name of OS policy assignment. + // + // Format: + // `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} + +// A request message to list OS policy assignments for a parent resource +message ListOSPolicyAssignmentsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of assignments to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignments` that indicates where this listing should continue + // from. + string page_token = 3; +} + +// A response message for listing all assignments under given parent. +message ListOSPolicyAssignmentsResponse { + // The list of assignments + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignments. + string next_page_token = 2; +} + +// A request message to list revisions for a OS policy assignment +message ListOSPolicyAssignmentRevisionsRequest { + // Required. The name of the OS policy assignment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; + + // The maximum number of revisions to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignmentRevisions` that indicates where this listing should + // continue from. + string page_token = 3; +} + +// A response message for listing all revisions for a OS policy assignment. +message ListOSPolicyAssignmentRevisionsResponse { + // The OS policy assignment revisions + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // revisions. + string next_page_token = 2; +} + +// A request message for deleting a OS policy assignment. +message DeleteOSPolicyAssignmentRequest { + // Required. The name of the OS policy assignment to be deleted + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto index 88857b26b56..ae256fe68f4 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -41,7 +41,8 @@ option (google.api.resource_definition) = { // manage package installations and patch jobs for virtual machine instances. service OsConfigService { option (google.api.default_host) = "osconfig.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"; // Patch VM instances by creating and running a patch job. rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { @@ -78,7 +79,8 @@ service OsConfigService { } // Get a list of instance details for a given patch job. - rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) returns (ListPatchJobInstanceDetailsResponse) { + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) + returns (ListPatchJobInstanceDetailsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" }; @@ -86,12 +88,14 @@ service OsConfigService { } // Create an OS Config patch deployment. - rpc CreatePatchDeployment(CreatePatchDeploymentRequest) returns (PatchDeployment) { + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) + returns (PatchDeployment) { option (google.api.http) = { post: "/v1/{parent=projects/*}/patchDeployments" body: "patch_deployment" }; - option (google.api.method_signature) = "parent,patch_deployment,patch_deployment_id"; + option (google.api.method_signature) = + "parent,patch_deployment,patch_deployment_id"; } // Get an OS Config patch deployment. @@ -103,7 +107,8 @@ service OsConfigService { } // Get a page of OS Config patch deployments. - rpc ListPatchDeployments(ListPatchDeploymentsRequest) returns (ListPatchDeploymentsResponse) { + rpc ListPatchDeployments(ListPatchDeploymentsRequest) + returns (ListPatchDeploymentsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*}/patchDeployments" }; @@ -111,7 +116,8 @@ service OsConfigService { } // Delete an OS Config patch deployment. - rpc DeletePatchDeployment(DeletePatchDeploymentRequest) returns (google.protobuf.Empty) { + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) + returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=projects/*/patchDeployments/*}" }; diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto index 22219f53973..196737c1941 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -18,9 +18,11 @@ package google.cloud.osconfig.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; -import "google/api/resource.proto"; import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/os_policy_assignment_reports.proto"; +import "google/cloud/osconfig/v1/os_policy_assignments.proto"; import "google/cloud/osconfig/v1/vulnerability.proto"; +import "google/longrunning/operations.proto"; option csharp_namespace = "Google.Cloud.OsConfig.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; @@ -36,7 +38,130 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; // manage package installations and patch jobs for Compute Engine VM instances. service OsConfigZonalService { option (google.api.default_host) = "osconfig.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"; + + // Create an OS policy assignment. + // + // This method also creates the first revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = + "parent,os_policy_assignment,os_policy_assignment_id"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Update an existing OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "os_policy_assignment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Retrieve an existing OS policy assignment. + // + // This method always returns the latest revision. In order to retrieve a + // previous revision of the assignment, also provide the revision ID in the + // `name` parameter. + rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) + returns (OSPolicyAssignment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List the OS policy assignments under the parent resource. + // + // For each OS policy assignment, the latest revision is returned. + rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) + returns (ListOSPolicyAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + }; + option (google.api.method_signature) = "parent"; + } + + // List the OS policy assignment revisions for a given OS policy assignment. + rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) + returns (ListOSPolicyAssignmentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Delete the OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // If the LRO completes and is not cancelled, all revisions associated with + // the OS policy assignment are deleted. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Get the OS policy asssignment report for the specified Compute Engine VM + // instance. + rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) + returns (OSPolicyAssignmentReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policy asssignment reports for all Compute Engine VM instances in + // the specified zone. + rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) + returns (ListOSPolicyAssignmentReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } // Get inventory data for the specified VM instance. If the VM has no // associated inventory, the message `NOT_FOUND` is returned. @@ -48,7 +173,8 @@ service OsConfigZonalService { } // List inventory data for all VM instances in the specified zone. - rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) { + rpc ListInventories(ListInventoriesRequest) + returns (ListInventoriesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" }; @@ -57,7 +183,8 @@ service OsConfigZonalService { // Gets the vulnerability report for the specified VM instance. Only VMs with // inventory data have vulnerability reports associated with them. - rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) { + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) + returns (VulnerabilityReport) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" }; @@ -65,7 +192,8 @@ service OsConfigZonalService { } // List vulnerability reports for all VM instances in the specified zone. - rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) { + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) + returns (ListVulnerabilityReportsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" }; From aa63c95705cc06f6294da5154f25078ed458e5ed Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 18:00:26 +0000 Subject: [PATCH 370/429] chore: release 3.21.0 (#576) :robot: I have created a release \*beep\* \*boop\* --- ## [3.21.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.20.0...v3.21.0) (2021-11-09) ### Features * OSConfig: add OS policy assignment rpcs ([#574](https://www.github.com/googleapis/nodejs-asset/issues/574)) ([ff9491d](https://www.github.com/googleapis/nodejs-asset/commit/ff9491d55bd527c451914b487ce08fed3068dbd8)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 550df5632f3..ec1c88fc41e 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.21.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.20.0...v3.21.0) (2021-11-09) + + +### Features + +* OSConfig: add OS policy assignment rpcs ([#574](https://www.github.com/googleapis/nodejs-asset/issues/574)) ([ff9491d](https://www.github.com/googleapis/nodejs-asset/commit/ff9491d55bd527c451914b487ce08fed3068dbd8)) + ## [3.20.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.19.0...v3.20.0) (2021-10-19) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 2ff94bc2514..c968581f090 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.20.0", + "version": "3.21.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ee15b37a33b..fa28c0433b7 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 360000" }, "dependencies": { - "@google-cloud/asset": "^3.20.0", + "@google-cloud/asset": "^3.21.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 847d424d8d7550efa2a69b84caa0b42418b871d7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:09:04 -0800 Subject: [PATCH 371/429] docs(samples): add example tags to generated samples (#577) 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 --- .../google-cloud-asset/linkinator.config.json | 2 +- .../v1/asset_service.analyze_iam_policy.js | 10 +- ..._service.analyze_iam_policy_longrunning.js | 8 +- .../v1/asset_service.analyze_move.js | 6 +- .../asset_service.batch_get_assets_history.js | 26 +- .../generated/v1/asset_service.create_feed.js | 6 +- .../generated/v1/asset_service.delete_feed.js | 4 +- .../v1/asset_service.export_assets.js | 30 +- .../generated/v1/asset_service.get_feed.js | 4 +- .../generated/v1/asset_service.list_assets.js | 28 +- .../generated/v1/asset_service.list_feeds.js | 4 +- .../asset_service.search_all_iam_policies.js | 20 +- .../v1/asset_service.search_all_resources.js | 18 +- .../generated/v1/asset_service.update_feed.js | 8 +- .../asset_service.search_all_iam_policies.js | 4 +- .../asset_service.search_all_resources.js | 4 +- .../v1p2beta1/asset_service.create_feed.js | 6 +- .../v1p2beta1/asset_service.delete_feed.js | 4 +- .../v1p2beta1/asset_service.get_feed.js | 4 +- .../v1p2beta1/asset_service.list_feeds.js | 4 +- .../v1p2beta1/asset_service.update_feed.js | 8 +- .../asset_service.analyze_iam_policy.js | 8 +- ...sset_service.export_iam_policy_analysis.js | 10 +- .../v1p5beta1/asset_service.list_assets.js | 12 +- .../src/v1/asset_service_client.ts | 760 +++++++++--------- .../src/v1p1beta1/asset_service_client.ts | 140 ++-- .../src/v1p2beta1/asset_service_client.ts | 226 +++--- .../src/v1p4beta1/asset_service_client.ts | 100 ++- .../src/v1p5beta1/asset_service_client.ts | 70 +- 29 files changed, 749 insertions(+), 785 deletions(-) diff --git a/packages/google-cloud-asset/linkinator.config.json b/packages/google-cloud-asset/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-asset/linkinator.config.json +++ b/packages/google-cloud-asset/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index 5d7f2cc17da..f36a4e9630a 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -22,10 +22,10 @@ function main(analysisQuery) { /** * Required. The request query. */ - // const analysisQuery = '' + // const analysisQuery = {} /** * Optional. Amount of time executable has to complete. See JSON representation of - * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json). * If this field is set with a value less than the RPC deadline, and the * execution of your query hasn't finished in the specified * execution timeout, you will get a response with partial result. @@ -33,7 +33,7 @@ function main(analysisQuery) { * If it's not finished until then, you will get a DEADLINE_EXCEEDED error. * Default is empty. */ - // const executionTimeout = '' + // const executionTimeout = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1; @@ -41,7 +41,7 @@ function main(analysisQuery) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function analyzeIamPolicy() { + async function callAnalyzeIamPolicy() { // Construct request const request = { analysisQuery, @@ -52,7 +52,7 @@ function main(analysisQuery) { console.log(response); } - analyzeIamPolicy(); + callAnalyzeIamPolicy(); // [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index 6570bd6220d..28548a8a30f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -22,11 +22,11 @@ function main(analysisQuery, outputConfig) { /** * Required. The request query. */ - // const analysisQuery = '' + // const analysisQuery = {} /** * Required. Output configuration indicating where the results will be output to. */ - // const outputConfig = '' + // const outputConfig = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1; @@ -34,7 +34,7 @@ function main(analysisQuery, outputConfig) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function analyzeIamPolicyLongrunning() { + async function callAnalyzeIamPolicyLongrunning() { // Construct request const request = { analysisQuery, @@ -47,7 +47,7 @@ function main(analysisQuery, outputConfig) { console.log(response); } - analyzeIamPolicyLongrunning(); + callAnalyzeIamPolicyLongrunning(); // [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js index 0df32716ef5..e6ea142b34f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js @@ -38,7 +38,7 @@ function main(resource, destinationParent) { * Analysis view indicating what information should be included in the * analysis response. If unspecified, the default view is FULL. */ - // const view = '' + // const view = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1; @@ -46,7 +46,7 @@ function main(resource, destinationParent) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function analyzeMove() { + async function callAnalyzeMove() { // Construct request const request = { resource, @@ -58,7 +58,7 @@ function main(resource, destinationParent) { console.log(response); } - analyzeMove(); + callAnalyzeMove(); // [END cloudasset_v1_generated_AssetService_AnalyzeMove_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js index 651d1555c8e..60230130817 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js @@ -37,7 +37,7 @@ function main(parent) { /** * Optional. The content type. */ - // const contentType = '' + // const contentType = {} /** * Optional. The time window for the asset history. Both start_time and * end_time are optional and if set, it must be after the current time minus @@ -46,23 +46,23 @@ function main(parent) { * returned. The returned results contain all temporal assets whose time * window overlap with read_time_window. */ - // const readTimeWindow = '' + // const readTimeWindow = {} /** * Optional. A list of relationship types to output, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if * content_type=RELATIONSHIP. * * If specified: - * it outputs specified relationships' history on the [asset_names]. It - * returns an error if any of the [relationship_types] doesn't belong to the - * supported relationship types of the [asset_names] or if any of the - * [asset_names]'s types doesn't belong to the source types of the - * [relationship_types]. + * it outputs specified relationships' history on the asset_names. It + * returns an error if any of the relationship_types doesn't belong to the + * supported relationship types of the asset_names or if any of the + * asset_names's types doesn't belong to the source types of the + * relationship_types. * * Otherwise: - * it outputs the supported relationships' history on the [asset_names] or - * returns an error if any of the [asset_names]'s types has no relationship + * it outputs the supported relationships' history on the asset_names or + * returns an error if any of the asset_names's types has no relationship * support. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) for all * supported asset types and relationship types. */ // const relationshipTypes = 'abc123' @@ -73,7 +73,7 @@ function main(parent) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function batchGetAssetsHistory() { + async function callBatchGetAssetsHistory() { // Construct request const request = { parent, @@ -84,7 +84,7 @@ function main(parent) { console.log(response); } - batchGetAssetsHistory(); + callBatchGetAssetsHistory(); // [END cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index 05d24467524..216f98b4f0c 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -39,7 +39,7 @@ function main(parent, feedId, feed) { * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id */ - // const feed = '' + // const feed = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1; @@ -47,7 +47,7 @@ function main(parent, feedId, feed) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function createFeed() { + async function callCreateFeed() { // Construct request const request = { parent, @@ -60,7 +60,7 @@ function main(parent, feedId, feed) { console.log(response); } - createFeed(); + callCreateFeed(); // [END cloudasset_v1_generated_AssetService_CreateFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js index e72349b3130..74fd1a9fa22 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function deleteFeed() { + async function callDeleteFeed() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteFeed(); + callDeleteFeed(); // [END cloudasset_v1_generated_AssetService_DeleteFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index ef338fd65fe..28684b3b8f6 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -33,7 +33,7 @@ function main(parent, outputConfig) { * data collection and indexing, there is a volatile window during which * running the same query may get different results. */ - // const readTime = '' + // const readTime = {} /** * A list of asset types to take a snapshot for. For example: * "compute.googleapis.com/Disk". @@ -42,12 +42,12 @@ function main(parent, outputConfig) { * with "compute.googleapis.com". * * ".*Instance" snapshots resources whose asset type ends with "Instance". * * ".*Instance.*" snapshots resources whose asset type contains "Instance". - * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * If specified, only matching assets will be returned, otherwise, it will - * snapshot all asset types. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * snapshot all asset types. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types. */ // const assetTypes = 'abc123' @@ -55,26 +55,26 @@ function main(parent, outputConfig) { * Asset content type. If not specified, no content but the asset name will be * returned. */ - // const contentType = '' + // const contentType = {} /** * Required. Output configuration indicating where the results will be output to. */ - // const outputConfig = '' + // const outputConfig = {} /** * A list of relationship types to export, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if * content_type=RELATIONSHIP. * * If specified: * it snapshots specified relationships. It returns an error if - * any of the [relationship_types] doesn't belong to the supported - * relationship types of the [asset_types] or if any of the [asset_types] - * doesn't belong to the source types of the [relationship_types]. + * any of the relationship_types doesn't belong to the supported + * relationship types of the asset_types or if any of the asset_types + * doesn't belong to the source types of the relationship_types. * * Otherwise: - * it snapshots the supported relationships for all [asset_types] or returns - * an error if any of the [asset_types] has no relationship support. + * it snapshots the supported relationships for all asset_types or returns + * an error if any of the asset_types has no relationship support. * An unspecified asset types field means all supported asset_types. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) for all * supported asset types and relationship types. */ // const relationshipTypes = 'abc123' @@ -85,7 +85,7 @@ function main(parent, outputConfig) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function exportAssets() { + async function callExportAssets() { // Construct request const request = { parent, @@ -98,7 +98,7 @@ function main(parent, outputConfig) { console.log(response); } - exportAssets(); + callExportAssets(); // [END cloudasset_v1_generated_AssetService_ExportAssets_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js index eeda3a194ac..d402cba1d04 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function getFeed() { + async function callGetFeed() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getFeed(); + callGetFeed(); // [END cloudasset_v1_generated_AssetService_GetFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index 84556de5da4..57410a2936d 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -33,7 +33,7 @@ function main(parent) { * data collection and indexing, there is a volatile window during which * running the same query may get different results. */ - // const readTime = '' + // const readTime = {} /** * A list of asset types to take a snapshot for. For example: * "compute.googleapis.com/Disk". @@ -42,12 +42,12 @@ function main(parent) { * with "compute.googleapis.com". * * ".*Instance" snapshots resources whose asset type ends with "Instance". * * ".*Instance.*" snapshots resources whose asset type contains "Instance". - * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * If specified, only matching assets will be returned, otherwise, it will - * snapshot all asset types. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * snapshot all asset types. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types. */ // const assetTypes = 'abc123' @@ -55,7 +55,7 @@ function main(parent) { * Asset content type. If not specified, no content but the asset name will * be returned. */ - // const contentType = '' + // const contentType = {} /** * The maximum number of assets to be returned in a single response. Default * is 100, minimum is 1, and maximum is 1000. @@ -73,15 +73,15 @@ function main(parent) { * content_type=RELATIONSHIP. * * If specified: * it snapshots specified relationships. It returns an error if - * any of the [relationship_types] doesn't belong to the supported - * relationship types of the [asset_types] or if any of the [asset_types] - * doesn't belong to the source types of the [relationship_types]. + * any of the relationship_types doesn't belong to the supported + * relationship types of the asset_types or if any of the asset_types + * doesn't belong to the source types of the relationship_types. * * Otherwise: - * it snapshots the supported relationships for all [asset_types] or returns - * an error if any of the [asset_types] has no relationship support. + * it snapshots the supported relationships for all asset_types or returns + * an error if any of the asset_types has no relationship support. * An unspecified asset types field means all supported asset_types. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) * for all supported asset types and relationship types. */ // const relationshipTypes = 'abc123' @@ -92,7 +92,7 @@ function main(parent) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function listAssets() { + async function callListAssets() { // Construct request const request = { parent, @@ -105,7 +105,7 @@ function main(parent) { } } - listAssets(); + callListAssets(); // [END cloudasset_v1_generated_AssetService_ListAssets_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js index 97476d935b1..e94a7aa304f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function listFeeds() { + async function callListFeeds() { // Construct request const request = { parent, @@ -43,7 +43,7 @@ function main(parent) { console.log(response); } - listFeeds(); + callListFeeds(); // [END cloudasset_v1_generated_AssetService_ListFeeds_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index 9b3dd1b53b1..acc4033d91f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -23,7 +23,7 @@ function main(scope) { * Required. A scope can be a project, a folder, or an organization. The search is * limited to the IAM policies within the `scope`. The caller must be granted * the - * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * `cloudasset.assets.searchAllIamPolicies` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") @@ -33,15 +33,15 @@ function main(scope) { */ // const scope = 'abc123' /** - * Optional. The query statement. See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * Optional. The query statement. See how to construct a + * query (https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the * IAM policies within the specified `scope`. Note that the query string is * compared against each Cloud IAM policy binding, including its members, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * policy structure, see IAM policy + * doc (https://cloud.google.com/iam/docs/policies#structure). * Examples: * * `policy:amy@gmail.com` to find IAM policy bindings that specify user * "amy@gmail.com". @@ -91,8 +91,8 @@ function main(scope) { // const pageToken = 'abc123' /** * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset - * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * will search the IAM policies that are attached to all the searchable asset + * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type * starts with "compute.googleapis.com". @@ -100,7 +100,7 @@ function main(scope) { * "Instance". * * ".*Instance.*" snapshots IAM policies attached to asset type contains * "Instance". - * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. */ @@ -125,7 +125,7 @@ function main(scope) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function searchAllIamPolicies() { + async function callSearchAllIamPolicies() { // Construct request const request = { scope, @@ -138,7 +138,7 @@ function main(scope) { } } - searchAllIamPolicies(); + callSearchAllIamPolicies(); // [END cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index 16c28272e40..1ec152145c9 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -22,7 +22,7 @@ function main(scope) { /** * Required. A scope can be a project, a folder, or an organization. The search is * limited to the resources within the `scope`. The caller must be granted the - * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * `cloudasset.assets.searchAllResources` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") @@ -32,8 +32,8 @@ function main(scope) { */ // const scope = 'abc123' /** - * Optional. The query statement. See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * Optional. The query statement. See how to construct a + * query (https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the * resources within the specified `scope`. * Examples: @@ -74,14 +74,14 @@ function main(scope) { // const query = 'abc123' /** * Optional. A list of asset types that this request searches for. If empty, it will - * search all the [searchable asset - * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * search all the searchable asset + * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots resources whose asset type starts * with "compute.googleapis.com". * * ".*Instance" snapshots resources whose asset type ends with "Instance". * * ".*Instance.*" snapshots resources whose asset type contains "Instance". - * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. */ @@ -150,7 +150,7 @@ function main(scope) { * returned. * Any invalid field path will trigger INVALID_ARGUMENT error. */ - // const readMask = '' + // const readMask = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1; @@ -158,7 +158,7 @@ function main(scope) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function searchAllResources() { + async function callSearchAllResources() { // Construct request const request = { scope, @@ -171,7 +171,7 @@ function main(scope) { } } - searchAllResources(); + callSearchAllResources(); // [END cloudasset_v1_generated_AssetService_SearchAllResources_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index fc0b5b5aff4..7b8090fb5f4 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -26,13 +26,13 @@ function main(feed, updateMask) { * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. */ - // const feed = '' + // const feed = {} /** * Required. Only updates the `feed` fields indicated by this mask. * The field mask must not be empty, and it must not contain fields that * are immutable or only set by the server. */ - // const updateMask = '' + // const updateMask = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1; @@ -40,7 +40,7 @@ function main(feed, updateMask) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function updateFeed() { + async function callUpdateFeed() { // Construct request const request = { feed, @@ -52,7 +52,7 @@ function main(feed, updateMask) { console.log(response); } - updateFeed(); + callUpdateFeed(); // [END cloudasset_v1_generated_AssetService_UpdateFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js index ce7a4481d43..2879ca874c4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js @@ -56,7 +56,7 @@ function main(scope) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function searchAllIamPolicies() { + async function callSearchAllIamPolicies() { // Construct request const request = { scope, @@ -69,7 +69,7 @@ function main(scope) { } } - searchAllIamPolicies(); + callSearchAllIamPolicies(); // [END cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js index d5f28f1956c..856dcdbc27c 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js @@ -65,7 +65,7 @@ function main(scope) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function searchAllResources() { + async function callSearchAllResources() { // Construct request const request = { scope, @@ -78,7 +78,7 @@ function main(scope) { } } - searchAllResources(); + callSearchAllResources(); // [END cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js index 9cae8dd8cd8..388cde9c84e 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js @@ -39,7 +39,7 @@ function main(parent, feedId, feed) { * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id */ - // const feed = '' + // const feed = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; @@ -47,7 +47,7 @@ function main(parent, feedId, feed) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function createFeed() { + async function callCreateFeed() { // Construct request const request = { parent, @@ -60,7 +60,7 @@ function main(parent, feedId, feed) { console.log(response); } - createFeed(); + callCreateFeed(); // [END cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js index 4b8c15b0146..95368bbc74a 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function deleteFeed() { + async function callDeleteFeed() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteFeed(); + callDeleteFeed(); // [END cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js index c0fdb7a9e80..e1114eb44b5 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function getFeed() { + async function callGetFeed() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getFeed(); + callGetFeed(); // [END cloudasset_v1p2beta1_generated_AssetService_GetFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js index c0e67b8d0ab..de139a74f36 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function listFeeds() { + async function callListFeeds() { // Construct request const request = { parent, @@ -43,7 +43,7 @@ function main(parent) { console.log(response); } - listFeeds(); + callListFeeds(); // [END cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js index 0cfbf0c2319..9bdcd533ad6 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js @@ -26,13 +26,13 @@ function main(feed, updateMask) { * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. */ - // const feed = '' + // const feed = {} /** * Required. Only updates the `feed` fields indicated by this mask. * The field mask must not be empty, and it must not contain fields that * are immutable or only set by the server. */ - // const updateMask = '' + // const updateMask = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; @@ -40,7 +40,7 @@ function main(feed, updateMask) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function updateFeed() { + async function callUpdateFeed() { // Construct request const request = { feed, @@ -52,7 +52,7 @@ function main(feed, updateMask) { console.log(response); } - updateFeed(); + callUpdateFeed(); // [END cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js index 40f9fe5cab5..5653b6b045e 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js @@ -22,11 +22,11 @@ function main(analysisQuery) { /** * Required. The request query. */ - // const analysisQuery = '' + // const analysisQuery = {} /** * Optional. The request options. */ - // const options = '' + // const options = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1; @@ -34,7 +34,7 @@ function main(analysisQuery) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function analyzeIamPolicy() { + async function callAnalyzeIamPolicy() { // Construct request const request = { analysisQuery, @@ -45,7 +45,7 @@ function main(analysisQuery) { console.log(response); } - analyzeIamPolicy(); + callAnalyzeIamPolicy(); // [END cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js index e72fda42aca..91299962da2 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js @@ -22,15 +22,15 @@ function main(analysisQuery, outputConfig) { /** * Required. The request query. */ - // const analysisQuery = '' + // const analysisQuery = {} /** * Optional. The request options. */ - // const options = '' + // const options = {} /** * Required. Output configuration indicating where the results will be output to. */ - // const outputConfig = '' + // const outputConfig = {} // Imports the Asset library const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1; @@ -38,7 +38,7 @@ function main(analysisQuery, outputConfig) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function exportIamPolicyAnalysis() { + async function callExportIamPolicyAnalysis() { // Construct request const request = { analysisQuery, @@ -51,7 +51,7 @@ function main(analysisQuery, outputConfig) { console.log(response); } - exportIamPolicyAnalysis(); + callExportIamPolicyAnalysis(); // [END cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async] } diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js index b4424c7c9b3..ba81b2f8b32 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js @@ -33,12 +33,12 @@ function main(parent) { * and indexing, there is a volatile window during which running the same * query may get different results. */ - // const readTime = '' + // const readTime = {} /** * A list of asset types of which to take a snapshot for. For example: * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * returned. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) * for all supported asset types. */ // const assetTypes = 'abc123' @@ -46,7 +46,7 @@ function main(parent) { * Asset content type. If not specified, no content but the asset name will * be returned. */ - // const contentType = '' + // const contentType = {} /** * The maximum number of assets to be returned in a single response. Default * is 100, minimum is 1, and maximum is 1000. @@ -65,7 +65,7 @@ function main(parent) { // Instantiates a client const assetClient = new AssetServiceClient(); - async function listAssets() { + async function callListAssets() { // Construct request const request = { parent, @@ -78,7 +78,7 @@ function main(parent) { } } - listAssets(); + callListAssets(); // [END cloudasset_v1p5beta1_generated_AssetService_ListAssets_async] } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 29343243d2b..0ef75755d40 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -400,37 +400,6 @@ export class AssetServiceClient { // ------------------- // -- Service calls -- // ------------------- - batchGetAssetsHistory( - request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | undefined, - {} | undefined - ] - >; - batchGetAssetsHistory( - request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest - | null - | undefined, - {} | null | undefined - > - ): void; - batchGetAssetsHistory( - request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, - callback: Callback< - protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, - | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Batch gets the update history of assets that overlap a time window. * For IAM_POLICY content, this API outputs history when the asset and its @@ -488,9 +457,40 @@ export class AssetServiceClient { * 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.batchGetAssetsHistory(request); + * @example include:samples/generated/v1/asset_service.batch_get_assets_history.js + * region_tag:cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async */ + batchGetAssetsHistory( + request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest | undefined, + {} | undefined + ] + >; + batchGetAssetsHistory( + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchGetAssetsHistory( + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null + | undefined, + {} | null | undefined + > + ): void; batchGetAssetsHistory( request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, optionsOrCallback?: @@ -534,33 +534,6 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.batchGetAssetsHistory(request, options, callback); } - createFeed( - request?: protos.google.cloud.asset.v1.ICreateFeedRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IFeed, - protos.google.cloud.asset.v1.ICreateFeedRequest | undefined, - {} | undefined - ] - >; - createFeed( - request: protos.google.cloud.asset.v1.ICreateFeedRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.asset.v1.IFeed, - protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, - {} | null | undefined - > - ): void; - createFeed( - request: protos.google.cloud.asset.v1.ICreateFeedRequest, - callback: Callback< - protos.google.cloud.asset.v1.IFeed, - protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Creates a feed in a parent project/folder/organization to listen to its * asset updates. @@ -589,9 +562,36 @@ export class AssetServiceClient { * 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.createFeed(request); + * @example include:samples/generated/v1/asset_service.create_feed.js + * region_tag:cloudasset_v1_generated_AssetService_CreateFeed_async */ + createFeed( + request?: protos.google.cloud.asset.v1.ICreateFeedRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + ] + >; + createFeed( + request: protos.google.cloud.asset.v1.ICreateFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + createFeed( + request: protos.google.cloud.asset.v1.ICreateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; createFeed( request?: protos.google.cloud.asset.v1.ICreateFeedRequest, optionsOrCallback?: @@ -631,6 +631,26 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.createFeed(request, options, callback); } + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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 [Feed]{@link google.cloud.asset.v1.Feed}. + * 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/asset_service.get_feed.js + * region_tag:cloudasset_v1_generated_AssetService_GetFeed_async + */ getFeed( request?: protos.google.cloud.asset.v1.IGetFeedRequest, options?: CallOptions @@ -658,26 +678,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Gets details about an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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 [Feed]{@link google.cloud.asset.v1.Feed}. - * 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.getFeed(request); - */ getFeed( request?: protos.google.cloud.asset.v1.IGetFeedRequest, optionsOrCallback?: @@ -717,6 +717,25 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.getFeed(request, options, callback); } + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @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 [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. + * 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/asset_service.list_feeds.js + * region_tag:cloudasset_v1_generated_AssetService_ListFeeds_async + */ listFeeds( request?: protos.google.cloud.asset.v1.IListFeedsRequest, options?: CallOptions @@ -744,25 +763,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Lists all asset feeds in a parent project/folder/organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * @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 [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. - * 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.listFeeds(request); - */ listFeeds( request?: protos.google.cloud.asset.v1.IListFeedsRequest, optionsOrCallback?: @@ -802,6 +802,31 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.listFeeds(request, options, callback); } + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @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 [Feed]{@link google.cloud.asset.v1.Feed}. + * 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/asset_service.update_feed.js + * region_tag:cloudasset_v1_generated_AssetService_UpdateFeed_async + */ updateFeed( request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, options?: CallOptions @@ -829,31 +854,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Updates an asset feed configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * @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 [Feed]{@link google.cloud.asset.v1.Feed}. - * 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.updateFeed(request); - */ updateFeed( request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, optionsOrCallback?: @@ -893,6 +893,26 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.updateFeed(request, options, callback); } + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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/asset_service.delete_feed.js + * region_tag:cloudasset_v1_generated_AssetService_DeleteFeed_async + */ deleteFeed( request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, options?: CallOptions @@ -920,26 +940,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Deletes an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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.deleteFeed(request); - */ deleteFeed( request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, optionsOrCallback?: @@ -979,33 +979,6 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.deleteFeed(request, options, callback); } - analyzeIamPolicy( - request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, - {} | undefined - ] - >; - analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - analyzeIamPolicy( - request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, - callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Analyzes IAM policies to answer which identities have what accesses on * which resources. @@ -1032,9 +1005,36 @@ export class AssetServiceClient { * 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.analyzeIamPolicy(request); + * @example include:samples/generated/v1/asset_service.analyze_iam_policy.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async */ + analyzeIamPolicy( + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, + {} | undefined + ] + >; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; analyzeIamPolicy( request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, optionsOrCallback?: @@ -1076,33 +1076,6 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.analyzeIamPolicy(request, options, callback); } - analyzeMove( - request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, - {} | undefined - ] - >; - analyzeMove( - request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, - {} | null | undefined - > - ): void; - analyzeMove( - request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, - callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Analyze moving a resource to a specified destination without kicking off * the actual move. The analysis is best effort depending on the user's @@ -1133,9 +1106,36 @@ export class AssetServiceClient { * 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.analyzeMove(request); + * @example include:samples/generated/v1/asset_service.analyze_move.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeMove_async */ + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, + {} | undefined + ] + >; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; analyzeMove( request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, optionsOrCallback?: @@ -1176,42 +1176,6 @@ export class AssetServiceClient { return this.innerApiCalls.analyzeMove(request, options, callback); } - exportAssets( - request?: protos.google.cloud.asset.v1.IExportAssetsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - exportAssets( - request: protos.google.cloud.asset.v1.IExportAssetsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - exportAssets( - request: protos.google.cloud.asset.v1.IExportAssetsRequest, - callback: Callback< - LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Exports assets with time and resource types to a given Cloud Storage * location/BigQuery table. For Cloud Storage location destinations, the @@ -1286,10 +1250,45 @@ export class AssetServiceClient { * 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.exportAssets(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v1/asset_service.export_assets.js + * region_tag:cloudasset_v1_generated_AssetService_ExportAssets_async */ + exportAssets( + request?: protos.google.cloud.asset.v1.IExportAssetsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportAssets( + request: protos.google.cloud.asset.v1.IExportAssetsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportAssets( + request: protos.google.cloud.asset.v1.IExportAssetsRequest, + callback: Callback< + LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; exportAssets( request?: protos.google.cloud.asset.v1.IExportAssetsRequest, optionsOrCallback?: @@ -1347,11 +1346,8 @@ export class AssetServiceClient { * 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 checkExportAssetsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/asset_service.export_assets.js + * region_tag:cloudasset_v1_generated_AssetService_ExportAssets_async */ async checkExportAssetsProgress( name: string @@ -1375,6 +1371,35 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest >; } + /** + * Analyzes IAM policies asynchronously to answer which identities have what + * accesses on which resources, and writes the analysis results to a Google + * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the + * output format is the JSON format that represents a + * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. This method implements the + * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation + * status. We recommend intervals of at least 2 seconds with exponential + * backoff retry to poll the operation result. The metadata contains the + * metadata for the long-running operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output to. + * @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/asset_service.analyze_iam_policy_longrunning.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async + */ analyzeIamPolicyLongrunning( request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, options?: CallOptions @@ -1411,36 +1436,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Analyzes IAM policies asynchronously to answer which identities have what - * accesses on which resources, and writes the analysis results to a Google - * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the - * output format is the JSON format that represents a - * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. This method implements the - * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation - * status. We recommend intervals of at least 2 seconds with exponential - * backoff retry to poll the operation result. The metadata contains the - * metadata for the long-running operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery - * Required. The request query. - * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output to. - * @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.analyzeIamPolicyLongrunning(request); - * const [response] = await operation.promise(); - */ analyzeIamPolicyLongrunning( request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, optionsOrCallback?: @@ -1502,11 +1497,8 @@ export class AssetServiceClient { * 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 checkAnalyzeIamPolicyLongrunningProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async */ async checkAnalyzeIamPolicyLongrunningProgress( name: string @@ -1530,33 +1522,6 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata >; } - listAssets( - request?: protos.google.cloud.asset.v1.IListAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IAsset[], - protos.google.cloud.asset.v1.IListAssetsRequest | null, - protos.google.cloud.asset.v1.IListAssetsResponse - ] - >; - listAssets( - request: protos.google.cloud.asset.v1.IListAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.asset.v1.IListAssetsRequest, - protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, - protos.google.cloud.asset.v1.IAsset - > - ): void; - listAssets( - request: protos.google.cloud.asset.v1.IListAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.asset.v1.IListAssetsRequest, - protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, - protos.google.cloud.asset.v1.IAsset - > - ): void; /** * Lists assets with time and resource types and returns paged results in * response. @@ -1632,6 +1597,33 @@ export class AssetServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAssets( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IAsset[], + protos.google.cloud.asset.v1.IListAssetsRequest | null, + protos.google.cloud.asset.v1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + > + ): void; + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + > + ): void; listAssets( request?: protos.google.cloud.asset.v1.IListAssetsRequest, optionsOrCallback?: @@ -1838,11 +1830,8 @@ export class AssetServiceClient { * 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.listAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/asset_service.list_assets.js + * region_tag:cloudasset_v1_generated_AssetService_ListAssets_async */ listAssetsAsync( request?: protos.google.cloud.asset.v1.IListAssetsRequest, @@ -1856,7 +1845,6 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1866,37 +1854,6 @@ export class AssetServiceClient { callSettings ) as AsyncIterable; } - searchAllResources( - request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IResourceSearchResult[], - protos.google.cloud.asset.v1.ISearchAllResourcesRequest | null, - protos.google.cloud.asset.v1.ISearchAllResourcesResponse - ] - >; - searchAllResources( - request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - | protos.google.cloud.asset.v1.ISearchAllResourcesResponse - | null - | undefined, - protos.google.cloud.asset.v1.IResourceSearchResult - > - ): void; - searchAllResources( - request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.asset.v1.ISearchAllResourcesRequest, - | protos.google.cloud.asset.v1.ISearchAllResourcesResponse - | null - | undefined, - protos.google.cloud.asset.v1.IResourceSearchResult - > - ): void; /** * Searches all Cloud resources within the specified scope, such as a project, * folder, or organization. The caller must be granted the @@ -2048,6 +2005,37 @@ export class AssetServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAllResources( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IResourceSearchResult[], + protos.google.cloud.asset.v1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse + ] + >; + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + > + ): void; + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + > + ): void; searchAllResources( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, optionsOrCallback?: @@ -2406,11 +2394,8 @@ export class AssetServiceClient { * 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.searchAllResourcesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/asset_service.search_all_resources.js + * region_tag:cloudasset_v1_generated_AssetService_SearchAllResources_async */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, @@ -2424,7 +2409,6 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2434,37 +2418,6 @@ export class AssetServiceClient { callSettings ) as AsyncIterable; } - searchAllIamPolicies( - request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1.IIamPolicySearchResult[], - protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest | null, - protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse - ] - >; - searchAllIamPolicies( - request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse - | null - | undefined, - protos.google.cloud.asset.v1.IIamPolicySearchResult - > - ): void; - searchAllIamPolicies( - request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - callback: PaginationCallback< - protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, - | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse - | null - | undefined, - protos.google.cloud.asset.v1.IIamPolicySearchResult - > - ): void; /** * Searches all IAM policies within the specified scope, such as a project, * folder, or organization. The caller must be granted the @@ -2580,6 +2533,37 @@ export class AssetServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAllIamPolicies( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + ] + >; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + > + ): void; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + > + ): void; searchAllIamPolicies( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, optionsOrCallback?: @@ -2866,11 +2850,8 @@ export class AssetServiceClient { * 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.searchAllIamPoliciesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/asset_service.search_all_iam_policies.js + * region_tag:cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, @@ -2884,7 +2865,6 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 1cfca2194f5..2093f409813 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -310,37 +310,6 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- - searchAllResources( - request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, - protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse - ] - >; - searchAllResources( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse - | null - | undefined, - protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata - > - ): void; - searchAllResources( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, - | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse - | null - | undefined, - protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata - > - ): void; /** * Searches all the resources under a given accessible CRM scope * (project/folder/organization). This RPC gives callers @@ -391,6 +360,37 @@ export class AssetServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAllResources( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ] + >; + searchAllResources( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata + > + ): void; + searchAllResources( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata + > + ): void; searchAllResources( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, optionsOrCallback?: @@ -543,11 +543,8 @@ export class AssetServiceClient { * 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.searchAllResourcesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/asset_service.search_all_resources.js + * region_tag:cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async */ searchAllResourcesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, @@ -561,7 +558,6 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -571,37 +567,6 @@ export class AssetServiceClient { callSettings ) as AsyncIterable; } - searchAllIamPolicies( - request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, - protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse - ] - >; - searchAllIamPolicies( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse - | null - | undefined, - protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult - > - ): void; - searchAllIamPolicies( - request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - callback: PaginationCallback< - protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, - | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse - | null - | undefined, - protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult - > - ): void; /** * Searches all the IAM policies under a given accessible CRM scope * (project/folder/organization). This RPC gives callers @@ -647,6 +612,37 @@ export class AssetServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAllIamPolicies( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ] + >; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult + > + ): void; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult + > + ): void; searchAllIamPolicies( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, optionsOrCallback?: @@ -789,11 +785,8 @@ export class AssetServiceClient { * 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.searchAllIamPoliciesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js + * region_tag:cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async */ searchAllIamPoliciesAsync( request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, @@ -807,7 +800,6 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ scope: request.scope || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 43e4ace69e8..deb79298129 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -303,33 +303,6 @@ export class AssetServiceClient { // ------------------- // -- Service calls -- // ------------------- - createFeed( - request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1p2beta1.IFeed, - protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, - {} | undefined - ] - >; - createFeed( - request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.asset.v1p2beta1.IFeed, - protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, - {} | null | undefined - > - ): void; - createFeed( - request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, - callback: Callback< - protos.google.cloud.asset.v1p2beta1.IFeed, - protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Creates a feed in a parent project/folder/organization to listen to its * asset updates. @@ -358,9 +331,36 @@ export class AssetServiceClient { * 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.createFeed(request); + * @example include:samples/generated/v1p2beta1/asset_service.create_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async */ + createFeed( + request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + ] + >; + createFeed( + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; + createFeed( + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + ): void; createFeed( request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, optionsOrCallback?: @@ -402,6 +402,26 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.createFeed(request, options, callback); } + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * 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/v1p2beta1/asset_service.get_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_GetFeed_async + */ getFeed( request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, options?: CallOptions @@ -429,26 +449,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Gets details about an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * 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.getFeed(request); - */ getFeed( request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, optionsOrCallback?: @@ -490,6 +490,25 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.getFeed(request, options, callback); } + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @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 [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. + * 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/v1p2beta1/asset_service.list_feeds.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async + */ listFeeds( request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, options?: CallOptions @@ -517,25 +536,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Lists all asset feeds in a parent project/folder/organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * @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 [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. - * 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.listFeeds(request); - */ listFeeds( request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, optionsOrCallback?: @@ -577,6 +577,31 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.listFeeds(request, options, callback); } + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * 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/v1p2beta1/asset_service.update_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async + */ updateFeed( request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, options?: CallOptions @@ -604,31 +629,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Updates an asset feed configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1p2beta1.Feed} request.feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * 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.updateFeed(request); - */ updateFeed( request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, optionsOrCallback?: @@ -670,6 +670,26 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.updateFeed(request, options, callback); } + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @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/v1p2beta1/asset_service.delete_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async + */ deleteFeed( request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, options?: CallOptions @@ -697,26 +717,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Deletes an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @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.deleteFeed(request); - */ deleteFeed( request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, optionsOrCallback?: diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 8f682983863..5191de63efb 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -322,6 +322,26 @@ export class AssetServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Analyzes IAM policies based on the specified request. Returns + * a list of {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult|IamPolicyAnalysisResult} matching the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} [request.options] + * Optional. The request options. + * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse}. + * 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/v1p4beta1/asset_service.analyze_iam_policy.js + * region_tag:cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async + */ analyzeIamPolicy( request?: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, options?: CallOptions @@ -353,26 +373,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Analyzes IAM policies based on the specified request. Returns - * a list of {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult|IamPolicyAnalysisResult} matching the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery - * Required. The request query. - * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} [request.options] - * Optional. The request options. - * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse}. - * 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.analyzeIamPolicy(request); - */ analyzeIamPolicy( request?: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, optionsOrCallback?: @@ -417,6 +417,32 @@ export class AssetServiceClient { return this.innerApiCalls.analyzeIamPolicy(request, options, callback); } + /** + * Exports IAM policy analysis based on the specified request. This API + * implements the {@link google.longrunning.Operation|google.longrunning.Operation} API allowing you to keep + * track of the export. The metadata contains the request to help callers to + * map responses to requests. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} [request.options] + * Optional. The request options. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output to. + * @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/v1p4beta1/asset_service.export_iam_policy_analysis.js + * region_tag:cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async + */ exportIamPolicyAnalysis( request?: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, options?: CallOptions @@ -453,33 +479,6 @@ export class AssetServiceClient { {} | null | undefined > ): void; - /** - * Exports IAM policy analysis based on the specified request. This API - * implements the {@link google.longrunning.Operation|google.longrunning.Operation} API allowing you to keep - * track of the export. The metadata contains the request to help callers to - * map responses to requests. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery - * Required. The request query. - * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} [request.options] - * Optional. The request options. - * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output to. - * @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.exportIamPolicyAnalysis(request); - * const [response] = await operation.promise(); - */ exportIamPolicyAnalysis( request?: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, optionsOrCallback?: @@ -541,11 +540,8 @@ export class AssetServiceClient { * 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 checkExportIamPolicyAnalysisProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js + * region_tag:cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async */ async checkExportIamPolicyAnalysisProgress( name: string diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 8db22838d81..cfc36d44816 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -318,37 +318,6 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- - listAssets( - request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.asset.v1p5beta1.IAsset[], - protos.google.cloud.asset.v1p5beta1.IListAssetsRequest | null, - protos.google.cloud.asset.v1p5beta1.IListAssetsResponse - ] - >; - listAssets( - request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.asset.v1p5beta1.IAsset - > - ): void; - listAssets( - request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - callback: PaginationCallback< - protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, - | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse - | null - | undefined, - protos.google.cloud.asset.v1p5beta1.IAsset - > - ): void; /** * Lists assets with time and resource types and returns paged results in * response. @@ -395,6 +364,37 @@ export class AssetServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAssets( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1p5beta1.IAsset[], + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest | null, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + > + ): void; + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + > + ): void; listAssets( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, optionsOrCallback?: @@ -547,11 +547,8 @@ export class AssetServiceClient { * 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.listAssetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1p5beta1/asset_service.list_assets.js + * region_tag:cloudasset_v1p5beta1_generated_AssetService_ListAssets_async */ listAssetsAsync( request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, @@ -565,7 +562,6 @@ export class AssetServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From 22f5e784ad6b8ab5985b298eafb4794a1dbbbfe7 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:22:20 -0800 Subject: [PATCH 372/429] feat: Update OSConfig API (#578) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Update OSConfig API PiperOrigin-RevId: 409204961 Source-Link: https://github.com/googleapis/googleapis/commit/a85beae06501cc06091191781ec06d778f525365 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b334c5d7b45f4af1133af971789048299b66dc39 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjMzNGM1ZDdiNDVmNGFmMTEzM2FmOTcxNzg5MDQ4Mjk5YjY2ZGMzOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/osconfig/v1/vulnerability.proto | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto index af86fbe098f..b8ca5175ce0 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -75,6 +75,32 @@ message VulnerabilityReport { repeated Reference references = 6; } + // OS inventory item that is affected by a vulnerability or fixed as a + // result of a vulnerability. + message Item { + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some + // operating systems, this field might be empty. + string installed_inventory_item_id = 1; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + string available_inventory_item_id = 2; + + // The recommended [CPE URI](https://cpe.mitre.org/specification/) update + // that contains a fix for this vulnerability. + string fixed_cpe_uri = 3; + + // The upstream OS patch, packages or KB that fixes the vulnerability. + string upstream_fix = 4; + } + // Contains metadata as per the upstream feed of the operating system and // NVD. Details details = 1; @@ -84,7 +110,7 @@ message VulnerabilityReport { // If the vulnerability report was not updated after the VM inventory // update, these values might not display in VM inventory. For some distros, // this field may be empty. - repeated string installed_inventory_item_ids = 2; + repeated string installed_inventory_item_ids = 2 [deprecated = true]; // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. // If the vulnerability report was not updated after the VM inventory @@ -92,13 +118,16 @@ message VulnerabilityReport { // available fix, the field is empty. The `inventory_item` value specifies // the latest `SoftwarePackage` available to the VM that fixes the // vulnerability. - repeated string available_inventory_item_ids = 3; + repeated string available_inventory_item_ids = 3 [deprecated = true]; // The timestamp for when the vulnerability was first detected. google.protobuf.Timestamp create_time = 4; // The timestamp for when the vulnerability was last modified. google.protobuf.Timestamp update_time = 5; + + // List of items affected by the vulnerability. + repeated Item items = 6; } // Output only. The `vulnerabilityReport` API resource name. From c56922081da9b9891a9272ce6f11cd42cfdfb74e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Nov 2021 00:32:16 +0000 Subject: [PATCH 373/429] chore: release 3.22.0 (#579) :robot: I have created a release \*beep\* \*boop\* --- ## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) ### Features * Update OSConfig API ([#578](https://www.github.com/googleapis/nodejs-asset/issues/578)) ([8af0ac8](https://www.github.com/googleapis/nodejs-asset/commit/8af0ac8a915b8b72d379b4e2a14c888ef98dfcf1)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index ec1c88fc41e..c9b2b7448e2 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) + + +### Features + +* Update OSConfig API ([#578](https://www.github.com/googleapis/nodejs-asset/issues/578)) ([8af0ac8](https://www.github.com/googleapis/nodejs-asset/commit/8af0ac8a915b8b72d379b4e2a14c888ef98dfcf1)) + ## [3.21.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.20.0...v3.21.0) (2021-11-09) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c968581f090..56501658519 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.21.0", + "version": "3.22.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index fa28c0433b7..8a58f20e49e 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 360000" }, "dependencies": { - "@google-cloud/asset": "^3.21.0", + "@google-cloud/asset": "^3.22.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 635ceee0089092473d3006a3dadaaea2cc94b1a7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 22:54:21 +0000 Subject: [PATCH 374/429] build: add generated samples to .eslintignore (#581) --- packages/google-cloud-asset/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-asset/.eslintignore b/packages/google-cloud-asset/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-asset/.eslintignore +++ b/packages/google-cloud-asset/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From a1d9545284e3517575d2ce1b99b2c1530f6605e5 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 19:50:20 +0000 Subject: [PATCH 375/429] docs(node): support "stable"/"preview" release level (#1312) (#586) --- packages/google-cloud-asset/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 30f841e8d65..e028904f8e0 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -152,6 +152,8 @@ are addressed with the highest priority. + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 5c5e9f280383fe5b9e155463b9bc59e8e1868e24 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 12:11:30 -0500 Subject: [PATCH 376/429] chore: add api_shortname and library_type to repo metadata (#585) --- packages/google-cloud-asset/.repo-metadata.json | 6 ++++-- packages/google-cloud-asset/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index b50a912ff0c..4c412267323 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -4,12 +4,14 @@ "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/asset/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", - "release_level": "ga", + "release_level": "stable", "language": "nodejs", "repo": "googleapis/nodejs-asset", "distribution_name": "@google-cloud/asset", "api_id": "cloudasset.googleapis.com", "requires_billing": true, "default_version": "v1", - "codeowner_team": "@googleapis/cloud-asset-team" + "codeowner_team": "@googleapis/cloud-asset-team", + "api_shortname": "asset", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index e028904f8e0..bd27b942124 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -4,7 +4,7 @@ # [Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) + [![npm version](https://img.shields.io/npm/v/@google-cloud/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) @@ -142,10 +142,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +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 **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -153,7 +153,6 @@ are addressed with the highest priority. - More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 05b3fcc7c0f648f71a5f44b0327a7eacadb9b9a2 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:20:32 +0000 Subject: [PATCH 377/429] docs(badges): tweak badge to use new preview/stable language (#1314) (#588) --- packages/google-cloud-asset/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index bd27b942124..36d1005ef69 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -4,9 +4,8 @@ # [Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) - +[![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/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-asset/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-asset) From 91fb639b619da42d442af59d0dc52ac60d159abf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 19:30:24 +0000 Subject: [PATCH 378/429] chore: update github issue templates (#1085) (#594) --- packages/google-cloud-asset/protos/protos.d.ts | 2 +- packages/google-cloud-asset/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index bc05ce602f5..f58eeafa203 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index c2bc14ca3a3..e75ccb1fe2c 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/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 72841a014d687774537a747345c4875f14e5358c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 23:51:49 -0800 Subject: [PATCH 379/429] build: update copyright year to 2022 (#595) 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 Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-asset/.jsdoc.js | 4 ++-- .../samples/generated/v1/asset_service.analyze_iam_policy.js | 1 + .../v1/asset_service.analyze_iam_policy_longrunning.js | 1 + .../samples/generated/v1/asset_service.analyze_move.js | 1 + .../generated/v1/asset_service.batch_get_assets_history.js | 1 + .../samples/generated/v1/asset_service.create_feed.js | 1 + .../samples/generated/v1/asset_service.delete_feed.js | 1 + .../samples/generated/v1/asset_service.export_assets.js | 3 ++- .../samples/generated/v1/asset_service.get_feed.js | 1 + .../samples/generated/v1/asset_service.list_assets.js | 5 +++-- .../samples/generated/v1/asset_service.list_feeds.js | 1 + .../generated/v1/asset_service.search_all_iam_policies.js | 3 ++- .../generated/v1/asset_service.search_all_resources.js | 3 ++- .../samples/generated/v1/asset_service.update_feed.js | 1 + .../v1p1beta1/asset_service.search_all_iam_policies.js | 3 ++- .../v1p1beta1/asset_service.search_all_resources.js | 3 ++- .../samples/generated/v1p2beta1/asset_service.create_feed.js | 1 + .../samples/generated/v1p2beta1/asset_service.delete_feed.js | 1 + .../samples/generated/v1p2beta1/asset_service.get_feed.js | 1 + .../samples/generated/v1p2beta1/asset_service.list_feeds.js | 1 + .../samples/generated/v1p2beta1/asset_service.update_feed.js | 1 + .../generated/v1p4beta1/asset_service.analyze_iam_policy.js | 1 + .../v1p4beta1/asset_service.export_iam_policy_analysis.js | 1 + .../samples/generated/v1p5beta1/asset_service.list_assets.js | 3 ++- packages/google-cloud-asset/src/v1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1/index.ts | 2 +- .../google-cloud-asset/src/v1p1beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p1beta1/index.ts | 2 +- .../google-cloud-asset/src/v1p2beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p2beta1/index.ts | 2 +- .../google-cloud-asset/src/v1p4beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p4beta1/index.ts | 2 +- .../google-cloud-asset/src/v1p5beta1/asset_service_client.ts | 2 +- packages/google-cloud-asset/src/v1p5beta1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-asset/system-test/install.ts | 2 +- packages/google-cloud-asset/test/gapic_asset_service_v1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts | 2 +- .../google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts | 2 +- 42 files changed, 51 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index e10d49bd063..a40ee8ff08e 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.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/asset', diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index f36a4e9630a..9af8e276ba2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(analysisQuery) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index 28548a8a30f..74528a1eaf3 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(analysisQuery, outputConfig) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js index e6ea142b34f..ce869443b95 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(resource, destinationParent) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js index 60230130817..9188cf99d62 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index 216f98b4f0c..e527f244a52 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, feedId, feed) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js index 74fd1a9fa22..5e801047966 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index 28684b3b8f6..124cd269f04 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, outputConfig) { @@ -67,7 +68,7 @@ function main(parent, outputConfig) { * * If specified: * it snapshots specified relationships. It returns an error if * any of the relationship_types doesn't belong to the supported - * relationship types of the asset_types or if any of the asset_types + * relationship types of the asset_types or if any of the asset_types * doesn't belong to the source types of the relationship_types. * * Otherwise: * it snapshots the supported relationships for all asset_types or returns diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js index d402cba1d04..ebceb15c9b0 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index 57410a2936d..a9026022cbd 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -74,7 +75,7 @@ function main(parent) { * * If specified: * it snapshots specified relationships. It returns an error if * any of the relationship_types doesn't belong to the supported - * relationship types of the asset_types or if any of the asset_types + * relationship types of the asset_types or if any of the asset_types * doesn't belong to the source types of the relationship_types. * * Otherwise: * it snapshots the supported relationships for all asset_types or returns @@ -101,7 +102,7 @@ function main(parent) { // Run request const iterable = await assetClient.listAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js index e94a7aa304f..f9ac8720393 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index acc4033d91f..1b845d1f725 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(scope) { @@ -134,7 +135,7 @@ function main(scope) { // Run request const iterable = await assetClient.searchAllIamPoliciesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index 1ec152145c9..c1f0367d00b 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(scope) { @@ -167,7 +168,7 @@ function main(scope) { // Run request const iterable = await assetClient.searchAllResourcesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index 7b8090fb5f4..971c0a9073b 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(feed, updateMask) { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js index 2879ca874c4..41382c6cea2 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(scope) { @@ -65,7 +66,7 @@ function main(scope) { // Run request const iterable = await assetClient.searchAllIamPoliciesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js index 856dcdbc27c..6e059aaf175 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(scope) { @@ -74,7 +75,7 @@ function main(scope) { // Run request const iterable = await assetClient.searchAllResourcesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js index 388cde9c84e..ac08a7406b5 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, feedId, feed) { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js index 95368bbc74a..7f5b63b5d1d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js index e1114eb44b5..1d66a374f56 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js index de139a74f36..cfa0817c6e4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js index 9bdcd533ad6..2b2665b0f58 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(feed, updateMask) { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js index 5653b6b045e..ed513d717a4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(analysisQuery) { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js index 91299962da2..448aaaf618e 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(analysisQuery, outputConfig) { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js index ba81b2f8b32..2690cf42a71 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -74,7 +75,7 @@ function main(parent) { // Run request const iterable = await assetClient.listAssetsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 0ef75755d40..42e6f815929 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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-asset/src/v1/index.ts b/packages/google-cloud-asset/src/v1/index.ts index 4f605d7da89..9008232c06e 100644 --- a/packages/google-cloud-asset/src/v1/index.ts +++ b/packages/google-cloud-asset/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-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 2093f409813..2c48b86567d 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_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-asset/src/v1p1beta1/index.ts b/packages/google-cloud-asset/src/v1p1beta1/index.ts index 4f605d7da89..9008232c06e 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/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-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index deb79298129..0dd41509be8 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_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-asset/src/v1p2beta1/index.ts b/packages/google-cloud-asset/src/v1p2beta1/index.ts index 4f605d7da89..9008232c06e 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/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-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 5191de63efb..818e203b832 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_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-asset/src/v1p4beta1/index.ts b/packages/google-cloud-asset/src/v1p4beta1/index.ts index 4f605d7da89..9008232c06e 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/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-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index cfc36d44816..34d540d0d2b 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_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-asset/src/v1p5beta1/index.ts b/packages/google-cloud-asset/src/v1p5beta1/index.ts index 4f605d7da89..9008232c06e 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/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-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js index 2338e58dfd2..9ba258a07c2 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-asset/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-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index f682b8c3424..8fb3fb032ee 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/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-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-asset/system-test/install.ts +++ b/packages/google-cloud-asset/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-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index d3bcf99e463..30d83ff8683 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_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-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index ffdf6762df3..b5bec5f99bf 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.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-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index 2e391e2c83b..7908021622e 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.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-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index a61c35005b6..b618aa9556c 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.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-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index c990f9918b7..93e094962db 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.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 b160e43a4574b1234d5ee2db98b618381d3bc58c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 Jan 2022 09:26:14 +0100 Subject: [PATCH 380/429] chore(deps): update dependency gts to v3 (#591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency gts to v3 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 56501658519..1555e27f238 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -52,7 +52,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", - "gts": "^2.0.0", + "gts": "^3.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From a9c096bbf88f87aa943caeaca8c87b6f701fca13 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:54:41 +0000 Subject: [PATCH 381/429] chore: update v2.12.0 gapic-generator-typescript (#597) - [ ] 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 --- packages/google-cloud-asset/linkinator.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/linkinator.config.json b/packages/google-cloud-asset/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-asset/linkinator.config.json +++ b/packages/google-cloud-asset/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 f1aedc42811bffe0c1a7fd7127620785abc34ae4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:28:42 +0100 Subject: [PATCH 382/429] chore(deps): update dependency sinon to v13 (#599) 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.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1555e27f238..87897a57919 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -60,7 +60,7 @@ "mocha": "^8.0.0", "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.8.3", "webpack": "^5.0.0", From 951163f7038f7ca6dda5299ce453166fcde9fce7 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:10:40 +0000 Subject: [PATCH 383/429] docs(nodejs): version support policy edits (#1346) (#601) --- packages/google-cloud-asset/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 36d1005ef69..b3e43a0e333 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -120,21 +120,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/asset@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 10d3f7ad420c69492a9f0a6e6f718b392bc6d761 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 08:51:48 -0800 Subject: [PATCH 384/429] feat: Update osconfig v1 protos (#602) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Update osconfig v1 protos PiperOrigin-RevId: 427050266 Source-Link: https://github.com/googleapis/googleapis/commit/010716c268b238cc539d301ac115e01362c14dc6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95161e21a033345c5fe13542bb8a82d4b1d08690 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTUxNjFlMjFhMDMzMzQ1YzVmZTEzNTQyYmI4YTgyZDRiMWQwODY5MCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/osconfig/v1/inventory.proto | 12 ++- .../google/cloud/osconfig/v1/os_policy.proto | 56 +++++++------- .../v1/os_policy_assignment_reports.proto | 56 +++++++------- .../cloud/osconfig/v1/osconfig_common.proto | 2 +- .../cloud/osconfig/v1/osconfig_service.proto | 34 ++++++++- .../cloud/osconfig/v1/patch_deployments.proto | 73 +++++++++++++++++-- .../google/cloud/osconfig/v1/patch_jobs.proto | 59 ++++++++------- 7 files changed, 193 insertions(+), 99 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto index 8f89d8b89b9..92c2b81c832 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto @@ -264,12 +264,9 @@ message Inventory { google.protobuf.Timestamp install_time = 5; } - // Contains information about a Windows application as retrieved from the - // Windows Registry. For more information about these fields, see - // - // [Windows Installer Properties for the Uninstall - // Registry](https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key){: - // class="external" } + // Contains information about a Windows application that is retrieved from the + // Windows Registry. For more information about these fields, see: + // https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key message WindowsApplication { // The name of the application or product. string display_name = 1; @@ -305,7 +302,8 @@ message Inventory { map items = 2; // Output only. Timestamp of the last reported inventory for the VM. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // A request message for getting inventory data for the specified VM. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto index a07e251f6b9..7b113f91b3a 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto @@ -28,6 +28,21 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; // An OS policy defines the desired state configuration for a VM. message OSPolicy { + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + // Filtering criteria to select VMs based on inventory details. message InventoryFilter { // Required. The OS short name @@ -96,6 +111,19 @@ message OSPolicy { // A resource that manages a system package. message PackageResource { + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + // A deb package file. dpkg packages only support INSTALLED state. message Deb { // Required. A deb package. @@ -164,19 +192,6 @@ message OSPolicy { repeated string properties = 2; } - // The desired state that the OS Config agent maintains on the VM. - enum DesiredState { - // Unspecified is invalid. - DESIRED_STATE_UNSPECIFIED = 0; - - // Ensure that the package is installed. - INSTALLED = 1; - - // The agent ensures that the package is not installed and - // uninstalls it if detected. - REMOVED = 2; - } - // Required. The desired state the agent should maintain for this package. DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; @@ -498,21 +513,6 @@ message OSPolicy { repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; } - // Policy mode - enum Mode { - // Invalid mode - MODE_UNSPECIFIED = 0; - - // This mode checks if the configuration resources in the policy are in - // their desired state. No actions are performed if they are not in the - // desired state. This mode is used for reporting purposes. - VALIDATION = 1; - - // This mode checks if the configuration resources in the policy are in - // their desired state, and if not, enforces the desired state. - ENFORCEMENT = 2; - } - // Required. The id of the OS policy with the following restrictions: // // * Must contain only lowercase letters, numbers, and hyphens. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto index f610fc5a884..aa4b2b11b4e 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -114,6 +114,27 @@ message OSPolicyAssignmentReport { // Compliance data for an OS policy message OSPolicyCompliance { + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + // Compliance data for an OS policy resource. message OSPolicyResourceCompliance { // Step performed by the OS Config agent for configuring an @@ -152,13 +173,6 @@ message OSPolicyAssignmentReport { string error_message = 2; } - // ExecResource specific output. - message ExecResourceOutput { - // Output from enforcement phase output file (if run). - // Output size is limited to 100K bytes. - bytes enforcement_output = 2; - } - // Possible compliance states for a resource. enum ComplianceState { // The resource is in an unknown compliance state. @@ -174,6 +188,13 @@ message OSPolicyAssignmentReport { NON_COMPLIANT = 2; } + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + // The ID of the OS policy resource. string os_policy_resource_id = 1; @@ -207,27 +228,6 @@ message OSPolicyAssignmentReport { } } - // Possible compliance states for an os policy. - enum ComplianceState { - // The policy is in an unknown compliance state. - // - // Refer to the field `compliance_state_reason` to learn the exact reason - // for the policy to be in this compliance state. - UNKNOWN = 0; - - // Policy is compliant. - // - // The policy is compliant if all the underlying resources are also - // compliant. - COMPLIANT = 1; - - // Policy is non-compliant. - // - // The policy is non-compliant if one or more underlying resources are - // non-compliant. - NON_COMPLIANT = 2; - } - // The OS policy id string os_policy_id = 1; diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto index 43059e9a62e..2b72d6ae945 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.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. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto index ae256fe68f4..515905c87d5 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -16,12 +16,12 @@ syntax = "proto3"; package google.cloud.osconfig.v1; -import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/resource.proto"; import "google/cloud/osconfig/v1/patch_deployments.proto"; import "google/cloud/osconfig/v1/patch_jobs.proto"; import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.OsConfig.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; @@ -123,4 +123,36 @@ service OsConfigService { }; option (google.api.method_signature) = "name"; } + + // Update an OS Config patch deployment. + rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + patch: "/v1/{patch_deployment.name=projects/*/patchDeployments/*}" + body: "patch_deployment" + }; + option (google.api.method_signature) = "patch_deployment,update_mask"; + } + + // Change state of patch deployment to "PAUSED". + // Patch deployment in paused state doesn't generate patch jobs. + rpc PausePatchDeployment(PausePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Change state of patch deployment back to "ACTIVE". + // Patch deployment in active state continues to generate patch jobs. + rpc ResumePatchDeployment(ResumePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } } diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto index 8cf85288297..d5708544f8b 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/osconfig/v1/patch_jobs.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/type/datetime.proto"; import "google/type/dayofweek.proto"; @@ -43,6 +44,19 @@ message PatchDeployment { pattern: "projects/{project}/patchDeployments/{patch_deployment}" }; + // Represents state of patch peployment. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Active value means that patch deployment generates Patch Jobs. + ACTIVE = 1; + + // Paused value means that patch deployment does not generate + // Patch jobs. Requires user action to move in and out from this state. + PAUSED = 2; + } + // Unique name for the patch deployment resource in a project. The patch // deployment name is in the form: // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. @@ -94,6 +108,9 @@ message PatchDeployment { // Optional. Rollout strategy of the patch job. PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the patch deployment. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Sets the time for a one time patch deployment. Timestamp is in @@ -111,16 +128,16 @@ message RecurringSchedule { // Invalid. A frequency must be specified. FREQUENCY_UNSPECIFIED = 0; - // Indicates that the frequency should be expressed in terms of - // weeks. + // Indicates that the frequency of recurrence should be expressed in terms + // of weeks. WEEKLY = 1; - // Indicates that the frequency should be expressed in terms of - // months. + // Indicates that the frequency of recurrence should be expressed in terms + // of months. MONTHLY = 2; - // Indicates that the frequency should be expressed in terms of - // days. + // Indicates that the frequency of recurrence should be expressed in terms + // of days. DAILY = 3; } @@ -197,6 +214,15 @@ message WeekDayOfMonth { // Required. A day of the week. google.type.DayOfWeek day_of_week = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Represents the number of days before or after the given week day + // of month that the patch deployment is scheduled for. For example if + // `week_ordinal` and `day_of_week` values point to the second day of the + // month and this `day_offset` value is set to `3`, the patch deployment takes + // place three days after the second Tuesday of the month. If this value is + // negative, for example -5, the patches are deployed five days before before + // the second Tuesday of the month. Allowed values are in range [-30, 30]. + int32 day_offset = 3 [(google.api.field_behavior) = OPTIONAL]; } // A request message for creating a patch deployment. @@ -276,3 +302,38 @@ message DeletePatchDeploymentRequest { } ]; } + +// A request message for updating a patch deployment. +message UpdatePatchDeploymentRequest { + // Required. The patch deployment to Update. + PatchDeployment patch_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the patch deployment + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for pausing a patch deployment. +message PausePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for resuming a patch deployment. +message ResumePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto index 1fffb532a11..4edfc8df555 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -183,6 +183,34 @@ message PatchJob { pattern: "projects/{project}/patchJobs/{patch_job}" }; + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + // A summary of the current patch state across all instances that this patch // job affects. Contains counts of instances in different states. These states // map to `InstancePatchState`. List patch job instance details to see the @@ -236,34 +264,6 @@ message PatchJob { int64 no_agent_detected_instance_count = 15; } - // Enumeration of the various states a patch job passes through as it - // executes. - enum State { - // State must be specified. - STATE_UNSPECIFIED = 0; - - // The patch job was successfully initiated. - STARTED = 1; - - // The patch job is looking up instances to run the patch on. - INSTANCE_LOOKUP = 2; - - // Instances are being patched. - PATCHING = 3; - - // Patch job completed successfully. - SUCCEEDED = 4; - - // Patch job completed but there were errors. - COMPLETED_WITH_ERRORS = 5; - - // The patch job was canceled. - CANCELED = 6; - - // The patch job timed out. - TIMED_OUT = 7; - } - // Unique identifier for this patch job in the form // `projects/*/patchJobs/*` string name = 1; @@ -369,6 +369,9 @@ message PatchConfig { // The `ExecStep` to run after the patch update. ExecStep post_step = 9; + + // Allows the patch job to run on Managed instance groups (MIGs). + bool mig_instances_allowed = 10; } // Namespace for instance state enums. From ce120322fe51f6be1cd74d2c710abfed4824304c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 11:27:00 -0800 Subject: [PATCH 385/429] chore(main): release 3.23.0 (#603) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index c9b2b7448e2..ab2b3f62434 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [3.23.0](https://github.com/googleapis/nodejs-asset/compare/v3.22.0...v3.23.0) (2022-02-08) + + +### Features + +* Update osconfig v1 protos ([#602](https://github.com/googleapis/nodejs-asset/issues/602)) ([7816c8e](https://github.com/googleapis/nodejs-asset/commit/7816c8ec666cceeb06ac743904b888fa7f4af91a)) + ## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 87897a57919..1a9af22b2b8 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.22.0", + "version": "3.23.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 8a58f20e49e..16e1e2b100e 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 360000" }, "dependencies": { - "@google-cloud/asset": "^3.22.0", + "@google-cloud/asset": "^3.23.0", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From faf687998748fc04d9c5460b536dee41990b30d1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:21:52 -0800 Subject: [PATCH 386/429] fix: Fix description of an interpreter field, validate if the field is not unspecified (#604) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Fix description of an interpreter field, validate if the field is not unspecified PiperOrigin-RevId: 427987153 Source-Link: https://github.com/googleapis/googleapis/commit/a1b62c1cec180b1501f2bbdc096f36feaa602761 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bda75679063f2194c06af55a01c94104eafc2998 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmRhNzU2NzkwNjNmMjE5NGMwNmFmNTVhMDFjOTQxMDRlYWZjMjk5OCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../protos/google/cloud/osconfig/v1/os_policy.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto index 7b113f91b3a..de0db191797 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto @@ -354,7 +354,7 @@ message OSPolicy { message Exec { // The interpreter to use. enum Interpreter { - // Defaults to NONE. + // Invalid value, the request will return validation error. INTERPRETER_UNSPECIFIED = 0; // If an interpreter is not specified, the From b3e608c15b643db8759508855d3a1375a0d6f231 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 09:08:13 -0800 Subject: [PATCH 387/429] chore(main): release 3.23.1 (#605) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index ab2b3f62434..840585cb837 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +### [3.23.1](https://github.com/googleapis/nodejs-asset/compare/v3.23.0...v3.23.1) (2022-02-11) + + +### Bug Fixes + +* Fix description of an interpreter field, validate if the field is not unspecified ([#604](https://github.com/googleapis/nodejs-asset/issues/604)) ([7cebebe](https://github.com/googleapis/nodejs-asset/commit/7cebebeae1b328289c68c590fd3738c89a59b74f)) + ## [3.23.0](https://github.com/googleapis/nodejs-asset/compare/v3.22.0...v3.23.0) (2022-02-08) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 1a9af22b2b8..be6a6761c2a 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.23.0", + "version": "3.23.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 16e1e2b100e..ca8c0be7d84 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 360000" }, "dependencies": { - "@google-cloud/asset": "^3.23.0", + "@google-cloud/asset": "^3.23.1", "@google-cloud/bigquery": "^5.5.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", From 0525731d82a64168824a977d57f7cf710ded8491 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:04:46 +0000 Subject: [PATCH 388/429] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#607) - [ ] 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 --- .../v1/asset_service.analyze_iam_policy.js | 9 +- ..._service.analyze_iam_policy_longrunning.js | 9 +- .../v1/asset_service.analyze_move.js | 9 +- .../asset_service.batch_get_assets_history.js | 9 +- .../generated/v1/asset_service.create_feed.js | 9 +- .../generated/v1/asset_service.delete_feed.js | 9 +- .../v1/asset_service.export_assets.js | 9 +- .../generated/v1/asset_service.get_feed.js | 9 +- .../generated/v1/asset_service.list_assets.js | 9 +- .../generated/v1/asset_service.list_feeds.js | 9 +- .../asset_service.search_all_iam_policies.js | 9 +- .../v1/asset_service.search_all_resources.js | 9 +- .../generated/v1/asset_service.update_feed.js | 9 +- ...nippet_metadata.google.cloud.asset.v1.json | 667 ++++++++++++++++++ .../asset_service.search_all_iam_policies.js | 9 +- .../asset_service.search_all_resources.js | 9 +- ...metadata.google.cloud.asset.v1p1beta1.json | 127 ++++ .../v1p2beta1/asset_service.create_feed.js | 9 +- .../v1p2beta1/asset_service.delete_feed.js | 9 +- .../v1p2beta1/asset_service.get_feed.js | 9 +- .../v1p2beta1/asset_service.list_feeds.js | 9 +- .../v1p2beta1/asset_service.update_feed.js | 9 +- ...metadata.google.cloud.asset.v1p2beta1.json | 227 ++++++ .../asset_service.analyze_iam_policy.js | 9 +- ...sset_service.export_iam_policy_analysis.js | 9 +- ...metadata.google.cloud.asset.v1p4beta1.json | 107 +++ .../v1p5beta1/asset_service.list_assets.js | 9 +- ...metadata.google.cloud.asset.v1p5beta1.json | 75 ++ .../src/v1/asset_service_client.ts | 5 +- .../src/v1p1beta1/asset_service_client.ts | 5 +- .../src/v1p2beta1/asset_service_client.ts | 5 +- .../src/v1p4beta1/asset_service_client.ts | 5 +- .../src/v1p5beta1/asset_service_client.ts | 5 +- .../test/gapic_asset_service_v1.ts | 152 +++- .../test/gapic_asset_service_v1p1beta1.ts | 19 +- .../test/gapic_asset_service_v1p2beta1.ts | 100 ++- .../test/gapic_asset_service_v1p4beta1.ts | 36 +- .../test/gapic_asset_service_v1p5beta1.ts | 19 +- 38 files changed, 1690 insertions(+), 71 deletions(-) create mode 100644 packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json create mode 100644 packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json create mode 100644 packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json create mode 100644 packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json create mode 100644 packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index 9af8e276ba2..38fcd423fb0 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.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-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index 74528a1eaf3..abb0aa3fdee 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.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-asset/samples/generated/v1/asset_service.analyze_move.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js index ce869443b95..5db1a709792 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.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-asset/samples/generated/v1/asset_service.batch_get_assets_history.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js index 9188cf99d62..3f098370933 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.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-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index e527f244a52..20c0bf80b72 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.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-asset/samples/generated/v1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js index 5e801047966..a812d1f86d0 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.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-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index 124cd269f04..97fc5e5f3ed 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.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-asset/samples/generated/v1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js index ebceb15c9b0..fa19d10604d 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.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-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index a9026022cbd..768cd0c6866 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.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-asset/samples/generated/v1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js index f9ac8720393..40f34be94c9 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.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-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index 1b845d1f725..b0cd4dcc6b6 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.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-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index c1f0367d00b..20fe964d82f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.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-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index 971c0a9073b..2b51e15f699 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.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-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json new file mode 100644 index 00000000000..9cfd2648147 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -0,0 +1,667 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_async", + "title": "AssetService exportAssets Sample", + "origin": "API_DEFINITION", + "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset proto as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", + "canonical": true, + "file": "asset_service.export_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 107, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.OutputConfig" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListAssets_async", + "title": "AssetService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists assets with time and resource types and returns paged results in response.", + "canonical": true, + "file": "asset_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1.AssetService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.ListAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1.AssetService.ListAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async", + "title": "AssetService batchGetAssetsHistory Sample", + "origin": "API_DEFINITION", + "description": " Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.", + "canonical": true, + "file": "asset_service.batch_get_assets_history.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetAssetsHistory", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "asset_names", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "read_time_window", + "type": ".google.cloud.asset.v1.TimeWindow" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.BatchGetAssetsHistoryResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "BatchGetAssetsHistory", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_CreateFeed_async", + "title": "AssetService createFeed Sample", + "origin": "API_DEFINITION", + "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", + "canonical": true, + "file": "asset_service.create_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "feed_id", + "type": "TYPE_STRING" + }, + { + "name": "feed", + "type": ".google.cloud.asset.v1.Feed" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_GetFeed_async", + "title": "AssetService getFeed Sample", + "origin": "API_DEFINITION", + "description": " Gets details about an asset feed.", + "canonical": true, + "file": "asset_service.get_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1.AssetService.GetFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1.AssetService.GetFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListFeeds_async", + "title": "AssetService listFeeds Sample", + "origin": "API_DEFINITION", + "description": " Lists all asset feeds in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_feeds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.ListFeedsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_UpdateFeed_async", + "title": "AssetService updateFeed Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset feed configuration.", + "canonical": true, + "file": "asset_service.update_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", + "async": true, + "parameters": [ + { + "name": "feed", + "type": ".google.cloud.asset.v1.Feed" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_DeleteFeed_async", + "title": "AssetService deleteFeed Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset feed.", + "canonical": true, + "file": "asset_service.delete_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_SearchAllResources_async", + "title": "AssetService searchAllResources Sample", + "origin": "API_DEFINITION", + "description": " Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 180, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.SearchAllResourcesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async", + "title": "AssetService searchAllIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 147, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SearchAllIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async", + "title": "AssetService analyzeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies to answer which identities have what accesses on which resources.", + "canonical": true, + "file": "asset_service.analyze_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" + }, + { + "name": "execution_timeout", + "type": ".google.protobuf.Duration" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeIamPolicyResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async", + "title": "AssetService analyzeIamPolicyLongrunning Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.", + "canonical": true, + "file": "asset_service.analyze_iam_policy_longrunning.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicyLongrunning", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicyLongrunning", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeMove_async", + "title": "AssetService analyzeMove Sample", + "origin": "API_DEFINITION", + "description": " Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.", + "canonical": true, + "file": "asset_service.analyze_move.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeMove", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "destination_parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeMoveResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeMove", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js index 41382c6cea2..efca9eea6a8 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.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-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js index 6e059aaf175..f61f89b07d9 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.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-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json new file mode 100644 index 00000000000..f1b632e5652 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -0,0 +1,127 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async", + "title": "AssetService searchAllResources Sample", + "origin": "API_DEFINITION", + "description": " Searches all the resources under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the resources under a scope, even if they don't have .get permission of all the resources. Callers should have cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be rejected.", + "canonical": true, + "file": "asset_service.search_all_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p1beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async", + "title": "AssetService searchAllIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the IAM policies under a scope, even if they don't have .getIamPolicy permission of all the IAM policies. Callers should have cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be rejected.", + "canonical": true, + "file": "asset_service.search_all_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p1beta1.AssetService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js index ac08a7406b5..3c5c9593d12 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.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-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js index 7f5b63b5d1d..afb214a4735 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.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-asset/samples/generated/v1p2beta1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js index 1d66a374f56..ceea2505f70 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.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-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js index cfa0817c6e4..b4fb74eef3f 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.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-asset/samples/generated/v1p2beta1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js index 2b2665b0f58..b52f8607c19 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.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-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json new file mode 100644 index 00000000000..d2c511b580b --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -0,0 +1,227 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p2beta1", + "version": "v1p2beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async", + "title": "AssetService createFeed Sample", + "origin": "API_DEFINITION", + "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", + "canonical": true, + "file": "asset_service.create_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "feed_id", + "type": "TYPE_STRING" + }, + { + "name": "feed", + "type": ".google.cloud.asset.v1p2beta1.Feed" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_GetFeed_async", + "title": "AssetService getFeed Sample", + "origin": "API_DEFINITION", + "description": " Gets details about an asset feed.", + "canonical": true, + "file": "asset_service.get_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async", + "title": "AssetService listFeeds Sample", + "origin": "API_DEFINITION", + "description": " Lists all asset feeds in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_feeds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.ListFeedsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async", + "title": "AssetService updateFeed Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset feed configuration.", + "canonical": true, + "file": "asset_service.update_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", + "async": true, + "parameters": [ + { + "name": "feed", + "type": ".google.cloud.asset.v1p2beta1.Feed" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async", + "title": "AssetService deleteFeed Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset feed.", + "canonical": true, + "file": "asset_service.delete_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js index ed513d717a4..0804e39187f 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js index 448aaaf618e..2f900b530de 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json new file mode 100644 index 00000000000..1793d3cb453 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -0,0 +1,107 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p4beta1", + "version": "v1p4beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async", + "title": "AssetService analyzeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies based on the specified request. Returns a list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request.", + "canonical": true, + "file": "asset_service.analyze_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery" + }, + { + "name": "options", + "type": ".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options" + } + ], + "resultType": ".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p4beta1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p4beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async", + "title": "AssetService exportIamPolicyAnalysis Sample", + "origin": "API_DEFINITION", + "description": " Exports IAM policy analysis based on the specified request. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests.", + "canonical": true, + "file": "asset_service.export_iam_policy_analysis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportIamPolicyAnalysis", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery" + }, + { + "name": "options", + "type": ".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p4beta1.AssetServiceClient" + }, + "method": { + "shortName": "ExportIamPolicyAnalysis", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p4beta1.AssetService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js index 2690cf42a71..f009cb69c68 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.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-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json new file mode 100644 index 00000000000..0f3a6b108d7 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p5beta1", + "version": "v1p5beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p5beta1_generated_AssetService_ListAssets_async", + "title": "AssetService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists assets with time and resource types and returns paged results in response.", + "canonical": true, + "file": "asset_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1p5beta1.ContentType" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p5beta1.ListAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p5beta1.AssetServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p5beta1.AssetService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 42e6f815929..1d1725ec543 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -3154,9 +3154,8 @@ export class AssetServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assetServiceStub!.then(stub => { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 2c48b86567d..b6c159dd5b0 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -817,9 +817,8 @@ export class AssetServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assetServiceStub!.then(stub => { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 0dd41509be8..202899c3822 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -885,9 +885,8 @@ export class AssetServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assetServiceStub!.then(stub => { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 818e203b832..6074a83eb71 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -573,9 +573,8 @@ export class AssetServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assetServiceStub!.then(stub => { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 34d540d0d2b..f262b6f9298 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -684,9 +684,8 @@ export class AssetServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assetServiceStub!.then(stub => { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 30d83ff8683..d33830697af 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -183,12 +183,27 @@ describe('v1.AssetServiceClient', () => { assert(client.assetServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -338,6 +353,25 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes batchGetAssetsHistory with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchGetAssetsHistory(request), + expectedError + ); + }); }); describe('createFeed', () => { @@ -449,6 +483,22 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFeed(request), expectedError); + }); }); describe('getFeed', () => { @@ -557,6 +607,22 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeed(request), expectedError); + }); }); describe('listFeeds', () => { @@ -665,6 +731,22 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes listFeeds with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFeeds(request), expectedError); + }); }); describe('updateFeed', () => { @@ -779,6 +861,23 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFeed(request), expectedError); + }); }); describe('deleteFeed', () => { @@ -890,6 +989,22 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFeed(request), expectedError); + }); }); describe('analyzeIamPolicy', () => { @@ -1004,6 +1119,23 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes analyzeIamPolicy with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); + }); }); describe('analyzeMove', () => { @@ -1115,6 +1247,22 @@ describe('v1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes analyzeMove with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeMove(request), expectedError); + }); }); describe('exportAssets', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index b5bec5f99bf..09f86e7f2f1 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -153,12 +153,27 @@ describe('v1p1beta1.AssetServiceClient', () => { assert(client.assetServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index 7908021622e..01dff776f25 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -90,12 +90,27 @@ describe('v1p2beta1.AssetServiceClient', () => { assert(client.assetServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -241,6 +256,22 @@ describe('v1p2beta1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFeed(request), expectedError); + }); }); describe('getFeed', () => { @@ -349,6 +380,22 @@ describe('v1p2beta1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeed(request), expectedError); + }); }); describe('listFeeds', () => { @@ -457,6 +504,22 @@ describe('v1p2beta1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes listFeeds with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFeeds(request), expectedError); + }); }); describe('updateFeed', () => { @@ -571,6 +634,23 @@ describe('v1p2beta1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed = {}; + request.feed.name = ''; + const expectedHeaderRequestParams = 'feed.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFeed(request), expectedError); + }); }); describe('deleteFeed', () => { @@ -682,6 +762,22 @@ describe('v1p2beta1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFeed(request), expectedError); + }); }); describe('Path templates', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index b618aa9556c..509d597b226 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts @@ -122,12 +122,27 @@ describe('v1p4beta1.AssetServiceClient', () => { assert(client.assetServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -276,6 +291,23 @@ describe('v1p4beta1.AssetServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes analyzeIamPolicy with closed client', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + const expectedHeaderRequestParams = 'analysis_query.parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); + }); }); describe('exportIamPolicyAnalysis', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 93e094962db..40c82a12fef 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -153,12 +153,27 @@ describe('v1p5beta1.AssetServiceClient', () => { assert(client.assetServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { From 492fc018ce26f8ee661a2c2f4d1d7967aed690fd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 10:25:14 -0700 Subject: [PATCH 389/429] chore: update v2.14.2 gapic-generator-typescript (#611) 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 --- .../google-cloud-asset/test/gapic_asset_service_v1.ts | 8 -------- .../test/gapic_asset_service_v1p2beta1.ts | 5 ----- .../test/gapic_asset_service_v1p4beta1.ts | 1 - 3 files changed, 14 deletions(-) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index d33830697af..9791b5636c2 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -364,7 +364,6 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -494,7 +493,6 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.CreateFeedRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFeed(request), expectedError); @@ -618,7 +616,6 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.GetFeedRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeed(request), expectedError); @@ -742,7 +739,6 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.ListFeedsRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.listFeeds(request), expectedError); @@ -873,7 +869,6 @@ describe('v1.AssetServiceClient', () => { ); request.feed = {}; request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFeed(request), expectedError); @@ -1000,7 +995,6 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.DeleteFeedRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteFeed(request), expectedError); @@ -1131,7 +1125,6 @@ describe('v1.AssetServiceClient', () => { ); request.analysisQuery = {}; request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.analyzeIamPolicy(request), expectedError); @@ -1258,7 +1251,6 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.analyzeMove(request), expectedError); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index 01dff776f25..3355554e530 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -267,7 +267,6 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFeed(request), expectedError); @@ -391,7 +390,6 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeed(request), expectedError); @@ -515,7 +513,6 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.listFeeds(request), expectedError); @@ -646,7 +643,6 @@ describe('v1p2beta1.AssetServiceClient', () => { ); request.feed = {}; request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFeed(request), expectedError); @@ -773,7 +769,6 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteFeed(request), expectedError); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts index 509d597b226..fe4a2861861 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p4beta1.ts @@ -303,7 +303,6 @@ describe('v1p4beta1.AssetServiceClient', () => { ); request.analysisQuery = {}; request.analysisQuery.parent = ''; - const expectedHeaderRequestParams = 'analysis_query.parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.analyzeIamPolicy(request), expectedError); From 1e7f52199cd8b352586e4fdb432a553619280612 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 18:18:11 +0000 Subject: [PATCH 390/429] build(node): update client library version in samples metadata (#1356) (#618) * 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 --- ...nippet_metadata.google.cloud.asset.v1.json | 1280 ++++++++--------- ...metadata.google.cloud.asset.v1p1beta1.json | 244 ++-- ...metadata.google.cloud.asset.v1p2beta1.json | 432 +++--- ...metadata.google.cloud.asset.v1p4beta1.json | 204 +-- ...metadata.google.cloud.asset.v1p5beta1.json | 144 +- 5 files changed, 1152 insertions(+), 1152 deletions(-) diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index 9cfd2648147..ad5e39dd0f4 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,667 +1,667 @@ { - "clientLibrary": { - "name": "nodejs-asset", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.asset.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_async", - "title": "AssetService exportAssets Sample", - "origin": "API_DEFINITION", - "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset proto as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", - "canonical": true, - "file": "asset_service.export_assets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 107, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportAssets", - "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "asset_types", - "type": "TYPE_STRING[]" - }, - { - "name": "content_type", - "type": ".google.cloud.asset.v1.ContentType" - }, - { - "name": "output_config", - "type": ".google.cloud.asset.v1.OutputConfig" - }, - { - "name": "relationship_types", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" - }, - "method": { - "shortName": "ExportAssets", - "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } + "clientLibrary": { + "name": "nodejs-asset", + "version": "3.23.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1", + "version": "v1" + } + ] }, - { - "regionTag": "cloudasset_v1_generated_AssetService_ListAssets_async", - "title": "AssetService listAssets Sample", - "origin": "API_DEFINITION", - "description": " Lists assets with time and resource types and returns paged results in response.", - "canonical": true, - "file": "asset_service.list_assets.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 114, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAssets", - "fullName": "google.cloud.asset.v1.AssetService.ListAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "asset_types", - "type": "TYPE_STRING[]" - }, - { - "name": "content_type", - "type": ".google.cloud.asset.v1.ContentType" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "relationship_types", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.cloud.asset.v1.ListAssetsResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_async", + "title": "AssetService exportAssets Sample", + "origin": "API_DEFINITION", + "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset proto as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", + "canonical": true, + "file": "asset_service.export_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 107, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.OutputConfig" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "ListAssets", - "fullName": "google.cloud.asset.v1.AssetService.ListAssets", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async", - "title": "AssetService batchGetAssetsHistory Sample", - "origin": "API_DEFINITION", - "description": " Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.", - "canonical": true, - "file": "asset_service.batch_get_assets_history.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 93, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchGetAssetsHistory", - "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "asset_names", - "type": "TYPE_STRING[]" - }, - { - "name": "content_type", - "type": ".google.cloud.asset.v1.ContentType" - }, - { - "name": "read_time_window", - "type": ".google.cloud.asset.v1.TimeWindow" - }, - { - "name": "relationship_types", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.cloud.asset.v1.BatchGetAssetsHistoryResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_ListAssets_async", + "title": "AssetService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists assets with time and resource types and returns paged results in response.", + "canonical": true, + "file": "asset_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1.AssetService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.ListAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1.AssetService.ListAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "BatchGetAssetsHistory", - "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_CreateFeed_async", - "title": "AssetService createFeed Sample", - "origin": "API_DEFINITION", - "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", - "canonical": true, - "file": "asset_service.create_feed.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFeed", - "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "feed_id", - "type": "TYPE_STRING" - }, - { - "name": "feed", - "type": ".google.cloud.asset.v1.Feed" - } - ], - "resultType": ".google.cloud.asset.v1.Feed", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async", + "title": "AssetService batchGetAssetsHistory Sample", + "origin": "API_DEFINITION", + "description": " Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.", + "canonical": true, + "file": "asset_service.batch_get_assets_history.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetAssetsHistory", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "asset_names", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "read_time_window", + "type": ".google.cloud.asset.v1.TimeWindow" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.BatchGetAssetsHistoryResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "BatchGetAssetsHistory", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "CreateFeed", - "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_GetFeed_async", - "title": "AssetService getFeed Sample", - "origin": "API_DEFINITION", - "description": " Gets details about an asset feed.", - "canonical": true, - "file": "asset_service.get_feed.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetFeed", - "fullName": "google.cloud.asset.v1.AssetService.GetFeed", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1.Feed", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_CreateFeed_async", + "title": "AssetService createFeed Sample", + "origin": "API_DEFINITION", + "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", + "canonical": true, + "file": "asset_service.create_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "feed_id", + "type": "TYPE_STRING" + }, + { + "name": "feed", + "type": ".google.cloud.asset.v1.Feed" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "GetFeed", - "fullName": "google.cloud.asset.v1.AssetService.GetFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_ListFeeds_async", - "title": "AssetService listFeeds Sample", - "origin": "API_DEFINITION", - "description": " Lists all asset feeds in a parent project/folder/organization.", - "canonical": true, - "file": "asset_service.list_feeds.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFeeds", - "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1.ListFeedsResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_GetFeed_async", + "title": "AssetService getFeed Sample", + "origin": "API_DEFINITION", + "description": " Gets details about an asset feed.", + "canonical": true, + "file": "asset_service.get_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1.AssetService.GetFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1.AssetService.GetFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "ListFeeds", - "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_UpdateFeed_async", - "title": "AssetService updateFeed Sample", - "origin": "API_DEFINITION", - "description": " Updates an asset feed configuration.", - "canonical": true, - "file": "asset_service.update_feed.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateFeed", - "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", - "async": true, - "parameters": [ - { - "name": "feed", - "type": ".google.cloud.asset.v1.Feed" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.asset.v1.Feed", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_ListFeeds_async", + "title": "AssetService listFeeds Sample", + "origin": "API_DEFINITION", + "description": " Lists all asset feeds in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_feeds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.ListFeedsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "UpdateFeed", - "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_DeleteFeed_async", - "title": "AssetService deleteFeed Sample", - "origin": "API_DEFINITION", - "description": " Deletes an asset feed.", - "canonical": true, - "file": "asset_service.delete_feed.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteFeed", - "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_UpdateFeed_async", + "title": "AssetService updateFeed Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset feed configuration.", + "canonical": true, + "file": "asset_service.update_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", + "async": true, + "parameters": [ + { + "name": "feed", + "type": ".google.cloud.asset.v1.Feed" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "DeleteFeed", - "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_SearchAllResources_async", - "title": "AssetService searchAllResources Sample", - "origin": "API_DEFINITION", - "description": " Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", - "canonical": true, - "file": "asset_service.search_all_resources.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 180, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchAllResources", - "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", - "async": true, - "parameters": [ - { - "name": "scope", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "asset_types", - "type": "TYPE_STRING[]" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.asset.v1.SearchAllResourcesResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_DeleteFeed_async", + "title": "AssetService deleteFeed Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset feed.", + "canonical": true, + "file": "asset_service.delete_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "SearchAllResources", - "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async", - "title": "AssetService searchAllIamPolicies Sample", - "origin": "API_DEFINITION", - "description": " Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the request will be rejected.", - "canonical": true, - "file": "asset_service.search_all_iam_policies.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 147, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchAllIamPolicies", - "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", - "async": true, - "parameters": [ - { - "name": "scope", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "asset_types", - "type": "TYPE_STRING[]" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1.SearchAllIamPoliciesResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_SearchAllResources_async", + "title": "AssetService searchAllResources Sample", + "origin": "API_DEFINITION", + "description": " Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 180, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.SearchAllResourcesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "SearchAllIamPolicies", - "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async", - "title": "AssetService analyzeIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Analyzes IAM policies to answer which identities have what accesses on which resources.", - "canonical": true, - "file": "asset_service.analyze_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AnalyzeIamPolicy", - "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", - "async": true, - "parameters": [ - { - "name": "analysis_query", - "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" - }, - { - "name": "execution_timeout", - "type": ".google.protobuf.Duration" - } - ], - "resultType": ".google.cloud.asset.v1.AnalyzeIamPolicyResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async", + "title": "AssetService searchAllIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 147, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SearchAllIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "AnalyzeIamPolicy", - "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async", - "title": "AssetService analyzeIamPolicyLongrunning Sample", - "origin": "API_DEFINITION", - "description": " Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.", - "canonical": true, - "file": "asset_service.analyze_iam_policy_longrunning.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AnalyzeIamPolicyLongrunning", - "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", - "async": true, - "parameters": [ - { - "name": "analysis_query", - "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" - }, - { - "name": "output_config", - "type": ".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async", + "title": "AssetService analyzeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies to answer which identities have what accesses on which resources.", + "canonical": true, + "file": "asset_service.analyze_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" + }, + { + "name": "execution_timeout", + "type": ".google.protobuf.Duration" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeIamPolicyResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "AnalyzeIamPolicyLongrunning", - "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeMove_async", - "title": "AssetService analyzeMove Sample", - "origin": "API_DEFINITION", - "description": " Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.", - "canonical": true, - "file": "asset_service.analyze_move.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AnalyzeMove", - "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "destination_parent", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView" - } - ], - "resultType": ".google.cloud.asset.v1.AnalyzeMoveResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1.AssetServiceClient" + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async", + "title": "AssetService analyzeIamPolicyLongrunning Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.", + "canonical": true, + "file": "asset_service.analyze_iam_policy_longrunning.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicyLongrunning", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicyLongrunning", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } }, - "method": { - "shortName": "AnalyzeMove", - "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1.AssetService" - } + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeMove_async", + "title": "AssetService analyzeMove Sample", + "origin": "API_DEFINITION", + "description": " Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.", + "canonical": true, + "file": "asset_service.analyze_move.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeMove", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "destination_parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeMoveResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeMove", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index f1b632e5652..9a31fa4f83a 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,127 +1,127 @@ { - "clientLibrary": { - "name": "nodejs-asset", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.asset.v1p1beta1", - "version": "v1p1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async", - "title": "AssetService searchAllResources Sample", - "origin": "API_DEFINITION", - "description": " Searches all the resources under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the resources under a scope, even if they don't have .get permission of all the resources. Callers should have cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be rejected.", - "canonical": true, - "file": "asset_service.search_all_resources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchAllResources", - "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", - "async": true, - "parameters": [ - { - "name": "scope", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "asset_types", - "type": "TYPE_STRING[]" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" - }, - "method": { - "shortName": "SearchAllResources", - "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p1beta1.AssetService" - } - } - } + "clientLibrary": { + "name": "nodejs-asset", + "version": "3.23.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p1beta1", + "version": "v1p1beta1" + } + ] }, - { - "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async", - "title": "AssetService searchAllIamPolicies Sample", - "origin": "API_DEFINITION", - "description": " Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the IAM policies under a scope, even if they don't have .getIamPolicy permission of all the IAM policies. Callers should have cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be rejected.", - "canonical": true, - "file": "asset_service.search_all_iam_policies.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchAllIamPolicies", - "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", - "async": true, - "parameters": [ - { - "name": "scope", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async", + "title": "AssetService searchAllResources Sample", + "origin": "API_DEFINITION", + "description": " Searches all the resources under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the resources under a scope, even if they don't have .get permission of all the resources. Callers should have cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be rejected.", + "canonical": true, + "file": "asset_service.search_all_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p1beta1.AssetService" + } + } + } }, - "method": { - "shortName": "SearchAllIamPolicies", - "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p1beta1.AssetService" - } + { + "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async", + "title": "AssetService searchAllIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the IAM policies under a scope, even if they don't have .getIamPolicy permission of all the IAM policies. Callers should have cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be rejected.", + "canonical": true, + "file": "asset_service.search_all_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p1beta1.AssetService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index d2c511b580b..3087192b5d3 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,227 +1,227 @@ { - "clientLibrary": { - "name": "nodejs-asset", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.asset.v1p2beta1", - "version": "v1p2beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async", - "title": "AssetService createFeed Sample", - "origin": "API_DEFINITION", - "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", - "canonical": true, - "file": "asset_service.create_feed.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "feed_id", - "type": "TYPE_STRING" - }, - { - "name": "feed", - "type": ".google.cloud.asset.v1p2beta1.Feed" - } - ], - "resultType": ".google.cloud.asset.v1p2beta1.Feed", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" - }, - "method": { - "shortName": "CreateFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p2beta1.AssetService" - } - } - } + "clientLibrary": { + "name": "nodejs-asset", + "version": "3.23.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p2beta1", + "version": "v1p2beta1" + } + ] }, - { - "regionTag": "cloudasset_v1p2beta1_generated_AssetService_GetFeed_async", - "title": "AssetService getFeed Sample", - "origin": "API_DEFINITION", - "description": " Gets details about an asset feed.", - "canonical": true, - "file": "asset_service.get_feed.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1p2beta1.Feed", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async", + "title": "AssetService createFeed Sample", + "origin": "API_DEFINITION", + "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", + "canonical": true, + "file": "asset_service.create_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "feed_id", + "type": "TYPE_STRING" + }, + { + "name": "feed", + "type": ".google.cloud.asset.v1p2beta1.Feed" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } }, - "method": { - "shortName": "GetFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p2beta1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async", - "title": "AssetService listFeeds Sample", - "origin": "API_DEFINITION", - "description": " Lists all asset feeds in a parent project/folder/organization.", - "canonical": true, - "file": "asset_service.list_feeds.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListFeeds", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1p2beta1.ListFeedsResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_GetFeed_async", + "title": "AssetService getFeed Sample", + "origin": "API_DEFINITION", + "description": " Gets details about an asset feed.", + "canonical": true, + "file": "asset_service.get_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } }, - "method": { - "shortName": "ListFeeds", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p2beta1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async", - "title": "AssetService updateFeed Sample", - "origin": "API_DEFINITION", - "description": " Updates an asset feed configuration.", - "canonical": true, - "file": "asset_service.update_feed.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", - "async": true, - "parameters": [ - { - "name": "feed", - "type": ".google.cloud.asset.v1p2beta1.Feed" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.asset.v1p2beta1.Feed", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async", + "title": "AssetService listFeeds Sample", + "origin": "API_DEFINITION", + "description": " Lists all asset feeds in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_feeds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.ListFeedsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } }, - "method": { - "shortName": "UpdateFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p2beta1.AssetService" - } - } - } - }, - { - "regionTag": "cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async", - "title": "AssetService deleteFeed Sample", - "origin": "API_DEFINITION", - "description": " Deletes an asset feed.", - "canonical": true, - "file": "asset_service.delete_feed.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async", + "title": "AssetService updateFeed Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset feed configuration.", + "canonical": true, + "file": "asset_service.update_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", + "async": true, + "parameters": [ + { + "name": "feed", + "type": ".google.cloud.asset.v1p2beta1.Feed" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } }, - "method": { - "shortName": "DeleteFeed", - "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p2beta1.AssetService" - } + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async", + "title": "AssetService deleteFeed Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset feed.", + "canonical": true, + "file": "asset_service.delete_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index 1793d3cb453..fd1133c5f2b 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,107 +1,107 @@ { - "clientLibrary": { - "name": "nodejs-asset", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.asset.v1p4beta1", - "version": "v1p4beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async", - "title": "AssetService analyzeIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Analyzes IAM policies based on the specified request. Returns a list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request.", - "canonical": true, - "file": "asset_service.analyze_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AnalyzeIamPolicy", - "fullName": "google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", - "async": true, - "parameters": [ - { - "name": "analysis_query", - "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery" - }, - { - "name": "options", - "type": ".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options" - } - ], - "resultType": ".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p4beta1.AssetServiceClient" - }, - "method": { - "shortName": "AnalyzeIamPolicy", - "fullName": "google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p4beta1.AssetService" - } - } - } + "clientLibrary": { + "name": "nodejs-asset", + "version": "3.23.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p4beta1", + "version": "v1p4beta1" + } + ] }, - { - "regionTag": "cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async", - "title": "AssetService exportIamPolicyAnalysis Sample", - "origin": "API_DEFINITION", - "description": " Exports IAM policy analysis based on the specified request. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests.", - "canonical": true, - "file": "asset_service.export_iam_policy_analysis.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportIamPolicyAnalysis", - "fullName": "google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", - "async": true, - "parameters": [ - { - "name": "analysis_query", - "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery" - }, - { - "name": "options", - "type": ".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options" - }, - { - "name": "output_config", - "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p4beta1.AssetServiceClient" + "regionTag": "cloudasset_v1p4beta1_generated_AssetService_AnalyzeIamPolicy_async", + "title": "AssetService analyzeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies based on the specified request. Returns a list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request.", + "canonical": true, + "file": "asset_service.analyze_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery" + }, + { + "name": "options", + "type": ".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options" + } + ], + "resultType": ".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p4beta1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p4beta1.AssetService" + } + } + } }, - "method": { - "shortName": "ExportIamPolicyAnalysis", - "fullName": "google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p4beta1.AssetService" - } + { + "regionTag": "cloudasset_v1p4beta1_generated_AssetService_ExportIamPolicyAnalysis_async", + "title": "AssetService exportIamPolicyAnalysis Sample", + "origin": "API_DEFINITION", + "description": " Exports IAM policy analysis based on the specified request. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests.", + "canonical": true, + "file": "asset_service.export_iam_policy_analysis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportIamPolicyAnalysis", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery" + }, + { + "name": "options", + "type": ".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p4beta1.AssetServiceClient" + }, + "method": { + "shortName": "ExportIamPolicyAnalysis", + "fullName": "google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p4beta1.AssetService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index 0f3a6b108d7..11317ea6ba4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,75 +1,75 @@ { - "clientLibrary": { - "name": "nodejs-asset", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.asset.v1p5beta1", - "version": "v1p5beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudasset_v1p5beta1_generated_AssetService_ListAssets_async", - "title": "AssetService listAssets Sample", - "origin": "API_DEFINITION", - "description": " Lists assets with time and resource types and returns paged results in response.", - "canonical": true, - "file": "asset_service.list_assets.js", - "language": "JAVASCRIPT", - "segments": [ + "clientLibrary": { + "name": "nodejs-asset", + "version": "3.23.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p5beta1", + "version": "v1p5beta1" + } + ] + }, + "snippets": [ { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAssets", - "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "read_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "asset_types", - "type": "TYPE_STRING[]" - }, - { - "name": "content_type", - "type": ".google.cloud.asset.v1p5beta1.ContentType" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.asset.v1p5beta1.ListAssetsResponse", - "client": { - "shortName": "AssetServiceClient", - "fullName": "google.cloud.asset.v1p5beta1.AssetServiceClient" - }, - "method": { - "shortName": "ListAssets", - "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", - "service": { - "shortName": "AssetService", - "fullName": "google.cloud.asset.v1p5beta1.AssetService" - } + "regionTag": "cloudasset_v1p5beta1_generated_AssetService_ListAssets_async", + "title": "AssetService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists assets with time and resource types and returns paged results in response.", + "canonical": true, + "file": "asset_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1p5beta1.ContentType" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p5beta1.ListAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p5beta1.AssetServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p5beta1.AssetService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 95bff98305d80529c0c2eb0fc1cebd73df690053 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:32:24 +0200 Subject: [PATCH 391/429] chore(deps): update dependency @types/mocha to v9 (#619) 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.0` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index be6a6761c2a..cda69db2d98 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -47,7 +47,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", From dd246c737b6d0328de80059264da8b229a4473ad Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:34:25 +0200 Subject: [PATCH 392/429] chore(deps): update dependency sinon to v14 (#622) 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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index cda69db2d98..b35b6669e51 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -60,7 +60,7 @@ "mocha": "^8.0.0", "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.8.3", "webpack": "^5.0.0", From 83dd994ca0190d2421eb63380461002f8b48f6fb Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 16 May 2022 17:38:09 -0700 Subject: [PATCH 393/429] build!: update library to use Node 12 (#625) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: Update library to use Node 12 * 🦉 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 --- packages/google-cloud-asset/package.json | 10 +++++----- packages/google-cloud-asset/samples/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index b35b6669e51..47278a1e35d 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "repository": "googleapis/nodejs-asset", "main": "build/src/index.js", @@ -44,7 +44,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", @@ -52,17 +52,17 @@ "@types/sinon": "^10.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", - "mocha": "^8.0.0", + "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.8.3", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" } diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index ca8c0be7d84..08d93ee343d 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From 0ac3b3d48cc93941a5232793d812349f1fc91726 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 17:00:34 -0700 Subject: [PATCH 394/429] feat: Add SavedQuery CURD support (#627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add SavedQuery CURD support feat: Add tags support feat!:*Add RelatedAsset and deprecate RelatedAssets for relationship GA *The previous representation of the relationship feature is deprecated and unimplemented. The RelatedAsset message represents the new stable format. PiperOrigin-RevId: 449306805 Source-Link: https://github.com/googleapis/googleapis/commit/3d7bd9d4a8772e0c7e1d39a2763e1914bfb5963d Source-Link: https://github.com/googleapis/googleapis-gen/commit/71a93d05d6076271d04b7592f7fad0d3f0c7a040 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzFhOTNkMDVkNjA3NjI3MWQwNGI3NTkyZjdmYWQwZDNmMGM3YTA0MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/asset/v1/asset_service.proto | 715 +- .../protos/google/cloud/asset/v1/assets.proto | 142 +- .../google-cloud-asset/protos/protos.d.ts | 6192 ++++++++++------- packages/google-cloud-asset/protos/protos.js | 5429 ++++++++++++--- .../google-cloud-asset/protos/protos.json | 519 +- .../v1/asset_service.analyze_iam_policy.js | 19 +- ..._service.analyze_iam_policy_longrunning.js | 19 +- ...ervice.batch_get_effective_iam_policies.js | 74 + .../generated/v1/asset_service.create_feed.js | 5 +- .../v1/asset_service.create_saved_query.js | 79 + .../v1/asset_service.delete_saved_query.js | 62 + .../v1/asset_service.export_assets.js | 3 +- .../v1/asset_service.get_saved_query.js | 61 + .../generated/v1/asset_service.list_assets.js | 9 +- .../v1/asset_service.list_saved_queries.js | 85 + .../asset_service.search_all_iam_policies.js | 40 +- .../v1/asset_service.search_all_resources.js | 43 +- .../generated/v1/asset_service.update_feed.js | 4 +- .../v1/asset_service.update_saved_query.js | 68 + ...nippet_metadata.google.cloud.asset.v1.json | 292 +- .../src/v1/asset_service_client.ts | 1284 +++- .../src/v1/asset_service_client_config.json | 24 + .../src/v1/gapic_metadata.json | 64 + .../test/gapic_asset_service_v1.ts | 2074 ++++-- 24 files changed, 12843 insertions(+), 4463 deletions(-) create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 80a3da247fe..cf581222616 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.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. @@ -21,11 +21,11 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/asset/v1/assets.proto"; +import "google/iam/v1/policy.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/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/type/expr.proto"; @@ -40,18 +40,20 @@ option php_namespace = "Google\\Cloud\\Asset\\V1"; // Asset service definition. service AssetService { option (google.api.default_host) = "cloudasset.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"; // Exports assets with time and resource types to a given Cloud Storage // location/BigQuery table. For Cloud Storage location destinations, the // output format is newline-delimited JSON. Each line represents a - // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table - // destinations, the output table stores the fields in asset proto as columns. - // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API - // , which allows you to keep track of the export. We recommend intervals of - // at least 2 seconds with exponential retry to poll the export operation - // result. For regular-size resource parent, the export operation usually - // finishes within 5 minutes. + // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON + // format; for BigQuery table destinations, the output table stores the fields + // in asset Protobuf as columns. This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API, which + // allows you to keep track of the export. We recommend intervals of at least + // 2 seconds with exponential retry to poll the export operation result. For + // regular-size resource parent, the export operation usually finishes within + // 5 minutes. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}:exportAssets" @@ -79,7 +81,8 @@ service AssetService { // deleted status. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT // error. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) + returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}:batchGetAssetsHistory" }; @@ -132,7 +135,8 @@ service AssetService { // folder, or organization. The caller must be granted the // `cloudasset.assets.searchAllResources` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) { + rpc SearchAllResources(SearchAllResourcesRequest) + returns (SearchAllResourcesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllResources" }; @@ -143,7 +147,8 @@ service AssetService { // folder, or organization. The caller must be granted the // `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) { + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) + returns (SearchAllIamPoliciesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllIamPolicies" }; @@ -152,7 +157,8 @@ service AssetService { // Analyzes IAM policies to answer which identities have what accesses on // which resources. - rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) { + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) + returns (AnalyzeIamPolicyResponse) { option (google.api.http) = { get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" }; @@ -162,12 +168,14 @@ service AssetService { // accesses on which resources, and writes the analysis results to a Google // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the // output format is the JSON format that represents a - // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the - // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation - // status. We recommend intervals of at least 2 seconds with exponential - // backoff retry to poll the operation result. The metadata contains the - // metadata for the long-running operation. - rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) returns (google.longrunning.Operation) { + // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. + // This method implements the + // [google.longrunning.Operation][google.longrunning.Operation], which allows + // you to track the operation status. We recommend intervals of at least 2 + // seconds with exponential backoff retry to poll the operation result. The + // metadata contains the metadata for the long-running operation. + rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning" body: "*" @@ -188,13 +196,66 @@ service AssetService { get: "/v1/{resource=*/*}:analyzeMove" }; } + + // Creates a saved query in a parent project/folder/organization. + rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + post: "/v1/{parent=*/*}/savedQueries" + body: "saved_query" + }; + option (google.api.method_signature) = "parent,saved_query,saved_query_id"; + } + + // Gets details about a saved query. + rpc GetSavedQuery(GetSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + get: "/v1/{name=*/*/savedQueries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all saved queries in a parent project/folder/organization. + rpc ListSavedQueries(ListSavedQueriesRequest) + returns (ListSavedQueriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/savedQueries" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a saved query. + rpc UpdateSavedQuery(UpdateSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + patch: "/v1/{saved_query.name=*/*/savedQueries/*}" + body: "saved_query" + }; + option (google.api.method_signature) = "saved_query,update_mask"; + } + + // Deletes a saved query. + rpc DeleteSavedQuery(DeleteSavedQueryRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=*/*/savedQueries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets effective IAM policies for a batch of resources. + rpc BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest) + returns (BatchGetEffectiveIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + }; + } } // Represents the metadata of the longrunning operation for the // AnalyzeIamPolicyLongrunning rpc. message AnalyzeIamPolicyLongrunningMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Export asset request. @@ -241,7 +302,8 @@ message ExportAssetsRequest { // returned. ContentType content_type = 4; - // Required. Output configuration indicating where the results will be output to. + // Required. Output configuration indicating where the results will be output + // to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; // A list of relationship types to export, for example: @@ -263,8 +325,10 @@ message ExportAssetsRequest { } // The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. message ExportAssetsResponse { // Time the snapshot was taken. google.protobuf.Timestamp read_time = 1; @@ -282,10 +346,11 @@ message ExportAssetsResponse { // ListAssets request. message ListAssetsRequest { - // Required. Name of the organization or project the assets belong to. Format: - // "organizations/[organization-number]" (such as "organizations/123"), - // "projects/[project-id]" (such as "projects/my-project-id"), or - // "projects/[project-number]" (such as "projects/12345"). + // Required. Name of the organization, folder, or project the assets belong + // to. Format: "organizations/[organization-number]" (such as + // "organizations/123"), "projects/[project-id]" (such as + // "projects/my-project-id"), "projects/[project-number]" (such as + // "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -414,7 +479,8 @@ message BatchGetAssetsHistoryRequest { // See [Introduction to Cloud Asset // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all // supported asset types and relationship types. - repeated string relationship_types = 5 [(google.api.field_behavior) = OPTIONAL]; + repeated string relationship_types = 5 + [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -436,9 +502,8 @@ message CreateFeedRequest { // be unique under a specific parent project/folder/organization. string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The feed details. The field `name` must be empty and it will be generated - // in the format of: - // projects/project_number/feeds/feed_id + // Required. The feed details. The field `name` must be empty and it will be + // generated in the format of: projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; @@ -452,9 +517,7 @@ message GetFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Feed" - } + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } ]; } @@ -473,8 +536,8 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // Required. The new values of feed details. It must match an existing feed and the - // field `name` must be in the format of: + // Required. The new values of feed details. It must match an existing feed + // and the field `name` must be in the format of: // projects/project_number/feeds/feed_id or // folders/folder_number/feeds/feed_id or // organizations/organization_number/feeds/feed_id. @@ -483,7 +546,8 @@ message UpdateFeedRequest { // Required. Only updates the `feed` fields indicated by this mask. // The field mask must not be empty, and it must not contain fields that // are immutable or only set by the server. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } message DeleteFeedRequest { @@ -493,9 +557,7 @@ message DeleteFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Feed" - } + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } ]; } @@ -507,7 +569,7 @@ message OutputConfig { GcsDestination gcs_destination = 1; // Destination on BigQuery. The output table stores the fields in asset - // proto as columns in BigQuery. + // Protobuf as columns in BigQuery. BigQueryDestination bigquery_destination = 2; } } @@ -561,7 +623,11 @@ message BigQueryDestination { // Required. The BigQuery dataset in format // "projects/projectId/datasets/datasetId", to which the snapshot result // should be exported. If this dataset does not exist, the export call returns - // an INVALID_ARGUMENT error. + // an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + // determines the + // [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + // of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + // influences the schema. string dataset = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The BigQuery table to which the snapshot result should be @@ -697,9 +763,8 @@ message Feed { // specified asset_names or asset_types are exported to the feed. // Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource - // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // for more info. + // For a list of the full names for supported asset types, see [Resource + // name format](/asset-inventory/docs/resource-name-format). repeated string asset_names = 2; // A list of types of the assets to receive updates. You must specify either @@ -707,9 +772,8 @@ message Feed { // specified asset_names or asset_types are exported to the feed. // Example: `"compute.googleapis.com/Disk"` // - // See [this - // topic](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - // for a list of all supported asset types. + // For a list of all supported asset types, see + // [Supported asset types](/asset-inventory/docs/supported-asset-types). repeated string asset_types = 3; // Asset content type. If not specified, no content but the asset name and @@ -718,7 +782,8 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; + FeedOutputConfig feed_output_config = 5 + [(google.api.field_behavior) = REQUIRED]; // A condition which determines whether an asset update should be published. // If specified, an asset will be returned only when the expression evaluates @@ -755,8 +820,9 @@ message Feed { // Search all resources request. message SearchAllResourcesRequest { - // Required. A scope can be a project, a folder, or an organization. The search is - // limited to the resources within the `scope`. The caller must be granted the + // Required. A scope can be a project, a folder, or an organization. The + // search is limited to the resources within the `scope`. The caller must be + // granted the // [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // @@ -810,8 +876,8 @@ message SearchAllResourcesRequest { // location. string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of asset types that this request searches for. If empty, it will - // search all the [searchable asset + // Optional. A list of asset types that this request searches for. If empty, + // it will search all the [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). // // Regular expressions are also supported. For example: @@ -826,21 +892,22 @@ message SearchAllResourcesRequest { // supported asset type, an INVALID_ARGUMENT error will be returned. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped at 500 even - // if a larger value is given. If set to zero, server will pick an appropriate - // default. Returned results may be fewer than requested. When this happens, - // there could be more results as long as `next_page_token` is returned. + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero, server will pick an + // appropriate default. Returned results may be fewer than requested. When + // this happens, there could be more results as long as `next_page_token` is + // returned. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If present, then retrieve the next batch of results from the preceding call - // to this method. `page_token` must be the value of `next_page_token` from - // the previous response. The values of all other method parameters, must be - // identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of all other + // method parameters, must be identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying the sorting order of the - // results. The default order is ascending. Add " DESC" after the field name - // to indicate descending order. Redundant space characters are ignored. + // Optional. A comma-separated list of fields specifying the sorting order of + // the results. The default order is ascending. Add " DESC" after the field + // name to indicate descending order. Redundant space characters are ignored. // Example: "location DESC, name". // Only singular primitive fields in the response are sortable: // @@ -862,10 +929,10 @@ message SearchAllResourcesRequest { // are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying which fields to be returned in - // ResourceSearchResult. Only '*' or combination of top level fields can be - // specified. Field names of both snake_case and camelCase are supported. - // Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + // Optional. A comma-separated list of fields specifying which fields to be + // returned in ResourceSearchResult. Only '*' or combination of top level + // fields can be specified. Field names of both snake_case and camelCase are + // supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. // // The read_mask paths must be valid field paths listed but not limited to // (both snake_case and camelCase are supported): @@ -876,6 +943,9 @@ message SearchAllResourcesRequest { // * displayName // * description // * location + // * tagKeys + // * tagValues + // * tagValueIds // * labels // * networkTags // * kmsKey @@ -890,7 +960,8 @@ message SearchAllResourcesRequest { // If only '*' is specified, all fields including versionedResources will be // returned. // Any invalid field path will trigger INVALID_ARGUMENT error. - google.protobuf.FieldMask read_mask = 8 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask read_mask = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Search all resources response. @@ -907,9 +978,9 @@ message SearchAllResourcesResponse { // Search all IAM policies request. message SearchAllIamPoliciesRequest { - // Required. A scope can be a project, a folder, or an organization. The search is - // limited to the IAM policies within the `scope`. The caller must be granted - // the + // Required. A scope can be a project, a folder, or an organization. The + // search is limited to the IAM policies within the `scope`. The caller must + // be granted the // [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // @@ -925,7 +996,7 @@ message SearchAllIamPoliciesRequest { // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) // for more information. If not specified or empty, it will search all the // IAM policies within the specified `scope`. Note that the query string is - // compared against each Cloud IAM policy binding, including its members, + // compared against each Cloud IAM policy binding, including its principals, // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only // contain the bindings that match your query. To learn more about the IAM // policy structure, see [IAM policy @@ -961,24 +1032,26 @@ message SearchAllIamPoliciesRequest { // "instance2" and also specify user "amy". // * `roles:roles/compute.admin` to find IAM policy bindings that specify the // Compute Admin role. - // * `memberTypes:user` to find IAM policy bindings that contain the "user" - // member type. + // * `memberTypes:user` to find IAM policy bindings that contain the + // principal type "user". string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped at 500 even - // if a larger value is given. If set to zero, server will pick an appropriate - // default. Returned results may be fewer than requested. When this happens, - // there could be more results as long as `next_page_token` is returned. + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero, server will pick an + // appropriate default. Returned results may be fewer than requested. When + // this happens, there could be more results as long as `next_page_token` is + // returned. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If present, retrieve the next batch of results from the preceding call to - // this method. `page_token` must be the value of `next_page_token` from the - // previous response. The values of all other method parameters must be - // identical to those in the previous call. + // Optional. If present, retrieve the next batch of results from the preceding + // call to this method. `page_token` must be the value of `next_page_token` + // from the previous response. The values of all other method parameters must + // be identical to those in the previous call. string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of asset types that the IAM policies are attached to. If empty, it - // will search the IAM policies that are attached to all the [searchable asset + // Optional. A list of asset types that the IAM policies are attached to. If + // empty, it will search the IAM policies that are attached to all the + // [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). // // Regular expressions are also supported. For example: @@ -995,9 +1068,9 @@ message SearchAllIamPoliciesRequest { // supported asset type, an INVALID_ARGUMENT error will be returned. repeated string asset_types = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying the sorting order of the - // results. The default order is ascending. Add " DESC" after the field name - // to indicate descending order. Redundant space characters are ignored. + // Optional. A comma-separated list of fields specifying the sorting order of + // the results. The default order is ascending. Add " DESC" after the field + // name to indicate descending order. Redundant space characters are ignored. // Example: "assetType DESC, resource". // Only singular primitive fields in the response are sortable: // * resource @@ -1020,7 +1093,7 @@ message SearchAllIamPoliciesResponse { string next_page_token = 2; } -// ## IAM policy analysis query message. +// IAM policy analysis query message. message IamPolicyAnalysisQuery { // Specifies the resource to analyze for access policies, which may be set // directly on the resource, or on ancestors such as organizations, folders or @@ -1037,7 +1110,7 @@ message IamPolicyAnalysisQuery { // roles assigned either directly to them or to the groups they belong to, // directly or indirectly. message IdentitySelector { - // Required. The identity appear in the form of members in + // Required. The identity appear in the form of principals in // [IAM policy // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). // @@ -1070,9 +1143,13 @@ message IamPolicyAnalysisQuery { // Optional. If true, the identities section of the result will expand any // Google groups appearing in an IAM policy binding. // - // If [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] is specified, the - // identity in the result will be determined by the selector, and this flag - // is not allowed to set. + // If + // [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + // is specified, the identity in the result will be determined by the + // selector, and this flag is not allowed to set. + // + // If true, the default max expansion per group is 1000 for + // AssetService.AnalyzeIamPolicy][]. // // Default is false. bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -1080,51 +1157,58 @@ message IamPolicyAnalysisQuery { // Optional. If true, the access section of result will expand any roles // appearing in IAM policy bindings to include their permissions. // - // If [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] is specified, the access - // section of the result will be determined by the selector, and this flag - // is not allowed to set. + // If + // [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + // is specified, the access section of the result will be determined by the + // selector, and this flag is not allowed to set. // // Default is false. bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is not - // specified, the resource section of the result will expand any resource - // attached to an IAM policy to include resources lower in the resource - // hierarchy. + // Optional. If true and + // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is not specified, the resource section of the result will expand any + // resource attached to an IAM policy to include resources lower in the + // resource hierarchy. // // For example, if the request analyzes for which resources user A has // permission P, and the results include an IAM policy with P on a GCP // folder, the results will also include resources in that folder with // permission P. // - // If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is specified, - // the resource section of the result will expand the specified resource to - // include resources lower in the resource hierarchy. Only project or - // lower resources are supported. Folder and organization resource cannot be - // used together with this option. + // If true and + // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is specified, the resource section of the result will expand the + // specified resource to include resources lower in the resource hierarchy. + // Only project or lower resources are supported. Folder and organization + // resource cannot be used together with this option. // // For example, if the request analyzes for which users have permission P on // a GCP project with this option enabled, the results will include all // users who have permission P on that project or any lower resource. // + // If true, the default max expansion per resource is 1000 for + // AssetService.AnalyzeIamPolicy][] and 100000 for + // AssetService.AnalyzeIamPolicyLongrunning][]. + // // Default is false. bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the result will output resource edges, starting - // from the policy attached resource, to any expanded resources. - // Default is false. + // Optional. If true, the result will output the relevant parent/child + // relationships between resources. Default is false. bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the result will output group identity edges, starting - // from the binding's group members, to any expanded identities. - // Default is false. + // Optional. If true, the result will output the relevant membership + // relationships between groups and other groups, and between groups and + // principals. Default is false. bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the response will include access analysis from identities to - // resources via service account impersonation. This is a very expensive - // operation, because many derived queries will be executed. We highly - // recommend you use [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc - // instead. + // Optional. If true, the response will include access analysis from + // identities to resources via service account impersonation. This is a very + // expensive operation, because many derived queries will be executed. We + // highly recommend you use + // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + // rpc instead. // // For example, if the request analyzes for which resources user A has // permission P, and there's an IAM policy states user A has @@ -1142,8 +1226,18 @@ message IamPolicyAnalysisQuery { // F. And those advanced analysis results will be included in // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. // + // Only the following permissions are considered in this analysis: + // + // * `iam.serviceAccounts.actAs` + // * `iam.serviceAccounts.signBlob` + // * `iam.serviceAccounts.signJwt` + // * `iam.serviceAccounts.getAccessToken` + // * `iam.serviceAccounts.getOpenIdToken` + // * `iam.serviceAccounts.implicitDelegation` + // // Default is false. - bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + bool analyze_service_account_impersonation = 6 + [(google.api.field_behavior) = OPTIONAL]; } // The IAM conditions context. @@ -1157,8 +1251,8 @@ message IamPolicyAnalysisQuery { } } - // Required. The relative name of the root asset. Only resources and IAM policies within - // the scope will be analyzed. + // Required. The relative name of the root asset. Only resources and IAM + // policies within the scope will be analyzed. // // This can only be an organization number (such as "organizations/123"), a // folder number (such as "folders/123"), a project ID (such as @@ -1172,10 +1266,12 @@ message IamPolicyAnalysisQuery { string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Specifies a resource for analysis. - ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL]; + ResourceSelector resource_selector = 2 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Specifies an identity for analysis. - IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL]; + IdentitySelector identity_selector = 3 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Specifies roles or permissions for analysis. This is optional. AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -1184,15 +1280,37 @@ message IamPolicyAnalysisQuery { Options options = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. The hypothetical context for IAM conditions evaluation. - ConditionContext condition_context = 6 [(google.api.field_behavior) = OPTIONAL]; + ConditionContext condition_context = 6 + [(google.api.field_behavior) = OPTIONAL]; } -// A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +// A request message for +// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. message AnalyzeIamPolicyRequest { // Required. The request query. - IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of a saved query, which must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + // + // If both `analysis_query` and `saved_analysis_query` are provided, they + // will be merged together with the `saved_analysis_query` as base and + // the `analysis_query` as overrides. For more details of the merge behavior, + // please refer to the + // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + // page. + // + // Note that you cannot override primitive fields with default value, such as + // 0 or empty string, etc., because we use proto3, which doesn't support field + // presence yet. + string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Amount of time executable has to complete. See JSON representation of + // Optional. Amount of time executable has to complete. See JSON + // representation of // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). // // If this field is set with a value less than the RPC deadline, and the @@ -1202,22 +1320,26 @@ message AnalyzeIamPolicyRequest { // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. // // Default is empty. - google.protobuf.Duration execution_timeout = 2 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Duration execution_timeout = 2 + [(google.api.field_behavior) = OPTIONAL]; } -// A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +// A response message for +// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. message AnalyzeIamPolicyResponse { // An analysis message to group the query and results. message IamPolicyAnalysis { // The analysis query. IamPolicyAnalysisQuery analysis_query = 1; - // A list of [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] that matches the analysis query, or - // empty if no result is found. + // A list of + // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + // that matches the analysis query, or empty if no result is found. repeated IamPolicyAnalysisResult analysis_results = 2; - // Represents whether all entries in the [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been - // fully explored to answer the query. + // Represents whether all entries in the + // [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + // have been fully explored to answer the query. bool fully_explored = 3; // A list of non-critical errors happened during the query handling. @@ -1232,9 +1354,11 @@ message AnalyzeIamPolicyResponse { // enabled. repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; - // Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and - // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to - // answer the query in the request. + // Represents whether all entries in the + // [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] + // and + // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + // have been fully explored to answer the query in the request. bool fully_explored = 3; } @@ -1242,8 +1366,8 @@ message AnalyzeIamPolicyResponse { message IamPolicyAnalysisOutputConfig { // A Cloud Storage location. message GcsDestination { - // Required. The uri of the Cloud Storage object. It's the same uri that is used by - // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Required. The uri of the Cloud Storage object. It's the same uri that is + // used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and // Editing Object // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. @@ -1271,13 +1395,15 @@ message IamPolicyAnalysisOutputConfig { REQUEST_TIME = 1; } - // Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", - // to which the analysis results should be exported. If this dataset does - // not exist, the export call will return an INVALID_ARGUMENT error. + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the analysis results + // should be exported. If this dataset does not exist, the export call will + // return an INVALID_ARGUMENT error. string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The prefix of the BigQuery tables to which the analysis results will be - // written. Tables will be created based on this table_prefix if not exist: + // Required. The prefix of the BigQuery tables to which the analysis results + // will be written. Tables will be created based on this table_prefix if not + // exist: // * _analysis table will contain export operation's metadata. // * _analysis_result will contain all the // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. @@ -1288,8 +1414,8 @@ message IamPolicyAnalysisOutputConfig { // The partition key for BigQuery partitioned table. PartitionKey partition_key = 3; - // Optional. Specifies the action that occurs if the destination table or partition - // already exists. The following values are supported: + // Optional. Specifies the action that occurs if the destination table or + // partition already exists. The following values are supported: // // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery // overwrites the entire table or all the partitions data. @@ -1314,18 +1440,219 @@ message IamPolicyAnalysisOutputConfig { } } -// A request message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +// A request message for +// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. message AnalyzeIamPolicyLongrunningRequest { // Required. The request query. - IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of a saved query, which must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + // + // If both `analysis_query` and `saved_analysis_query` are provided, they + // will be merged together with the `saved_analysis_query` as base and + // the `analysis_query` as overrides. For more details of the merge behavior, + // please refer to the + // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + // doc. + // + // Note that you cannot override primitive fields with default value, such as + // 0 or empty string, etc., because we use proto3, which doesn't support field + // presence yet. + string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Output configuration indicating where the results will be output + // to. + IamPolicyAnalysisOutputConfig output_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A response message for +// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningResponse {} + +// A saved query which can be shared with others or used later. +message SavedQuery { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/SavedQuery" + pattern: "projects/{project}/savedQueries/{saved_query}" + pattern: "folders/{folder}/savedQueries/{saved_query}" + pattern: "organizations/{organization}/savedQueries/{saved_query}" + }; + + // The query content. + message QueryContent { + oneof query_content { + // An IAM Policy Analysis query, which could be used in + // the + // [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] + // rpc or the + // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + // rpc. + IamPolicyAnalysisQuery iam_policy_analysis_query = 1; + } + } + + // The resource name of the saved query. The format must be: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1; + + // The description of this saved query. This value should be fewer than 255 + // characters. + string description = 2; + + // Output only. The create time of this saved query. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account's email address who has created this saved query. + string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update time of this saved query. + google.protobuf.Timestamp last_update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account's email address who has updated this saved query + // most recently. + string last_updater = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels applied on the resource. + // This value should not contain more than 10 entries. The key and value of + // each entry must be non-empty and fewer than 64 characters. + map labels = 7; + + // The query content. + QueryContent content = 8; +} + +// Request to create a saved query. +message CreateSavedQueryRequest { + // Required. The name of the project/folder/organization where this + // saved_query should be created in. It can only be an organization number + // (such as "organizations/123"), a folder number (such as "folders/123"), a + // project ID (such as "projects/my-project-id")", or a project number (such + // as "projects/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/SavedQuery" + } + ]; + + // Required. The saved_query details. The `name` field must be empty as it + // will be generated based on the parent and saved_query_id. + SavedQuery saved_query = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Output configuration indicating where the results will be output to. - IamPolicyAnalysisOutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; + // Required. The ID to use for the saved query, which must be unique in the + // specified parent. It will become the final component of the saved query's + // resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Notice that this field is required in the saved query creation, and the + // `name` field of the `saved_query` will be ignored. + string saved_query_id = 3 [(google.api.field_behavior) = REQUIRED]; } -// A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. -message AnalyzeIamPolicyLongrunningResponse { +// Request to get a saved query. +message GetSavedQueryRequest { + // Required. The name of the saved query and it must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/SavedQuery" + } + ]; +} +// Request to list saved queries. +message ListSavedQueriesRequest { + // Required. The parent project/folder/organization whose savedQueries are to + // be listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/SavedQuery" + } + ]; + + // Optional. The expression to filter resources. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. When `AND` and `OR` are both used in the + // expression, parentheses must be appropriately used to group the + // combinations. The expression may also contain regular expressions. + // + // See https://google.aip.dev/160 for more information on the grammar. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of saved queries to return per page. The + // service may return fewer than this value. If unspecified, at most 50 will + // be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSavedQueries` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSavedQueries` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of listing saved queries. +message ListSavedQueriesResponse { + // A list of savedQueries. + repeated SavedQuery saved_queries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to update a saved query. +message UpdateSavedQueryRequest { + // Required. The saved query to update. + // + // The saved query's `name` field is used to identify the one to update, + // which has format as below: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + SavedQuery saved_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a saved query. +message DeleteSavedQueryRequest { + // Required. The name of the saved query to delete. It must be in the format + // of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/SavedQuery" + } + ]; } // The request message for performing resource move analysis. @@ -1426,3 +1753,91 @@ enum ContentType { // The related resources. RELATIONSHIP = 7; } + +// A request message for +// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +message BatchGetEffectiveIamPoliciesRequest { + // Required. Only IAM policies on or below the scope will be returned. + // + // This can only be an organization number (such as "organizations/123"), a + // folder number (such as "folders/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + // + // To know how to get organization id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // To know how to get folder or project id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + string scope = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "*" } + ]; + + // Required. The names refer to the [full_resource_names] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of [searchable asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + // A maximum of 20 resources' effective policies can be retrieved in a batch. + repeated string names = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; +} + +// A response message for +// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +message BatchGetEffectiveIamPoliciesResponse { + // The effective IAM policies on one resource. + message EffectiveIamPolicy { + // The IAM policy and its attached resource. + message PolicyInfo { + // The full resource name the + // [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + // is directly attached to. + string attached_resource = 1; + + // The IAM policy that's directly attached to the + // [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + google.iam.v1.Policy policy = 2; + } + + // The [full_resource_name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for which the + // [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + // are computed. This is one of the + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + // the caller provides in the request. + string full_resource_name = 1; + + // The effective policies for the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // + // These policies include the policy set on the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // and those set on its parents and ancestors up to the + // [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + // Note that these policies are not filtered according to the resource type + // of the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // + // These policies are hierarchically ordered by + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + // starting from + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // itself to its parents and ancestors, such that policies[i]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + // is the child of policies[i+1]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + // if policies[i+1] exists. + repeated PolicyInfo policies = 2; + } + + // The effective policies for a batch of resources. Note that the results + // order is the same as the order of + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + // When a resource does not have any effective IAM policies, its corresponding + // policy_result will contain empty + // [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + repeated EffectiveIamPolicy policy_results = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 3d433b8f3fe..ebc093ca388 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.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,18 +16,17 @@ syntax = "proto3"; package google.cloud.asset.v1; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; -import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; -import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -152,7 +151,8 @@ message Asset { // Please also refer to the [service perimeter user // guide](https://cloud.google.com/vpc-service-controls/docs/overview). - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; } // A representation of runtime OS Inventory information. See [this @@ -160,9 +160,15 @@ message Asset { // for more information. google.cloud.osconfig.v1.Inventory os_inventory = 12; - // The related assets of the asset of one relationship type. - // One asset only represents one type of relationship. - RelatedAssets related_assets = 13; + // DEPRECATED. This field only presents for the purpose of + // backward-compatibility. The server will never generate responses with this + // field. + // The related assets of the asset of one relationship type. One asset + // only represents one type of relationship. + RelatedAssets related_assets = 13 [deprecated = true]; + + // One related asset of the current asset. + RelatedAsset related_asset = 15; // The ancestry path of an asset in Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), @@ -225,8 +231,13 @@ message Resource { string location = 8; } +// DEPRECATED. This message only presents for the purpose of +// backward-compatibility. The server will never populate this message in +// responses. // The detailed related assets with the `relationship_type`. message RelatedAssets { + option deprecated = true; + // The detailed relationship attributes. RelationshipAttributes relationship_attributes = 1; @@ -234,9 +245,14 @@ message RelatedAssets { repeated RelatedAsset assets = 2; } +// DEPRECATED. This message only presents for the purpose of +// backward-compatibility. The server will never populate this message in +// responses. // The relationship attributes which include `type`, `source_resource_type`, // `target_resource_type` and `action`. message RelationshipAttributes { + option deprecated = true; + // The unique identifier of the relationship type. Example: // `INSTANCE_TO_INSTANCEGROUP` string type = 4; @@ -251,7 +267,7 @@ message RelationshipAttributes { string action = 3; } -// An asset identify in Google Cloud which contains its name, type and +// An asset identifier in Google Cloud which contains its name, type and // ancestors. An asset can be any resource in the Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as Google @@ -267,8 +283,8 @@ message RelatedAsset { // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. string asset = 1 [(google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Asset" - }]; + type: "cloudasset.googleapis.com/Asset" + }]; // The type of the asset. Example: `compute.googleapis.com/Disk` // @@ -284,6 +300,10 @@ message RelatedAsset { // // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` repeated string ancestors = 3; + + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string relationship_type = 4; } // A result of Resource Search, containing information of a cloud resource. @@ -341,7 +361,7 @@ message ResourceSearchResult { string organization = 18; // The display name of this resource. This field is available only when the - // resource's proto contains it. + // resource's Protobuf contains it. // // To search against the `display_name`: // @@ -351,7 +371,7 @@ message ResourceSearchResult { // One or more paragraphs of text description of this resource. Maximum length // could be up to 1M bytes. This field is available only when the resource's - // proto contains it. + // Protobuf contains it. // // To search against the `description`: // @@ -360,7 +380,7 @@ message ResourceSearchResult { string description = 5; // Location can be `global`, regional like `us-east1`, or zonal like - // `us-west1-b`. This field is available only when the resource's proto + // `us-west1-b`. This field is available only when the resource's Protobuf // contains it. // // To search against the `location`: @@ -372,7 +392,7 @@ message ResourceSearchResult { // Labels associated with this resource. See [Labelling and grouping GCP // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. This field is available only when the resource's - // proto contains it. + // Protobuf contains it. // // To search against the `labels`: // @@ -387,7 +407,7 @@ message ResourceSearchResult { // type of annotations used to group GCP resources. See [Labelling GCP // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. This field is available only when the resource's - // proto contains it. + // Protobuf contains it. // // To search against the `network_tags`: // @@ -396,10 +416,11 @@ message ResourceSearchResult { repeated string network_tags = 8; // The Cloud KMS - // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys?hl=en) + // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) // name or - // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) - // name. This field is available only when the resource's proto contains it. + // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + // name. This field is available only when the resource's Protobuf contains + // it. // // To search against the `kms_key`: // @@ -409,7 +430,7 @@ message ResourceSearchResult { // The create timestamp of this resource, at which the resource was created. // The granularity is in seconds. Timestamp.nanos will always be 0. This field - // is available only when the resource's proto contains it. + // is available only when the resource's Protobuf contains it. // // To search against `create_time`: // @@ -422,7 +443,7 @@ message ResourceSearchResult { // The last update timestamp of this resource, at which the resource was last // modified or deleted. The granularity is in seconds. Timestamp.nanos will - // always be 0. This field is available only when the resource's proto + // always be 0. This field is available only when the resource's Protobuf // contains it. // // To search against `update_time`: @@ -436,7 +457,8 @@ message ResourceSearchResult { // The state of this resource. Different resources types have different state // definitions that are mapped from various fields of different resource - // types. This field is available only when the resource's proto contains it. + // types. This field is available only when the resource's Protobuf contains + // it. // // Example: // If the resource is an instance provided by Compute Engine, @@ -511,6 +533,43 @@ message ResourceSearchResult { // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). map relationships = 21; + // TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + // To search against the `tagKeys`: + // + // * use a field query. Example: + // - `tagKeys:"123456789/env*"` + // - `tagKeys="123456789/env"` + // - `tagKeys:"env"` + // + // * use a free text query. Example: + // - `env` + repeated string tag_keys = 23; + + // TagValue namespaced names, in the format of + // {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + // To search against the `tagValues`: + // + // * use a field query. Example: + // - `tagValues:"env"` + // - `tagValues:"env/prod"` + // - `tagValues:"123456789/env/prod*"` + // - `tagValues="123456789/env/prod"` + // + // * use a free text query. Example: + // - `prod` + repeated string tag_values = 25; + + // TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + // To search against the `tagValueIds`: + // + // * use a field query. Example: + // - `tagValueIds:"456"` + // - `tagValueIds="tagValues/456"` + // + // * use a free text query. Example: + // - `456` + repeated string tag_value_ids = 26; + // The type of this resource's immediate parent, if there is one. // // To search against the `parent_asset_type`: @@ -798,8 +857,10 @@ message IamPolicyAnalysisResult { repeated Access accesses = 2; // Resource edges of the graph starting from the policy attached - // resource to any descendant resources. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] contains - // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // resource to any descendant resources. The + // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // contains the full resource name of a parent resource and + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] // contains the full resource name of a child resource. This field is // present only if the output_resource_edges option is enabled in request. repeated Edge resource_edges = 3; @@ -818,32 +879,41 @@ message IamPolicyAnalysisResult { repeated Identity identities = 1; // Group identity edges of the graph starting from the binding's - // group members to any node of the [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // group members to any node of the + // [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. + // The + // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] // contains a group, such as `group:parent@google.com`. The - // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] contains a member of the group, - // such as `group:child@google.com` or `user:foo@google.com`. - // This field is present only if the output_group_edges option is enabled in - // request. + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // contains a member of the group, such as `group:child@google.com` or + // `user:foo@google.com`. This field is present only if the + // output_group_edges option is enabled in request. repeated Edge group_edges = 2; } // The [full resource // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) - // of the resource to which the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] policy attaches. + // of the resource to which the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // policy attaches. string attached_resource_full_name = 1; // The Cloud IAM policy binding under analysis. google.iam.v1.Binding iam_binding = 2; - // The access control lists derived from the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or - // potentially match resource and access selectors specified in the request. + // The access control lists derived from the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // that match or potentially match resource and access selectors specified in + // the request. repeated AccessControlList access_control_lists = 3; - // The identity list derived from members of the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or - // potentially match identity selector specified in the request. + // The identity list derived from members of the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // that match or potentially match identity selector specified in the request. IdentityList identity_list = 4; - // Represents whether all analyses on the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] have successfully - // finished. + // Represents whether all analyses on the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // have successfully finished. bool fully_explored = 5; } diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index f58eeafa203..9e8aa4d040e 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -227,6 +227,90 @@ export namespace google { * @returns Promise */ public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest): Promise; + + /** + * Calls CreateSavedQuery. + * @param request CreateSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public createSavedQuery(request: google.cloud.asset.v1.ICreateSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.CreateSavedQueryCallback): void; + + /** + * Calls CreateSavedQuery. + * @param request CreateSavedQueryRequest message or plain object + * @returns Promise + */ + public createSavedQuery(request: google.cloud.asset.v1.ICreateSavedQueryRequest): Promise; + + /** + * Calls GetSavedQuery. + * @param request GetSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public getSavedQuery(request: google.cloud.asset.v1.IGetSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.GetSavedQueryCallback): void; + + /** + * Calls GetSavedQuery. + * @param request GetSavedQueryRequest message or plain object + * @returns Promise + */ + public getSavedQuery(request: google.cloud.asset.v1.IGetSavedQueryRequest): Promise; + + /** + * Calls ListSavedQueries. + * @param request ListSavedQueriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSavedQueriesResponse + */ + public listSavedQueries(request: google.cloud.asset.v1.IListSavedQueriesRequest, callback: google.cloud.asset.v1.AssetService.ListSavedQueriesCallback): void; + + /** + * Calls ListSavedQueries. + * @param request ListSavedQueriesRequest message or plain object + * @returns Promise + */ + public listSavedQueries(request: google.cloud.asset.v1.IListSavedQueriesRequest): Promise; + + /** + * Calls UpdateSavedQuery. + * @param request UpdateSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public updateSavedQuery(request: google.cloud.asset.v1.IUpdateSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.UpdateSavedQueryCallback): void; + + /** + * Calls UpdateSavedQuery. + * @param request UpdateSavedQueryRequest message or plain object + * @returns Promise + */ + public updateSavedQuery(request: google.cloud.asset.v1.IUpdateSavedQueryRequest): Promise; + + /** + * Calls DeleteSavedQuery. + * @param request DeleteSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSavedQuery(request: google.cloud.asset.v1.IDeleteSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.DeleteSavedQueryCallback): void; + + /** + * Calls DeleteSavedQuery. + * @param request DeleteSavedQueryRequest message or plain object + * @returns Promise + */ + public deleteSavedQuery(request: google.cloud.asset.v1.IDeleteSavedQueryRequest): Promise; + + /** + * Calls BatchGetEffectiveIamPolicies. + * @param request BatchGetEffectiveIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetEffectiveIamPoliciesResponse + */ + public batchGetEffectiveIamPolicies(request: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, callback: google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPoliciesCallback): void; + + /** + * Calls BatchGetEffectiveIamPolicies. + * @param request BatchGetEffectiveIamPoliciesRequest message or plain object + * @returns Promise + */ + public batchGetEffectiveIamPolicies(request: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): Promise; } namespace AssetService { @@ -321,6 +405,48 @@ export namespace google { * @param [response] AnalyzeMoveResponse */ type AnalyzeMoveCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeMoveResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type CreateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#getSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type GetSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listSavedQueries}. + * @param error Error, if any + * @param [response] ListSavedQueriesResponse + */ + type ListSavedQueriesCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListSavedQueriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type UpdateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteSavedQuery}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSavedQueryCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetEffectiveIamPolicies}. + * @param error Error, if any + * @param [response] BatchGetEffectiveIamPoliciesResponse + */ + type BatchGetEffectiveIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse) => void; } /** Properties of an AnalyzeIamPolicyLongrunningMetadata. */ @@ -3585,6 +3711,9 @@ export namespace google { /** AnalyzeIamPolicyRequest analysisQuery */ analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyRequest savedAnalysisQuery */ + savedAnalysisQuery?: (string|null); + /** AnalyzeIamPolicyRequest executionTimeout */ executionTimeout?: (google.protobuf.IDuration|null); } @@ -3601,6 +3730,9 @@ export namespace google { /** AnalyzeIamPolicyRequest analysisQuery. */ public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyRequest savedAnalysisQuery. */ + public savedAnalysisQuery: string; + /** AnalyzeIamPolicyRequest executionTimeout. */ public executionTimeout?: (google.protobuf.IDuration|null); @@ -4203,6 +4335,9 @@ export namespace google { /** AnalyzeIamPolicyLongrunningRequest analysisQuery */ analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery */ + savedAnalysisQuery?: (string|null); + /** AnalyzeIamPolicyLongrunningRequest outputConfig */ outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); } @@ -4219,6 +4354,9 @@ export namespace google { /** AnalyzeIamPolicyLongrunningRequest analysisQuery. */ public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery. */ + public savedAnalysisQuery: string; + /** AnalyzeIamPolicyLongrunningRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); @@ -4377,2627 +4515,3851 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an AnalyzeMoveRequest. */ - interface IAnalyzeMoveRequest { + /** Properties of a SavedQuery. */ + interface ISavedQuery { - /** AnalyzeMoveRequest resource */ - resource?: (string|null); + /** SavedQuery name */ + name?: (string|null); - /** AnalyzeMoveRequest destinationParent */ - destinationParent?: (string|null); + /** SavedQuery description */ + description?: (string|null); - /** AnalyzeMoveRequest view */ - view?: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null); + /** SavedQuery createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery creator */ + creator?: (string|null); + + /** SavedQuery lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery lastUpdater */ + lastUpdater?: (string|null); + + /** SavedQuery labels */ + labels?: ({ [k: string]: string }|null); + + /** SavedQuery content */ + content?: (google.cloud.asset.v1.SavedQuery.IQueryContent|null); } - /** Represents an AnalyzeMoveRequest. */ - class AnalyzeMoveRequest implements IAnalyzeMoveRequest { + /** Represents a SavedQuery. */ + class SavedQuery implements ISavedQuery { /** - * Constructs a new AnalyzeMoveRequest. + * Constructs a new SavedQuery. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest); + constructor(properties?: google.cloud.asset.v1.ISavedQuery); - /** AnalyzeMoveRequest resource. */ - public resource: string; + /** SavedQuery name. */ + public name: string; - /** AnalyzeMoveRequest destinationParent. */ - public destinationParent: string; + /** SavedQuery description. */ + public description: string; - /** AnalyzeMoveRequest view. */ - public view: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView); + /** SavedQuery createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery creator. */ + public creator: string; + + /** SavedQuery lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery lastUpdater. */ + public lastUpdater: string; + + /** SavedQuery labels. */ + public labels: { [k: string]: string }; + + /** SavedQuery content. */ + public content?: (google.cloud.asset.v1.SavedQuery.IQueryContent|null); /** - * Creates a new AnalyzeMoveRequest instance using the specified properties. + * Creates a new SavedQuery instance using the specified properties. * @param [properties] Properties to set - * @returns AnalyzeMoveRequest instance + * @returns SavedQuery instance */ - public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest): google.cloud.asset.v1.AnalyzeMoveRequest; + public static create(properties?: google.cloud.asset.v1.ISavedQuery): google.cloud.asset.v1.SavedQuery; /** - * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. - * @param message AnalyzeMoveRequest message or plain object to encode + * Encodes the specified SavedQuery message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @param message SavedQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ISavedQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. - * @param message AnalyzeMoveRequest message or plain object to encode + * Encodes the specified SavedQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @param message SavedQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ISavedQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * Decodes a SavedQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnalyzeMoveRequest + * @returns SavedQuery * @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.asset.v1.AnalyzeMoveRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SavedQuery; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * Decodes a SavedQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnalyzeMoveRequest + * @returns SavedQuery * @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.asset.v1.AnalyzeMoveRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SavedQuery; /** - * Verifies an AnalyzeMoveRequest message. + * Verifies a SavedQuery 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 AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SavedQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnalyzeMoveRequest + * @returns SavedQuery */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SavedQuery; /** - * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. - * @param message AnalyzeMoveRequest + * Creates a plain object from a SavedQuery message. Also converts values to other types if specified. + * @param message SavedQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.AnalyzeMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.SavedQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnalyzeMoveRequest to JSON. + * Converts this SavedQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AnalyzeMoveRequest { + namespace SavedQuery { - /** AnalysisView enum. */ - enum AnalysisView { - ANALYSIS_VIEW_UNSPECIFIED = 0, - FULL = 1, - BASIC = 2 + /** Properties of a QueryContent. */ + interface IQueryContent { + + /** QueryContent iamPolicyAnalysisQuery */ + iamPolicyAnalysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + } + + /** Represents a QueryContent. */ + class QueryContent implements IQueryContent { + + /** + * Constructs a new QueryContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.SavedQuery.IQueryContent); + + /** QueryContent iamPolicyAnalysisQuery. */ + public iamPolicyAnalysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** QueryContent queryContent. */ + public queryContent?: "iamPolicyAnalysisQuery"; + + /** + * Creates a new QueryContent instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryContent instance + */ + public static create(properties?: google.cloud.asset.v1.SavedQuery.IQueryContent): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Encodes the specified QueryContent message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @param message QueryContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.SavedQuery.IQueryContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryContent message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @param message QueryContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.SavedQuery.IQueryContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryContent + * @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.asset.v1.SavedQuery.QueryContent; + + /** + * Decodes a QueryContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryContent + * @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.asset.v1.SavedQuery.QueryContent; + + /** + * Verifies a QueryContent 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 QueryContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Creates a plain object from a QueryContent message. Also converts values to other types if specified. + * @param message QueryContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SavedQuery.QueryContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } } - /** Properties of an AnalyzeMoveResponse. */ - interface IAnalyzeMoveResponse { + /** Properties of a CreateSavedQueryRequest. */ + interface ICreateSavedQueryRequest { - /** AnalyzeMoveResponse moveAnalysis */ - moveAnalysis?: (google.cloud.asset.v1.IMoveAnalysis[]|null); + /** CreateSavedQueryRequest parent */ + parent?: (string|null); + + /** CreateSavedQueryRequest savedQuery */ + savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** CreateSavedQueryRequest savedQueryId */ + savedQueryId?: (string|null); } - /** Represents an AnalyzeMoveResponse. */ - class AnalyzeMoveResponse implements IAnalyzeMoveResponse { + /** Represents a CreateSavedQueryRequest. */ + class CreateSavedQueryRequest implements ICreateSavedQueryRequest { /** - * Constructs a new AnalyzeMoveResponse. + * Constructs a new CreateSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse); + constructor(properties?: google.cloud.asset.v1.ICreateSavedQueryRequest); - /** AnalyzeMoveResponse moveAnalysis. */ - public moveAnalysis: google.cloud.asset.v1.IMoveAnalysis[]; + /** CreateSavedQueryRequest parent. */ + public parent: string; + + /** CreateSavedQueryRequest savedQuery. */ + public savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** CreateSavedQueryRequest savedQueryId. */ + public savedQueryId: string; /** - * Creates a new AnalyzeMoveResponse instance using the specified properties. + * Creates a new CreateSavedQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AnalyzeMoveResponse instance + * @returns CreateSavedQueryRequest instance */ - public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse): google.cloud.asset.v1.AnalyzeMoveResponse; + public static create(properties?: google.cloud.asset.v1.ICreateSavedQueryRequest): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @param message AnalyzeMoveResponse message or plain object to encode + * Encodes the specified CreateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @param message CreateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ICreateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @param message AnalyzeMoveResponse message or plain object to encode + * Encodes the specified CreateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @param message CreateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ICreateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnalyzeMoveResponse + * @returns CreateSavedQueryRequest * @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.asset.v1.AnalyzeMoveResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnalyzeMoveResponse + * @returns CreateSavedQueryRequest * @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.asset.v1.AnalyzeMoveResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Verifies an AnalyzeMoveResponse message. + * Verifies a CreateSavedQueryRequest 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 AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnalyzeMoveResponse + * @returns CreateSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. - * @param message AnalyzeMoveResponse + * Creates a plain object from a CreateSavedQueryRequest message. Also converts values to other types if specified. + * @param message CreateSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.AnalyzeMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.CreateSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnalyzeMoveResponse to JSON. + * Converts this CreateSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MoveAnalysis. */ - interface IMoveAnalysis { - - /** MoveAnalysis displayName */ - displayName?: (string|null); - - /** MoveAnalysis analysis */ - analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + /** Properties of a GetSavedQueryRequest. */ + interface IGetSavedQueryRequest { - /** MoveAnalysis error */ - error?: (google.rpc.IStatus|null); + /** GetSavedQueryRequest name */ + name?: (string|null); } - /** Represents a MoveAnalysis. */ - class MoveAnalysis implements IMoveAnalysis { + /** Represents a GetSavedQueryRequest. */ + class GetSavedQueryRequest implements IGetSavedQueryRequest { /** - * Constructs a new MoveAnalysis. + * Constructs a new GetSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IMoveAnalysis); + constructor(properties?: google.cloud.asset.v1.IGetSavedQueryRequest); - /** MoveAnalysis displayName. */ - public displayName: string; + /** GetSavedQueryRequest name. */ + public name: string; - /** MoveAnalysis analysis. */ - public analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); - - /** MoveAnalysis error. */ - public error?: (google.rpc.IStatus|null); - - /** MoveAnalysis result. */ - public result?: ("analysis"|"error"); - - /** - * Creates a new MoveAnalysis instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveAnalysis instance - */ - public static create(properties?: google.cloud.asset.v1.IMoveAnalysis): google.cloud.asset.v1.MoveAnalysis; + /** + * Creates a new GetSavedQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSavedQueryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IGetSavedQueryRequest): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. - * @param message MoveAnalysis message or plain object to encode + * Encodes the specified GetSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @param message GetSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGetSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. - * @param message MoveAnalysis message or plain object to encode + * Encodes the specified GetSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @param message GetSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGetSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MoveAnalysis message from the specified reader or buffer. + * Decodes a GetSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MoveAnalysis + * @returns GetSavedQueryRequest * @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.asset.v1.MoveAnalysis; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. + * Decodes a GetSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MoveAnalysis + * @returns GetSavedQueryRequest * @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.asset.v1.MoveAnalysis; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Verifies a MoveAnalysis message. + * Verifies a GetSavedQueryRequest 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 MoveAnalysis message from a plain object. Also converts values to their respective internal types. + * Creates a GetSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MoveAnalysis + * @returns GetSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysis; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. - * @param message MoveAnalysis + * Creates a plain object from a GetSavedQueryRequest message. Also converts values to other types if specified. + * @param message GetSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.MoveAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GetSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MoveAnalysis to JSON. + * Converts this GetSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MoveAnalysisResult. */ - interface IMoveAnalysisResult { + /** Properties of a ListSavedQueriesRequest. */ + interface IListSavedQueriesRequest { - /** MoveAnalysisResult blockers */ - blockers?: (google.cloud.asset.v1.IMoveImpact[]|null); + /** ListSavedQueriesRequest parent */ + parent?: (string|null); - /** MoveAnalysisResult warnings */ - warnings?: (google.cloud.asset.v1.IMoveImpact[]|null); + /** ListSavedQueriesRequest filter */ + filter?: (string|null); + + /** ListSavedQueriesRequest pageSize */ + pageSize?: (number|null); + + /** ListSavedQueriesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a MoveAnalysisResult. */ - class MoveAnalysisResult implements IMoveAnalysisResult { + /** Represents a ListSavedQueriesRequest. */ + class ListSavedQueriesRequest implements IListSavedQueriesRequest { /** - * Constructs a new MoveAnalysisResult. + * Constructs a new ListSavedQueriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IMoveAnalysisResult); + constructor(properties?: google.cloud.asset.v1.IListSavedQueriesRequest); - /** MoveAnalysisResult blockers. */ - public blockers: google.cloud.asset.v1.IMoveImpact[]; + /** ListSavedQueriesRequest parent. */ + public parent: string; - /** MoveAnalysisResult warnings. */ - public warnings: google.cloud.asset.v1.IMoveImpact[]; + /** ListSavedQueriesRequest filter. */ + public filter: string; + + /** ListSavedQueriesRequest pageSize. */ + public pageSize: number; + + /** ListSavedQueriesRequest pageToken. */ + public pageToken: string; /** - * Creates a new MoveAnalysisResult instance using the specified properties. + * Creates a new ListSavedQueriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns MoveAnalysisResult instance + * @returns ListSavedQueriesRequest instance */ - public static create(properties?: google.cloud.asset.v1.IMoveAnalysisResult): google.cloud.asset.v1.MoveAnalysisResult; + public static create(properties?: google.cloud.asset.v1.IListSavedQueriesRequest): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. - * @param message MoveAnalysisResult message or plain object to encode + * Encodes the specified ListSavedQueriesRequest message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @param message ListSavedQueriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListSavedQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. - * @param message MoveAnalysisResult message or plain object to encode + * Encodes the specified ListSavedQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @param message ListSavedQueriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListSavedQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MoveAnalysisResult + * @returns ListSavedQueriesRequest * @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.asset.v1.MoveAnalysisResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MoveAnalysisResult + * @returns ListSavedQueriesRequest * @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.asset.v1.MoveAnalysisResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Verifies a MoveAnalysisResult message. + * Verifies a ListSavedQueriesRequest 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 MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListSavedQueriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MoveAnalysisResult + * @returns ListSavedQueriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysisResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. - * @param message MoveAnalysisResult + * Creates a plain object from a ListSavedQueriesRequest message. Also converts values to other types if specified. + * @param message ListSavedQueriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.MoveAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListSavedQueriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MoveAnalysisResult to JSON. + * Converts this ListSavedQueriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MoveImpact. */ - interface IMoveImpact { + /** Properties of a ListSavedQueriesResponse. */ + interface IListSavedQueriesResponse { - /** MoveImpact detail */ - detail?: (string|null); + /** ListSavedQueriesResponse savedQueries */ + savedQueries?: (google.cloud.asset.v1.ISavedQuery[]|null); + + /** ListSavedQueriesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a MoveImpact. */ - class MoveImpact implements IMoveImpact { + /** Represents a ListSavedQueriesResponse. */ + class ListSavedQueriesResponse implements IListSavedQueriesResponse { /** - * Constructs a new MoveImpact. + * Constructs a new ListSavedQueriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IMoveImpact); + constructor(properties?: google.cloud.asset.v1.IListSavedQueriesResponse); - /** MoveImpact detail. */ - public detail: string; + /** ListSavedQueriesResponse savedQueries. */ + public savedQueries: google.cloud.asset.v1.ISavedQuery[]; + + /** ListSavedQueriesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new MoveImpact instance using the specified properties. + * Creates a new ListSavedQueriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MoveImpact instance + * @returns ListSavedQueriesResponse instance */ - public static create(properties?: google.cloud.asset.v1.IMoveImpact): google.cloud.asset.v1.MoveImpact; + public static create(properties?: google.cloud.asset.v1.IListSavedQueriesResponse): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. - * @param message MoveImpact message or plain object to encode + * Encodes the specified ListSavedQueriesResponse message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @param message ListSavedQueriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListSavedQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. - * @param message MoveImpact message or plain object to encode + * Encodes the specified ListSavedQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @param message ListSavedQueriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListSavedQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MoveImpact message from the specified reader or buffer. + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MoveImpact + * @returns ListSavedQueriesResponse * @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.asset.v1.MoveImpact; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MoveImpact + * @returns ListSavedQueriesResponse * @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.asset.v1.MoveImpact; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Verifies a MoveImpact message. + * Verifies a ListSavedQueriesResponse 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 MoveImpact message from a plain object. Also converts values to their respective internal types. + * Creates a ListSavedQueriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MoveImpact + * @returns ListSavedQueriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveImpact; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. - * @param message MoveImpact + * Creates a plain object from a ListSavedQueriesResponse message. Also converts values to other types if specified. + * @param message ListSavedQueriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.MoveImpact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListSavedQueriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MoveImpact to JSON. + * Converts this ListSavedQueriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5, - OS_INVENTORY = 6, - RELATIONSHIP = 7 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); - - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** Properties of an UpdateSavedQueryRequest. */ + interface IUpdateSavedQueryRequest { - /** TemporalAsset priorAssetState */ - priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + /** UpdateSavedQueryRequest savedQuery */ + savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); - /** TemporalAsset priorAsset */ - priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** UpdateSavedQueryRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an UpdateSavedQueryRequest. */ + class UpdateSavedQueryRequest implements IUpdateSavedQueryRequest { /** - * Constructs a new TemporalAsset. + * Constructs a new UpdateSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + constructor(properties?: google.cloud.asset.v1.IUpdateSavedQueryRequest); - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); - - /** TemporalAsset priorAssetState. */ - public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + /** UpdateSavedQueryRequest savedQuery. */ + public savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); - /** TemporalAsset priorAsset. */ - public priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** UpdateSavedQueryRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new UpdateSavedQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns UpdateSavedQueryRequest instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IUpdateSavedQueryRequest): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified UpdateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @param message UpdateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IUpdateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified UpdateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @param message UpdateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns UpdateSavedQueryRequest * @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.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns UpdateSavedQueryRequest * @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.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Verifies a TemporalAsset message. + * Verifies an UpdateSavedQueryRequest 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 TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns UpdateSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from an UpdateSavedQueryRequest message. Also converts values to other types if specified. + * @param message UpdateSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.UpdateSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this UpdateSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace TemporalAsset { - - /** PriorAssetState enum. */ - enum PriorAssetState { - PRIOR_ASSET_STATE_UNSPECIFIED = 0, - PRESENT = 1, - INVALID = 2, - DOES_NOT_EXIST = 3, - DELETED = 4 - } - } - - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of a DeleteSavedQueryRequest. */ + interface IDeleteSavedQueryRequest { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** DeleteSavedQueryRequest name */ + name?: (string|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents a DeleteSavedQueryRequest. */ + class DeleteSavedQueryRequest implements IDeleteSavedQueryRequest { /** - * Constructs a new TimeWindow. + * Constructs a new DeleteSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); - - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.asset.v1.IDeleteSavedQueryRequest); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** DeleteSavedQueryRequest name. */ + public name: string; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new DeleteSavedQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns DeleteSavedQueryRequest instance */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public static create(properties?: google.cloud.asset.v1.IDeleteSavedQueryRequest): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified DeleteSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @param message DeleteSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IDeleteSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified DeleteSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @param message DeleteSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns DeleteSavedQueryRequest * @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.asset.v1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns DeleteSavedQueryRequest * @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.asset.v1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Verifies a TimeWindow message. + * Verifies a DeleteSavedQueryRequest 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. + * Creates a DeleteSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns DeleteSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from a DeleteSavedQueryRequest message. Also converts values to other types if specified. + * @param message DeleteSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.DeleteSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this DeleteSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { + /** Properties of an AnalyzeMoveRequest. */ + interface IAnalyzeMoveRequest { - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** AnalyzeMoveRequest resource */ + resource?: (string|null); - /** Asset name */ - name?: (string|null); + /** AnalyzeMoveRequest destinationParent */ + destinationParent?: (string|null); - /** Asset assetType */ - assetType?: (string|null); + /** AnalyzeMoveRequest view */ + view?: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null); + } - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); - - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - - /** Asset osInventory */ - osInventory?: (google.cloud.osconfig.v1.IInventory|null); - - /** Asset relatedAssets */ - relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); - - /** Asset ancestors */ - ancestors?: (string[]|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents an AnalyzeMoveRequest. */ + class AnalyzeMoveRequest implements IAnalyzeMoveRequest { /** - * Constructs a new Asset. + * Constructs a new AnalyzeMoveRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAsset); - - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Asset name. */ - public name: string; - - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset orgPolicy. */ - public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; - - /** Asset accessPolicy. */ - public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - - /** Asset accessLevel. */ - public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - - /** Asset servicePerimeter. */ - public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - - /** Asset osInventory. */ - public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest); - /** Asset relatedAssets. */ - public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + /** AnalyzeMoveRequest resource. */ + public resource: string; - /** Asset ancestors. */ - public ancestors: string[]; + /** AnalyzeMoveRequest destinationParent. */ + public destinationParent: string; - /** Asset accessContextPolicy. */ - public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + /** AnalyzeMoveRequest view. */ + public view: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView); /** - * Creates a new Asset instance using the specified properties. + * Creates a new AnalyzeMoveRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns AnalyzeMoveRequest instance */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns AnalyzeMoveRequest * @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.asset.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns AnalyzeMoveRequest * @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.asset.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Verifies an Asset message. + * Verifies an AnalyzeMoveRequest 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns AnalyzeMoveRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @param message AnalyzeMoveRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this AnalyzeMoveRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); - - /** Resource discoveryName */ - discoveryName?: (string|null); - - /** Resource resourceUrl */ - resourceUrl?: (string|null); + namespace AnalyzeMoveRequest { - /** Resource parent */ - parent?: (string|null); + /** AnalysisView enum. */ + enum AnalysisView { + ANALYSIS_VIEW_UNSPECIFIED = 0, + FULL = 1, + BASIC = 2 + } + } - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** Properties of an AnalyzeMoveResponse. */ + interface IAnalyzeMoveResponse { - /** Resource location */ - location?: (string|null); + /** AnalyzeMoveResponse moveAnalysis */ + moveAnalysis?: (google.cloud.asset.v1.IMoveAnalysis[]|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents an AnalyzeMoveResponse. */ + class AnalyzeMoveResponse implements IAnalyzeMoveResponse { /** - * Constructs a new Resource. + * Constructs a new AnalyzeMoveResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; - - /** Resource discoveryName. */ - public discoveryName: string; - - /** Resource resourceUrl. */ - public resourceUrl: string; - - /** Resource parent. */ - public parent: string; - - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse); - /** Resource location. */ - public location: string; + /** AnalyzeMoveResponse moveAnalysis. */ + public moveAnalysis: google.cloud.asset.v1.IMoveAnalysis[]; /** - * Creates a new Resource instance using the specified properties. + * Creates a new AnalyzeMoveResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns AnalyzeMoveResponse instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns AnalyzeMoveResponse * @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.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns AnalyzeMoveResponse * @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.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Verifies a Resource message. + * Verifies an AnalyzeMoveResponse 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 Resource message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns AnalyzeMoveResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. + * @param message AnalyzeMoveResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this AnalyzeMoveResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelatedAssets. */ - interface IRelatedAssets { + /** Properties of a MoveAnalysis. */ + interface IMoveAnalysis { - /** RelatedAssets relationshipAttributes */ - relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + /** MoveAnalysis displayName */ + displayName?: (string|null); - /** RelatedAssets assets */ - assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); + /** MoveAnalysis analysis */ + analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + + /** MoveAnalysis error */ + error?: (google.rpc.IStatus|null); } - /** Represents a RelatedAssets. */ - class RelatedAssets implements IRelatedAssets { + /** Represents a MoveAnalysis. */ + class MoveAnalysis implements IMoveAnalysis { /** - * Constructs a new RelatedAssets. + * Constructs a new MoveAnalysis. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedAssets); + constructor(properties?: google.cloud.asset.v1.IMoveAnalysis); - /** RelatedAssets relationshipAttributes. */ - public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + /** MoveAnalysis displayName. */ + public displayName: string; - /** RelatedAssets assets. */ - public assets: google.cloud.asset.v1.IRelatedAsset[]; + /** MoveAnalysis analysis. */ + public analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + + /** MoveAnalysis error. */ + public error?: (google.rpc.IStatus|null); + + /** MoveAnalysis result. */ + public result?: ("analysis"|"error"); /** - * Creates a new RelatedAssets instance using the specified properties. + * Creates a new MoveAnalysis instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedAssets instance + * @returns MoveAnalysis instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; + public static create(properties?: google.cloud.asset.v1.IMoveAnalysis): google.cloud.asset.v1.MoveAnalysis; /** - * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. - * @param message RelatedAssets message or plain object to encode + * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. - * @param message RelatedAssets message or plain object to encode + * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedAssets message from the specified reader or buffer. + * Decodes a MoveAnalysis message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedAssets + * @returns MoveAnalysis * @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.asset.v1.RelatedAssets; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveAnalysis; /** - * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedAssets + * @returns MoveAnalysis * @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.asset.v1.RelatedAssets; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveAnalysis; /** - * Verifies a RelatedAssets message. + * Verifies a MoveAnalysis 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 RelatedAssets message from a plain object. Also converts values to their respective internal types. + * Creates a MoveAnalysis message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedAssets + * @returns MoveAnalysis */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysis; /** - * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. - * @param message RelatedAssets + * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. + * @param message MoveAnalysis * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.MoveAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedAssets to JSON. + * Converts this MoveAnalysis to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelationshipAttributes. */ - interface IRelationshipAttributes { - - /** RelationshipAttributes type */ - type?: (string|null); - - /** RelationshipAttributes sourceResourceType */ - sourceResourceType?: (string|null); + /** Properties of a MoveAnalysisResult. */ + interface IMoveAnalysisResult { - /** RelationshipAttributes targetResourceType */ - targetResourceType?: (string|null); + /** MoveAnalysisResult blockers */ + blockers?: (google.cloud.asset.v1.IMoveImpact[]|null); - /** RelationshipAttributes action */ - action?: (string|null); + /** MoveAnalysisResult warnings */ + warnings?: (google.cloud.asset.v1.IMoveImpact[]|null); } - /** Represents a RelationshipAttributes. */ - class RelationshipAttributes implements IRelationshipAttributes { + /** Represents a MoveAnalysisResult. */ + class MoveAnalysisResult implements IMoveAnalysisResult { /** - * Constructs a new RelationshipAttributes. + * Constructs a new MoveAnalysisResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); - - /** RelationshipAttributes type. */ - public type: string; - - /** RelationshipAttributes sourceResourceType. */ - public sourceResourceType: string; + constructor(properties?: google.cloud.asset.v1.IMoveAnalysisResult); - /** RelationshipAttributes targetResourceType. */ - public targetResourceType: string; + /** MoveAnalysisResult blockers. */ + public blockers: google.cloud.asset.v1.IMoveImpact[]; - /** RelationshipAttributes action. */ - public action: string; + /** MoveAnalysisResult warnings. */ + public warnings: google.cloud.asset.v1.IMoveImpact[]; /** - * Creates a new RelationshipAttributes instance using the specified properties. + * Creates a new MoveAnalysisResult instance using the specified properties. * @param [properties] Properties to set - * @returns RelationshipAttributes instance + * @returns MoveAnalysisResult instance */ - public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; + public static create(properties?: google.cloud.asset.v1.IMoveAnalysisResult): google.cloud.asset.v1.MoveAnalysisResult; /** - * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. - * @param message RelationshipAttributes message or plain object to encode + * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. - * @param message RelationshipAttributes message or plain object to encode + * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelationshipAttributes message from the specified reader or buffer. + * Decodes a MoveAnalysisResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelationshipAttributes + * @returns MoveAnalysisResult * @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.asset.v1.RelationshipAttributes; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveAnalysisResult; /** - * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelationshipAttributes + * @returns MoveAnalysisResult * @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.asset.v1.RelationshipAttributes; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveAnalysisResult; /** - * Verifies a RelationshipAttributes message. + * Verifies a MoveAnalysisResult 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 RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelationshipAttributes + * @returns MoveAnalysisResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysisResult; /** - * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. - * @param message RelationshipAttributes + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @param message MoveAnalysisResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.MoveAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelationshipAttributes to JSON. + * Converts this MoveAnalysisResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelatedAsset. */ - interface IRelatedAsset { - - /** RelatedAsset asset */ - asset?: (string|null); - - /** RelatedAsset assetType */ - assetType?: (string|null); + /** Properties of a MoveImpact. */ + interface IMoveImpact { - /** RelatedAsset ancestors */ - ancestors?: (string[]|null); + /** MoveImpact detail */ + detail?: (string|null); } - /** Represents a RelatedAsset. */ - class RelatedAsset implements IRelatedAsset { + /** Represents a MoveImpact. */ + class MoveImpact implements IMoveImpact { /** - * Constructs a new RelatedAsset. + * Constructs a new MoveImpact. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedAsset); - - /** RelatedAsset asset. */ - public asset: string; - - /** RelatedAsset assetType. */ - public assetType: string; + constructor(properties?: google.cloud.asset.v1.IMoveImpact); - /** RelatedAsset ancestors. */ - public ancestors: string[]; + /** MoveImpact detail. */ + public detail: string; /** - * Creates a new RelatedAsset instance using the specified properties. + * Creates a new MoveImpact instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedAsset instance + * @returns MoveImpact instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; + public static create(properties?: google.cloud.asset.v1.IMoveImpact): google.cloud.asset.v1.MoveImpact; /** - * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. - * @param message RelatedAsset message or plain object to encode + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. - * @param message RelatedAsset message or plain object to encode + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedAsset message from the specified reader or buffer. + * Decodes a MoveImpact message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedAsset + * @returns MoveImpact * @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.asset.v1.RelatedAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveImpact; /** - * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedAsset + * @returns MoveImpact * @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.asset.v1.RelatedAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveImpact; /** - * Verifies a RelatedAsset message. + * Verifies a MoveImpact 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 RelatedAsset message from a plain object. Also converts values to their respective internal types. + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedAsset + * @returns MoveImpact */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveImpact; /** - * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. - * @param message RelatedAsset + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @param message MoveImpact * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.MoveImpact, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedAsset to JSON. + * Converts this MoveImpact to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceSearchResult. */ - interface IResourceSearchResult { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5, + OS_INVENTORY = 6, + RELATIONSHIP = 7 + } - /** ResourceSearchResult name */ - name?: (string|null); + /** Properties of a BatchGetEffectiveIamPoliciesRequest. */ + interface IBatchGetEffectiveIamPoliciesRequest { - /** ResourceSearchResult assetType */ - assetType?: (string|null); + /** BatchGetEffectiveIamPoliciesRequest scope */ + scope?: (string|null); - /** ResourceSearchResult project */ - project?: (string|null); + /** BatchGetEffectiveIamPoliciesRequest names */ + names?: (string[]|null); + } - /** ResourceSearchResult folders */ - folders?: (string[]|null); + /** Represents a BatchGetEffectiveIamPoliciesRequest. */ + class BatchGetEffectiveIamPoliciesRequest implements IBatchGetEffectiveIamPoliciesRequest { - /** ResourceSearchResult organization */ - organization?: (string|null); + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest); - /** ResourceSearchResult displayName */ - displayName?: (string|null); + /** BatchGetEffectiveIamPoliciesRequest scope. */ + public scope: string; - /** ResourceSearchResult description */ - description?: (string|null); - - /** ResourceSearchResult location */ - location?: (string|null); - - /** ResourceSearchResult labels */ - labels?: ({ [k: string]: string }|null); - - /** ResourceSearchResult networkTags */ - networkTags?: (string[]|null); - - /** ResourceSearchResult kmsKey */ - kmsKey?: (string|null); - - /** ResourceSearchResult createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult state */ - state?: (string|null); - - /** ResourceSearchResult additionalAttributes */ - additionalAttributes?: (google.protobuf.IStruct|null); - - /** ResourceSearchResult parentFullResourceName */ - parentFullResourceName?: (string|null); - - /** ResourceSearchResult versionedResources */ - versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); - - /** ResourceSearchResult attachedResources */ - attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); - - /** ResourceSearchResult relationships */ - relationships?: ({ [k: string]: google.cloud.asset.v1.IRelatedResources }|null); - - /** ResourceSearchResult parentAssetType */ - parentAssetType?: (string|null); - } - - /** Represents a ResourceSearchResult. */ - class ResourceSearchResult implements IResourceSearchResult { - - /** - * Constructs a new ResourceSearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); - - /** ResourceSearchResult name. */ - public name: string; - - /** ResourceSearchResult assetType. */ - public assetType: string; - - /** ResourceSearchResult project. */ - public project: string; - - /** ResourceSearchResult folders. */ - public folders: string[]; - - /** ResourceSearchResult organization. */ - public organization: string; - - /** ResourceSearchResult displayName. */ - public displayName: string; - - /** ResourceSearchResult description. */ - public description: string; - - /** ResourceSearchResult location. */ - public location: string; - - /** ResourceSearchResult labels. */ - public labels: { [k: string]: string }; - - /** ResourceSearchResult networkTags. */ - public networkTags: string[]; - - /** ResourceSearchResult kmsKey. */ - public kmsKey: string; - - /** ResourceSearchResult createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult state. */ - public state: string; - - /** ResourceSearchResult additionalAttributes. */ - public additionalAttributes?: (google.protobuf.IStruct|null); - - /** ResourceSearchResult parentFullResourceName. */ - public parentFullResourceName: string; - - /** ResourceSearchResult versionedResources. */ - public versionedResources: google.cloud.asset.v1.IVersionedResource[]; - - /** ResourceSearchResult attachedResources. */ - public attachedResources: google.cloud.asset.v1.IAttachedResource[]; - - /** ResourceSearchResult relationships. */ - public relationships: { [k: string]: google.cloud.asset.v1.IRelatedResources }; - - /** ResourceSearchResult parentAssetType. */ - public parentAssetType: string; + /** BatchGetEffectiveIamPoliciesRequest names. */ + public names: string[]; /** - * Creates a new ResourceSearchResult instance using the specified properties. + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceSearchResult instance + * @returns BatchGetEffectiveIamPoliciesRequest instance */ - public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceSearchResult + * @returns BatchGetEffectiveIamPoliciesRequest * @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.asset.v1.ResourceSearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceSearchResult + * @returns BatchGetEffectiveIamPoliciesRequest * @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.asset.v1.ResourceSearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Verifies a ResourceSearchResult message. + * Verifies a BatchGetEffectiveIamPoliciesRequest 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceSearchResult + * @returns BatchGetEffectiveIamPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @param message ResourceSearchResult + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceSearchResult to JSON. + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VersionedResource. */ - interface IVersionedResource { - - /** VersionedResource version */ - version?: (string|null); + /** Properties of a BatchGetEffectiveIamPoliciesResponse. */ + interface IBatchGetEffectiveIamPoliciesResponse { - /** VersionedResource resource */ - resource?: (google.protobuf.IStruct|null); + /** BatchGetEffectiveIamPoliciesResponse policyResults */ + policyResults?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]|null); } - /** Represents a VersionedResource. */ - class VersionedResource implements IVersionedResource { + /** Represents a BatchGetEffectiveIamPoliciesResponse. */ + class BatchGetEffectiveIamPoliciesResponse implements IBatchGetEffectiveIamPoliciesResponse { /** - * Constructs a new VersionedResource. + * Constructs a new BatchGetEffectiveIamPoliciesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IVersionedResource); - - /** VersionedResource version. */ - public version: string; + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse); - /** VersionedResource resource. */ - public resource?: (google.protobuf.IStruct|null); + /** BatchGetEffectiveIamPoliciesResponse policyResults. */ + public policyResults: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]; /** - * Creates a new VersionedResource instance using the specified properties. + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns VersionedResource instance + * @returns BatchGetEffectiveIamPoliciesResponse instance */ - public static create(properties?: google.cloud.asset.v1.IVersionedResource): google.cloud.asset.v1.VersionedResource; + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. - * @param message VersionedResource message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. - * @param message VersionedResource message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VersionedResource message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VersionedResource + * @returns BatchGetEffectiveIamPoliciesResponse * @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.asset.v1.VersionedResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VersionedResource + * @returns BatchGetEffectiveIamPoliciesResponse * @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.asset.v1.VersionedResource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Verifies a VersionedResource message. + * Verifies a BatchGetEffectiveIamPoliciesResponse 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 VersionedResource message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VersionedResource + * @returns BatchGetEffectiveIamPoliciesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.VersionedResource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. - * @param message VersionedResource + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.VersionedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VersionedResource to JSON. + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AttachedResource. */ - interface IAttachedResource { - - /** AttachedResource assetType */ - assetType?: (string|null); + namespace BatchGetEffectiveIamPoliciesResponse { - /** AttachedResource versionedResources */ - versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); - } + /** Properties of an EffectiveIamPolicy. */ + interface IEffectiveIamPolicy { - /** Represents an AttachedResource. */ - class AttachedResource implements IAttachedResource { + /** EffectiveIamPolicy fullResourceName */ + fullResourceName?: (string|null); - /** - * Constructs a new AttachedResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAttachedResource); + /** EffectiveIamPolicy policies */ + policies?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]|null); + } - /** AttachedResource assetType. */ - public assetType: string; + /** Represents an EffectiveIamPolicy. */ + class EffectiveIamPolicy implements IEffectiveIamPolicy { - /** AttachedResource versionedResources. */ - public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + /** + * Constructs a new EffectiveIamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy); - /** - * Creates a new AttachedResource instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedResource instance - */ - public static create(properties?: google.cloud.asset.v1.IAttachedResource): google.cloud.asset.v1.AttachedResource; + /** EffectiveIamPolicy fullResourceName. */ + public fullResourceName: string; - /** - * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. - * @param message AttachedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** EffectiveIamPolicy policies. */ + public policies: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]; - /** - * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. - * @param message AttachedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveIamPolicy instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; - /** - * Decodes an AttachedResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedResource - * @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.asset.v1.AttachedResource; + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AttachedResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedResource - * @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.asset.v1.AttachedResource; + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AttachedResource 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); + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveIamPolicy + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; - /** - * Creates an AttachedResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AttachedResource; + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveIamPolicy + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; - /** - * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. - * @param message AttachedResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.AttachedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies an EffectiveIamPolicy 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); - /** - * Converts this AttachedResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates an EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveIamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @param message EffectiveIamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EffectiveIamPolicy { + + /** Properties of a PolicyInfo. */ + interface IPolicyInfo { + + /** PolicyInfo attachedResource */ + attachedResource?: (string|null); + + /** PolicyInfo policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents a PolicyInfo. */ + class PolicyInfo implements IPolicyInfo { + + /** + * Constructs a new PolicyInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo); + + /** PolicyInfo attachedResource. */ + public attachedResource: string; + + /** PolicyInfo policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyInfo instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyInfo + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyInfo + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Verifies a PolicyInfo 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 PolicyInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Creates a plain object from a PolicyInfo message. Also converts values to other types if specified. + * @param message PolicyInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } - /** Properties of a RelatedResources. */ - interface IRelatedResources { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** RelatedResources relatedResources */ - relatedResources?: (google.cloud.asset.v1.IRelatedResource[]|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); } - /** Represents a RelatedResources. */ - class RelatedResources implements IRelatedResources { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new RelatedResources. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedResources); + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - /** RelatedResources relatedResources. */ - public relatedResources: google.cloud.asset.v1.IRelatedResource[]; + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); /** - * Creates a new RelatedResources instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedResources instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedResources): google.cloud.asset.v1.RelatedResources; + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; /** - * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. - * @param message RelatedResources message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. - * @param message RelatedResources message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedResources message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedResources + * @returns TemporalAsset * @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.asset.v1.RelatedResources; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; /** - * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedResources + * @returns TemporalAsset * @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.asset.v1.RelatedResources; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; /** - * Verifies a RelatedResources message. + * Verifies a TemporalAsset 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 RelatedResources message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedResources + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResources; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; /** - * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. - * @param message RelatedResources + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedResources to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelatedResource. */ - interface IRelatedResource { + namespace TemporalAsset { - /** RelatedResource assetType */ - assetType?: (string|null); + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } - /** RelatedResource fullResourceName */ - fullResourceName?: (string|null); + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a RelatedResource. */ - class RelatedResource implements IRelatedResource { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new RelatedResource. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedResource); + constructor(properties?: google.cloud.asset.v1.ITimeWindow); - /** RelatedResource assetType. */ - public assetType: string; + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** RelatedResource fullResourceName. */ - public fullResourceName: string; + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new RelatedResource instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedResource instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedResource): google.cloud.asset.v1.RelatedResource; + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; /** - * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. - * @param message RelatedResource message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.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.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. - * @param message RelatedResource message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.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.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedResource message from the specified reader or buffer. + * 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 RelatedResource + * @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.asset.v1.RelatedResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; /** - * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedResource + * @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.asset.v1.RelatedResource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; /** - * Verifies a RelatedResource message. + * 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 RelatedResource message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedResource + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; /** - * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. - * @param message RelatedResource + * 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.asset.v1.RelatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedResource to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an IamPolicySearchResult. */ - interface IIamPolicySearchResult { + /** Properties of an Asset. */ + interface IAsset { - /** IamPolicySearchResult resource */ - resource?: (string|null); + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** IamPolicySearchResult assetType */ + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ assetType?: (string|null); - /** IamPolicySearchResult project */ - project?: (string|null); + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); - /** IamPolicySearchResult folders */ - folders?: (string[]|null); + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); - /** IamPolicySearchResult organization */ - organization?: (string|null); + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); - /** IamPolicySearchResult policy */ - policy?: (google.iam.v1.IPolicy|null); + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - /** IamPolicySearchResult explanation */ - explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory */ + osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset relatedAssets */ + relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + + /** Asset relatedAsset */ + relatedAsset?: (google.cloud.asset.v1.IRelatedAsset|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); } - /** Represents an IamPolicySearchResult. */ - class IamPolicySearchResult implements IIamPolicySearchResult { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new IamPolicySearchResult. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + constructor(properties?: google.cloud.asset.v1.IAsset); - /** IamPolicySearchResult resource. */ - public resource: string; + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** IamPolicySearchResult assetType. */ + /** Asset name. */ + public name: string; + + /** Asset assetType. */ public assetType: string; - /** IamPolicySearchResult project. */ - public project: string; + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); - /** IamPolicySearchResult folders. */ - public folders: string[]; + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); - /** IamPolicySearchResult organization. */ - public organization: string; + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; - /** IamPolicySearchResult policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - /** IamPolicySearchResult explanation. */ - public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory. */ + public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset relatedAssets. */ + public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + + /** Asset relatedAsset. */ + public relatedAsset?: (google.cloud.asset.v1.IRelatedAsset|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); /** - * Creates a new IamPolicySearchResult instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicySearchResult instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicySearchResult + * @returns Asset * @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.asset.v1.IamPolicySearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicySearchResult + * @returns Asset * @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.asset.v1.IamPolicySearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; /** - * Verifies an IamPolicySearchResult message. + * Verifies an Asset 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicySearchResult + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @param message IamPolicySearchResult + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicySearchResult to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace IamPolicySearchResult { + /** Properties of a Resource. */ + interface IResource { - /** Properties of an Explanation. */ - interface IExplanation { + /** Resource version */ + version?: (string|null); - /** Explanation matchedPermissions */ - matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); - } + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** Represents an Explanation. */ - class Explanation implements IExplanation { + /** Resource discoveryName */ + discoveryName?: (string|null); - /** - * Constructs a new Explanation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + /** Resource resourceUrl */ + resourceUrl?: (string|null); - /** Explanation matchedPermissions. */ - public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + /** Resource parent */ + parent?: (string|null); - /** - * Creates a new Explanation instance using the specified properties. - * @param [properties] Properties to set - * @returns Explanation instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + /** Resource data */ + data?: (google.protobuf.IStruct|null); - /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Resource location */ + location?: (string|null); + } - /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Resource. */ + class Resource implements IResource { - /** - * Decodes an Explanation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Explanation - * @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.asset.v1.IamPolicySearchResult.Explanation; + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); - /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Explanation - * @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.asset.v1.IamPolicySearchResult.Explanation; + /** Resource version. */ + public version: string; - /** - * Verifies an Explanation 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); + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** - * Creates an Explanation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Explanation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; - - /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. - * @param message Explanation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Explanation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Explanation { - - /** Properties of a Permissions. */ - interface IPermissions { - - /** Permissions permissions */ - permissions?: (string[]|null); - } - - /** Represents a Permissions. */ - class Permissions implements IPermissions { - - /** - * Constructs a new Permissions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); - - /** Permissions permissions. */ - public permissions: string[]; - - /** - * Creates a new Permissions instance using the specified properties. - * @param [properties] Properties to set - * @returns Permissions instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Permissions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Permissions - * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Permissions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @param message Permissions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Permissions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Properties of an IamPolicyAnalysisState. */ - interface IIamPolicyAnalysisState { - - /** IamPolicyAnalysisState code */ - code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); - - /** IamPolicyAnalysisState cause */ - cause?: (string|null); - } + /** Resource discoveryName. */ + public discoveryName: string; - /** Represents an IamPolicyAnalysisState. */ - class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + /** Resource resourceUrl. */ + public resourceUrl: string; - /** - * Constructs a new IamPolicyAnalysisState. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + /** Resource parent. */ + public parent: string; - /** IamPolicyAnalysisState code. */ - public code: (google.rpc.Code|keyof typeof google.rpc.Code); + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); - /** IamPolicyAnalysisState cause. */ - public cause: string; + /** Resource location. */ + public location: string; /** - * Creates a new IamPolicyAnalysisState instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicyAnalysisState instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; /** - * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @param message IamPolicyAnalysisState message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @param message IamPolicyAnalysisState message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisState + * @returns Resource * @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.asset.v1.IamPolicyAnalysisState; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisState + * @returns Resource * @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.asset.v1.IamPolicyAnalysisState; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; /** - * Verifies an IamPolicyAnalysisState message. + * Verifies a Resource 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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicyAnalysisState + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; /** - * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisState + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicyAnalysisState to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ConditionEvaluation. */ - interface IConditionEvaluation { + /** Properties of a RelatedAssets. */ + interface IRelatedAssets { - /** ConditionEvaluation evaluationValue */ - evaluationValue?: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null); + /** RelatedAssets relationshipAttributes */ + relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets */ + assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); } - /** Represents a ConditionEvaluation. */ - class ConditionEvaluation implements IConditionEvaluation { + /** Represents a RelatedAssets. */ + class RelatedAssets implements IRelatedAssets { /** - * Constructs a new ConditionEvaluation. + * Constructs a new RelatedAssets. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IConditionEvaluation); + constructor(properties?: google.cloud.asset.v1.IRelatedAssets); - /** ConditionEvaluation evaluationValue. */ - public evaluationValue: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue); + /** RelatedAssets relationshipAttributes. */ + public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets. */ + public assets: google.cloud.asset.v1.IRelatedAsset[]; /** - * Creates a new ConditionEvaluation instance using the specified properties. + * Creates a new RelatedAssets instance using the specified properties. * @param [properties] Properties to set - * @returns ConditionEvaluation instance + * @returns RelatedAssets instance */ - public static create(properties?: google.cloud.asset.v1.IConditionEvaluation): google.cloud.asset.v1.ConditionEvaluation; + public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; /** - * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. - * @param message ConditionEvaluation message or plain object to encode + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. - * @param message ConditionEvaluation message or plain object to encode + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ConditionEvaluation message from the specified reader or buffer. + * Decodes a RelatedAssets message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ConditionEvaluation + * @returns RelatedAssets * @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.asset.v1.ConditionEvaluation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedAssets; /** - * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ConditionEvaluation + * @returns RelatedAssets * @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.asset.v1.ConditionEvaluation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedAssets; /** - * Verifies a ConditionEvaluation message. + * Verifies a RelatedAssets 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 ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ConditionEvaluation + * @returns RelatedAssets */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ConditionEvaluation; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; /** - * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. - * @param message ConditionEvaluation - * @param [options] Conversion options + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @param message RelatedAssets + * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ConditionEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ConditionEvaluation to JSON. + * Converts this RelatedAssets to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ConditionEvaluation { - - /** EvaluationValue enum. */ - enum EvaluationValue { - EVALUATION_VALUE_UNSPECIFIED = 0, - TRUE = 1, - FALSE = 2, - CONDITIONAL = 3 - } - } - - /** Properties of an IamPolicyAnalysisResult. */ - interface IIamPolicyAnalysisResult { - - /** IamPolicyAnalysisResult attachedResourceFullName */ - attachedResourceFullName?: (string|null); + /** Properties of a RelationshipAttributes. */ + interface IRelationshipAttributes { - /** IamPolicyAnalysisResult iamBinding */ - iamBinding?: (google.iam.v1.IBinding|null); + /** RelationshipAttributes type */ + type?: (string|null); - /** IamPolicyAnalysisResult accessControlLists */ - accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + /** RelationshipAttributes sourceResourceType */ + sourceResourceType?: (string|null); - /** IamPolicyAnalysisResult identityList */ - identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + /** RelationshipAttributes targetResourceType */ + targetResourceType?: (string|null); - /** IamPolicyAnalysisResult fullyExplored */ - fullyExplored?: (boolean|null); + /** RelationshipAttributes action */ + action?: (string|null); } - /** Represents an IamPolicyAnalysisResult. */ - class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + /** Represents a RelationshipAttributes. */ + class RelationshipAttributes implements IRelationshipAttributes { /** - * Constructs a new IamPolicyAnalysisResult. + * Constructs a new RelationshipAttributes. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); - - /** IamPolicyAnalysisResult attachedResourceFullName. */ - public attachedResourceFullName: string; + constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); - /** IamPolicyAnalysisResult iamBinding. */ - public iamBinding?: (google.iam.v1.IBinding|null); + /** RelationshipAttributes type. */ + public type: string; - /** IamPolicyAnalysisResult accessControlLists. */ - public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + /** RelationshipAttributes sourceResourceType. */ + public sourceResourceType: string; - /** IamPolicyAnalysisResult identityList. */ - public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + /** RelationshipAttributes targetResourceType. */ + public targetResourceType: string; - /** IamPolicyAnalysisResult fullyExplored. */ - public fullyExplored: boolean; + /** RelationshipAttributes action. */ + public action: string; /** - * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * Creates a new RelationshipAttributes instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicyAnalysisResult instance + * @returns RelationshipAttributes instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; /** - * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @param message IamPolicyAnalysisResult message or plain object to encode + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @param message IamPolicyAnalysisResult message or plain object to encode + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * Decodes a RelationshipAttributes message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisResult + * @returns RelationshipAttributes * @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.asset.v1.IamPolicyAnalysisResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelationshipAttributes; /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisResult + * @returns RelationshipAttributes * @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.asset.v1.IamPolicyAnalysisResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelationshipAttributes; /** - * Verifies an IamPolicyAnalysisResult message. + * Verifies a RelationshipAttributes 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicyAnalysisResult + * @returns RelationshipAttributes */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; /** - * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisResult + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @param message RelationshipAttributes * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicyAnalysisResult to JSON. + * Converts this RelationshipAttributes to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace IamPolicyAnalysisResult { - - /** Properties of a Resource. */ - interface IResource { + /** Properties of a RelatedAsset. */ + interface IRelatedAsset { - /** Resource fullResourceName */ - fullResourceName?: (string|null); + /** RelatedAsset asset */ + asset?: (string|null); - /** Resource analysisState */ - analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - } + /** RelatedAsset assetType */ + assetType?: (string|null); - /** Represents a Resource. */ - class Resource implements IResource { + /** RelatedAsset ancestors */ + ancestors?: (string[]|null); - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + /** RelatedAsset relationshipType */ + relationshipType?: (string|null); + } - /** Resource fullResourceName. */ - public fullResourceName: string; + /** Represents a RelatedAsset. */ + class RelatedAsset implements IRelatedAsset { - /** Resource analysisState. */ - public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + /** + * Constructs a new RelatedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAsset); - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + /** RelatedAsset asset. */ + public asset: string; - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** RelatedAsset assetType. */ + public assetType: string; - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** RelatedAsset ancestors. */ + public ancestors: string[]; - /** - * Decodes a Resource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Resource - * @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.asset.v1.IamPolicyAnalysisResult.Resource; + /** RelatedAsset relationshipType. */ + public relationshipType: string; - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Resource - * @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.asset.v1.IamPolicyAnalysisResult.Resource; + /** + * Creates a new RelatedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAsset instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; - /** - * Verifies a Resource 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); + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Resource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAsset + * @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.asset.v1.RelatedAsset; - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAsset + * @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.asset.v1.RelatedAsset; - /** Properties of an Access. */ + /** + * Verifies a RelatedAsset 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 RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @param message RelatedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { + + /** ResourceSearchResult name */ + name?: (string|null); + + /** ResourceSearchResult assetType */ + assetType?: (string|null); + + /** ResourceSearchResult project */ + project?: (string|null); + + /** ResourceSearchResult folders */ + folders?: (string[]|null); + + /** ResourceSearchResult organization */ + organization?: (string|null); + + /** ResourceSearchResult displayName */ + displayName?: (string|null); + + /** ResourceSearchResult description */ + description?: (string|null); + + /** ResourceSearchResult location */ + location?: (string|null); + + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); + + /** ResourceSearchResult kmsKey */ + kmsKey?: (string|null); + + /** ResourceSearchResult createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state */ + state?: (string|null); + + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName */ + parentFullResourceName?: (string|null); + + /** ResourceSearchResult versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + + /** ResourceSearchResult attachedResources */ + attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); + + /** ResourceSearchResult relationships */ + relationships?: ({ [k: string]: google.cloud.asset.v1.IRelatedResources }|null); + + /** ResourceSearchResult tagKeys */ + tagKeys?: (string[]|null); + + /** ResourceSearchResult tagValues */ + tagValues?: (string[]|null); + + /** ResourceSearchResult tagValueIds */ + tagValueIds?: (string[]|null); + + /** ResourceSearchResult parentAssetType */ + parentAssetType?: (string|null); + } + + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { + + /** + * Constructs a new ResourceSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult folders. */ + public folders: string[]; + + /** ResourceSearchResult organization. */ + public organization: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult kmsKey. */ + public kmsKey: string; + + /** ResourceSearchResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state. */ + public state: string; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName. */ + public parentFullResourceName: string; + + /** ResourceSearchResult versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** ResourceSearchResult attachedResources. */ + public attachedResources: google.cloud.asset.v1.IAttachedResource[]; + + /** ResourceSearchResult relationships. */ + public relationships: { [k: string]: google.cloud.asset.v1.IRelatedResources }; + + /** ResourceSearchResult tagKeys. */ + public tagKeys: string[]; + + /** ResourceSearchResult tagValues. */ + public tagValues: string[]; + + /** ResourceSearchResult tagValueIds. */ + public tagValueIds: string[]; + + /** ResourceSearchResult parentAssetType. */ + public parentAssetType: string; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSearchResult + * @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.asset.v1.ResourceSearchResult; + + /** + * Verifies a ResourceSearchResult 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VersionedResource. */ + interface IVersionedResource { + + /** VersionedResource version */ + version?: (string|null); + + /** VersionedResource resource */ + resource?: (google.protobuf.IStruct|null); + } + + /** Represents a VersionedResource. */ + class VersionedResource implements IVersionedResource { + + /** + * Constructs a new VersionedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IVersionedResource); + + /** VersionedResource version. */ + public version: string; + + /** VersionedResource resource. */ + public resource?: (google.protobuf.IStruct|null); + + /** + * Creates a new VersionedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IVersionedResource): google.cloud.asset.v1.VersionedResource; + + /** + * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedResource + * @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.asset.v1.VersionedResource; + + /** + * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedResource + * @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.asset.v1.VersionedResource; + + /** + * Verifies a VersionedResource 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 VersionedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.VersionedResource; + + /** + * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. + * @param message VersionedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.VersionedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttachedResource. */ + interface IAttachedResource { + + /** AttachedResource assetType */ + assetType?: (string|null); + + /** AttachedResource versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + } + + /** Represents an AttachedResource. */ + class AttachedResource implements IAttachedResource { + + /** + * Constructs a new AttachedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAttachedResource); + + /** AttachedResource assetType. */ + public assetType: string; + + /** AttachedResource versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** + * Creates a new AttachedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IAttachedResource): google.cloud.asset.v1.AttachedResource; + + /** + * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedResource + * @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.asset.v1.AttachedResource; + + /** + * Decodes an AttachedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedResource + * @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.asset.v1.AttachedResource; + + /** + * Verifies an AttachedResource 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 AttachedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AttachedResource; + + /** + * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. + * @param message AttachedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AttachedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedResources. */ + interface IRelatedResources { + + /** RelatedResources relatedResources */ + relatedResources?: (google.cloud.asset.v1.IRelatedResource[]|null); + } + + /** Represents a RelatedResources. */ + class RelatedResources implements IRelatedResources { + + /** + * Constructs a new RelatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResources); + + /** RelatedResources relatedResources. */ + public relatedResources: google.cloud.asset.v1.IRelatedResource[]; + + /** + * Creates a new RelatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResources instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResources): google.cloud.asset.v1.RelatedResources; + + /** + * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResources + * @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.asset.v1.RelatedResources; + + /** + * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResources + * @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.asset.v1.RelatedResources; + + /** + * Verifies a RelatedResources 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 RelatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResources; + + /** + * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. + * @param message RelatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedResource. */ + interface IRelatedResource { + + /** RelatedResource assetType */ + assetType?: (string|null); + + /** RelatedResource fullResourceName */ + fullResourceName?: (string|null); + } + + /** Represents a RelatedResource. */ + class RelatedResource implements IRelatedResource { + + /** + * Constructs a new RelatedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResource); + + /** RelatedResource assetType. */ + public assetType: string; + + /** RelatedResource fullResourceName. */ + public fullResourceName: string; + + /** + * Creates a new RelatedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResource): google.cloud.asset.v1.RelatedResource; + + /** + * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResource + * @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.asset.v1.RelatedResource; + + /** + * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResource + * @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.asset.v1.RelatedResource; + + /** + * Verifies a RelatedResource 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 RelatedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResource; + + /** + * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. + * @param message RelatedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult assetType */ + assetType?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult folders */ + folders?: (string[]|null); + + /** IamPolicySearchResult organization */ + organization?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult assetType. */ + public assetType: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult folders. */ + public folders: string[]; + + /** IamPolicySearchResult organization. */ + public organization: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @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.asset.v1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @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.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Explanation { + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of an IamPolicyAnalysisState. */ + interface IIamPolicyAnalysisState { + + /** IamPolicyAnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** IamPolicyAnalysisState cause */ + cause?: (string|null); + } + + /** Represents an IamPolicyAnalysisState. */ + class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + + /** + * Constructs a new IamPolicyAnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + + /** IamPolicyAnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** IamPolicyAnalysisState cause. */ + public cause: string; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisState + * @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.asset.v1.IamPolicyAnalysisState; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisState + * @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.asset.v1.IamPolicyAnalysisState; + + /** + * Verifies an IamPolicyAnalysisState 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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConditionEvaluation. */ + interface IConditionEvaluation { + + /** ConditionEvaluation evaluationValue */ + evaluationValue?: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null); + } + + /** Represents a ConditionEvaluation. */ + class ConditionEvaluation implements IConditionEvaluation { + + /** + * Constructs a new ConditionEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IConditionEvaluation); + + /** ConditionEvaluation evaluationValue. */ + public evaluationValue: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue); + + /** + * Creates a new ConditionEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionEvaluation instance + */ + public static create(properties?: google.cloud.asset.v1.IConditionEvaluation): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionEvaluation + * @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.asset.v1.ConditionEvaluation; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionEvaluation + * @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.asset.v1.ConditionEvaluation; + + /** + * Verifies a ConditionEvaluation 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 ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. + * @param message ConditionEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ConditionEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ConditionEvaluation { + + /** EvaluationValue enum. */ + enum EvaluationValue { + EVALUATION_VALUE_UNSPECIFIED = 0, + TRUE = 1, + FALSE = 2, + CONDITIONAL = 3 + } + } + + /** Properties of an IamPolicyAnalysisResult. */ + interface IIamPolicyAnalysisResult { + + /** IamPolicyAnalysisResult attachedResourceFullName */ + attachedResourceFullName?: (string|null); + + /** IamPolicyAnalysisResult iamBinding */ + iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists */ + accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysisResult. */ + class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + + /** + * Constructs a new IamPolicyAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisResult + * @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.asset.v1.IamPolicyAnalysisResult; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisResult + * @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.asset.v1.IamPolicyAnalysisResult; + + /** + * Verifies an IamPolicyAnalysisResult 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @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.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @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.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Verifies a Resource 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 Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Access. */ interface IAccess { /** Access role */ @@ -17601,1037 +18963,1345 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a ServiceOptions. */ - interface IServiceOptions { + /** 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); - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); } - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { /** - * Constructs a new ServiceOptions. + * Constructs a new UninterpretedOption. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceOptions); + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** 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 ServiceOptions instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceOptions instance + * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * 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.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUninterpretedOption, 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 + * 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.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * 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 ServiceOptions + * @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.ServiceOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceOptions + * @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.ServiceOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; /** - * Verifies a ServiceOptions message. + * 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 a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceOptions + * @returns UninterpretedOption */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions + * 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.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceOptions to JSON. + * Converts this UninterpretedOption to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MethodOptions. */ - interface IMethodOptions { + namespace UninterpretedOption { - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** Properties of a NamePart. */ + interface INamePart { - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** NamePart namePart */ + namePart: string; - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** NamePart isExtension */ + isExtension: boolean; + } - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** Represents a NamePart. */ + class NamePart implements INamePart { - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + /** 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 }; + } } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { /** - * Constructs a new MethodOptions. + * Constructs a new SourceCodeInfo. * @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); + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns MethodOptions instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * 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.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, 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 + * 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.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * 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 MethodOptions + * @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.MethodOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodOptions + * @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.MethodOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a MethodOptions message. + * 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodOptions + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions + * 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.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodOptions to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace MethodOptions { + namespace SourceCodeInfo { - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 + /** 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); } - } - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** Represents a Location. */ + class Location implements ILocation { - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** Location path. */ + public path: number[]; - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** Location span. */ + public span: number[]; - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** Location leadingComments. */ + public leadingComments: string; - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** Location trailingComments. */ + public trailingComments: string; - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } + /** + * 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; - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** + * 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; - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); + /** + * 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; - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** + * 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; - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** + * 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; - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** + * 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); - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** + * 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; - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** + * 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 }; - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { /** - * Creates a new UninterpretedOption instance using the specified properties. + * Constructs a new GeneratedCodeInfo. * @param [properties] Properties to set - * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * 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.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, 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 + * 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.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * 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 UninterpretedOption + * @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.UninterpretedOption; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UninterpretedOption + * @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.UninterpretedOption; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies an UninterpretedOption message. + * 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 an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UninterpretedOption + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption + * 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.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UninterpretedOption to JSON. + * Converts this GeneratedCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace UninterpretedOption { + namespace GeneratedCodeInfo { - /** Properties of a NamePart. */ - interface INamePart { + /** Properties of an Annotation. */ + interface IAnnotation { - /** NamePart namePart */ - namePart: string; + /** Annotation path */ + path?: (number[]|null); - /** NamePart isExtension */ - isExtension: boolean; + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); } - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** Represents an Annotation. */ + class Annotation implements IAnnotation { /** - * Constructs a new NamePart. + * Constructs a new Annotation. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; - /** NamePart namePart. */ - public namePart: string; + /** Annotation begin. */ + public begin: number; - /** NamePart isExtension. */ - public isExtension: boolean; + /** Annotation end. */ + public end: number; /** - * Creates a new NamePart instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set - * @returns NamePart instance + * @returns Annotation instance */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; /** - * 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 + * 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.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, 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 + * 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.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NamePart message from the specified reader or buffer. + * 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 NamePart + * @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.UninterpretedOption.NamePart; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NamePart + * @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.UninterpretedOption.NamePart; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Verifies a NamePart message. + * 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 a NamePart message from a plain object. Also converts values to their respective internal types. + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NamePart + * @returns Annotation */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart + * 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.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NamePart to JSON. + * Converts this Annotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new SourceCodeInfo. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * 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.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, 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 + * 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.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * 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 SourceCodeInfo + * @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.SourceCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @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.SourceCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies a SourceCodeInfo message. + * 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 a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * 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.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this Empty 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 { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** Location path. */ - public path: number[]; + /** Timestamp nanos */ + nanos?: (number|null); + } - /** Location span. */ - public span: number[]; + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { - /** Location leadingComments. */ - public leadingComments: string; + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); - /** Location trailingComments. */ - public trailingComments: string; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** Timestamp nanos. */ + public nanos: number; - /** - * 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; + /** + * 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 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 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 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; + /** + * 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 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 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 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; + /** + * 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 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); + /** + * 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 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 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 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 }; + /** + * 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 Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** Properties of a Struct. */ + interface IStruct { - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Represents a Struct. */ + class Struct implements IStruct { /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new Struct. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + constructor(properties?: google.protobuf.IStruct); - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new Struct instance using the specified properties. * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance + * @returns Struct instance */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct 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; + public static encode(message: google.protobuf.IStruct, 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 + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct 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; + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a Struct message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo + * @returns Struct * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a Struct message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo + * @returns Struct * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; /** - * Verifies a GeneratedCodeInfo message. + * Verifies a Struct 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. + * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GeneratedCodeInfo + * @returns Struct */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this Struct 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[]; + /** Properties of a Value. */ + interface IValue { - /** Annotation sourceFile. */ - public sourceFile: string; + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** Annotation begin. */ - public begin: number; + /** Value numberValue */ + numberValue?: (number|null); - /** Annotation end. */ - public end: number; + /** Value stringValue */ + stringValue?: (string|null); - /** - * 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; + /** Value boolValue */ + boolValue?: (boolean|null); - /** - * 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; + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); - /** - * 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; + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } - /** - * 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; + /** Represents a Value. */ + class Value implements IValue { - /** - * 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; + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); - /** - * 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); + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|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; + /** Value numberValue. */ + public numberValue?: (number|null); - /** - * 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 }; + /** Value stringValue. */ + public stringValue?: (string|null); - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Value boolValue. */ + public boolValue?: (boolean|null); - /** Properties of an Empty. */ - interface IEmpty { - } + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); /** - * Creates a new Empty instance using the specified properties. + * Creates a new Value instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns Value instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value 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; + public static encode(message: google.protobuf.IValue, 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 + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value 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; + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Empty + * @returns Value * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @returns Value * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; /** - * Verifies an Empty message. + * Verifies a Value 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. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns Value */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Timestamp. */ - interface ITimestamp { + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** Properties of a ListValue. */ + interface IListValue { - /** Timestamp nanos */ - nanos?: (number|null); + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents a ListValue. */ + class ListValue implements IListValue { /** - * Constructs a new Timestamp. + * Constructs a new ListValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); + constructor(properties?: google.protobuf.IListValue); - /** Timestamp nanos. */ - public nanos: number; + /** ListValue values. */ + public values: google.protobuf.IValue[]; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new ListValue instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns ListValue instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue 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; + public static encode(message: google.protobuf.IListValue, 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 + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue 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; + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Timestamp + * @returns ListValue * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @returns ListValue * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; /** - * Verifies a Timestamp message. + * Verifies a ListValue 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. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns ListValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this ListValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -18733,495 +20403,401 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @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.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @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.Struct; - - /** - * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); + /** Properties of a Duration. */ + interface IDuration { - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); + /** Duration seconds */ + seconds?: (number|Long|string|null); - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); + /** Duration nanos */ + nanos?: (number|null); } - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); + /** Represents a Duration. */ + class Duration implements IDuration { - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); + /** Duration seconds. */ + public seconds: (number|Long|string); - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + /** Duration nanos. */ + public nanos: number; /** - * Creates a new Value instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns Value instance + * @returns Duration instance */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * 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.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * 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.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Value message from the specified reader or buffer. + * 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 Value + * @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.Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Value + * @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.Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies a Value message. + * 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 Value message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Value + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value + * 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.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Value to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { + /** Properties of a FieldMask. */ + interface IFieldMask { - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents a ListValue. */ - class ListValue implements IListValue { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new ListValue. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IListValue); + constructor(properties?: google.protobuf.IFieldMask); - /** ListValue values. */ - public values: google.protobuf.IValue[]; + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new ListValue instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns ListValue instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode + * 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.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode + * 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.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListValue message from the specified reader or buffer. + * 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 ListValue + * @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.ListValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListValue + * @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.ListValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies a ListValue message. + * 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 ListValue message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListValue + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue + * 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.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListValue to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a Duration. */ - interface IDuration { + /** Namespace type. */ + namespace type { - /** Duration seconds */ - seconds?: (number|Long|string|null); + /** Properties of a Date. */ + interface IDate { - /** Duration nanos */ - nanos?: (number|null); + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents a Date. */ + class Date implements IDate { /** - * Constructs a new Duration. + * Constructs a new Date. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.type.IDate); - /** Duration seconds. */ - public seconds: (number|Long|string); + /** Date year. */ + public year: number; - /** Duration nanos. */ - public nanos: number; + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Date instance using the specified properties. * @param [properties] Properties to set - * @returns Duration instance + * @returns Date instance */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + public static create(properties?: google.type.IDate): google.type.Date; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date 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; + public static encode(message: google.type.IDate, 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 + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date 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; + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a Date message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Duration + * @returns Date * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Date message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Duration + * @returns Date * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; /** - * Verifies a Duration message. + * Verifies a Date 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. + * Creates a Date message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns Date */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.type.Date; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this Date to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FieldMask. */ - interface IFieldMask { + /** Properties of an Expr. */ + interface IExpr { - /** FieldMask paths */ - paths?: (string[]|null); + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); } - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + /** Represents an Expr. */ + class Expr implements IExpr { /** - * Constructs a new FieldMask. + * Constructs a new Expr. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFieldMask); + constructor(properties?: google.type.IExpr); - /** FieldMask paths. */ - public paths: string[]; + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new Expr instance using the specified properties. * @param [properties] Properties to set - * @returns FieldMask instance + * @returns Expr instance */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + public static create(properties?: google.type.IExpr): google.type.Expr; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr 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; + public static encode(message: google.type.IExpr, 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 + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr 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; + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes an Expr message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldMask + * @returns Expr * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes an Expr message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldMask + * @returns Expr * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; /** - * Verifies a FieldMask message. + * Verifies an Expr 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. + * Creates an Expr message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns Expr */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.type.Expr; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this Expr to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -19772,220 +21348,6 @@ export namespace google { } } - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @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.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @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.type.Expr; - - /** - * Verifies an Expr 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 Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Date. */ - interface IDate { - - /** Date year */ - year?: (number|null); - - /** Date month */ - month?: (number|null); - - /** Date day */ - day?: (number|null); - } - - /** Represents a Date. */ - class Date implements IDate { - - /** - * Constructs a new Date. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IDate); - - /** Date year. */ - public year: number; - - /** Date month. */ - public month: number; - - /** Date day. */ - public day: number; - - /** - * Creates a new Date instance using the specified properties. - * @param [properties] Properties to set - * @returns Date instance - */ - public static create(properties?: google.type.IDate): google.type.Date; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Date message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Date - * @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.type.Date; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Date - * @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.type.Date; - - /** - * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Date - */ - public static fromObject(object: { [k: string]: any }): google.type.Date; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @param message Date - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Date to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - /** Namespace identity. */ namespace identity { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index e75ccb1fe2c..db3d462a048 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -527,6 +527,204 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef CreateSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls CreateSavedQuery. + * @function createSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} request CreateSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.CreateSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createSavedQuery = function createSavedQuery(request, callback) { + return this.rpcCall(createSavedQuery, $root.google.cloud.asset.v1.CreateSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "CreateSavedQuery" }); + + /** + * Calls CreateSavedQuery. + * @function createSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} request CreateSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#getSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef GetSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls GetSavedQuery. + * @function getSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} request GetSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.GetSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getSavedQuery = function getSavedQuery(request, callback) { + return this.rpcCall(getSavedQuery, $root.google.cloud.asset.v1.GetSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "GetSavedQuery" }); + + /** + * Calls GetSavedQuery. + * @function getSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} request GetSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listSavedQueries}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListSavedQueriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListSavedQueriesResponse} [response] ListSavedQueriesResponse + */ + + /** + * Calls ListSavedQueries. + * @function listSavedQueries + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} request ListSavedQueriesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListSavedQueriesCallback} callback Node-style callback called with the error, if any, and ListSavedQueriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listSavedQueries = function listSavedQueries(request, callback) { + return this.rpcCall(listSavedQueries, $root.google.cloud.asset.v1.ListSavedQueriesRequest, $root.google.cloud.asset.v1.ListSavedQueriesResponse, request, callback); + }, "name", { value: "ListSavedQueries" }); + + /** + * Calls ListSavedQueries. + * @function listSavedQueries + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} request ListSavedQueriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef UpdateSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls UpdateSavedQuery. + * @function updateSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} request UpdateSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.UpdateSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateSavedQuery = function updateSavedQuery(request, callback) { + return this.rpcCall(updateSavedQuery, $root.google.cloud.asset.v1.UpdateSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "UpdateSavedQuery" }); + + /** + * Calls UpdateSavedQuery. + * @function updateSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} request UpdateSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef DeleteSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSavedQuery. + * @function deleteSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} request DeleteSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.DeleteSavedQueryCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteSavedQuery = function deleteSavedQuery(request, callback) { + return this.rpcCall(deleteSavedQuery, $root.google.cloud.asset.v1.DeleteSavedQueryRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSavedQuery" }); + + /** + * Calls DeleteSavedQuery. + * @function deleteSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} request DeleteSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetEffectiveIamPolicies}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef BatchGetEffectiveIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} [response] BatchGetEffectiveIamPoliciesResponse + */ + + /** + * Calls BatchGetEffectiveIamPolicies. + * @function batchGetEffectiveIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} request BatchGetEffectiveIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPoliciesCallback} callback Node-style callback called with the error, if any, and BatchGetEffectiveIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetEffectiveIamPolicies = function batchGetEffectiveIamPolicies(request, callback) { + return this.rpcCall(batchGetEffectiveIamPolicies, $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, request, callback); + }, "name", { value: "BatchGetEffectiveIamPolicies" }); + + /** + * Calls BatchGetEffectiveIamPolicies. + * @function batchGetEffectiveIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} request BatchGetEffectiveIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); @@ -8576,6 +8774,7 @@ * @memberof google.cloud.asset.v1 * @interface IAnalyzeIamPolicyRequest * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {string|null} [savedAnalysisQuery] AnalyzeIamPolicyRequest savedAnalysisQuery * @property {google.protobuf.IDuration|null} [executionTimeout] AnalyzeIamPolicyRequest executionTimeout */ @@ -8602,6 +8801,14 @@ */ AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + /** + * AnalyzeIamPolicyRequest savedAnalysisQuery. + * @member {string} savedAnalysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.savedAnalysisQuery = ""; + /** * AnalyzeIamPolicyRequest executionTimeout. * @member {google.protobuf.IDuration|null|undefined} executionTimeout @@ -8638,6 +8845,8 @@ $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedAnalysisQuery != null && Object.hasOwnProperty.call(message, "savedAnalysisQuery")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedAnalysisQuery); return writer; }; @@ -8675,6 +8884,9 @@ case 1: message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); break; + case 3: + message.savedAnalysisQuery = reader.string(); + break; case 2: message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; @@ -8718,6 +8930,9 @@ if (error) return "analysisQuery." + error; } + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + if (!$util.isString(message.savedAnalysisQuery)) + return "savedAnalysisQuery: string expected"; if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { var error = $root.google.protobuf.Duration.verify(message.executionTimeout); if (error) @@ -8743,6 +8958,8 @@ throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); } + if (object.savedAnalysisQuery != null) + message.savedAnalysisQuery = String(object.savedAnalysisQuery); if (object.executionTimeout != null) { if (typeof object.executionTimeout !== "object") throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.executionTimeout: object expected"); @@ -8767,11 +8984,14 @@ if (options.defaults) { object.analysisQuery = null; object.executionTimeout = null; + object.savedAnalysisQuery = ""; } if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + object.savedAnalysisQuery = message.savedAnalysisQuery; return object; }; @@ -10071,6 +10291,7 @@ * @memberof google.cloud.asset.v1 * @interface IAnalyzeIamPolicyLongrunningRequest * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyLongrunningRequest analysisQuery + * @property {string|null} [savedAnalysisQuery] AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery * @property {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] AnalyzeIamPolicyLongrunningRequest outputConfig */ @@ -10097,6 +10318,14 @@ */ AnalyzeIamPolicyLongrunningRequest.prototype.analysisQuery = null; + /** + * AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery. + * @member {string} savedAnalysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.savedAnalysisQuery = ""; + /** * AnalyzeIamPolicyLongrunningRequest outputConfig. * @member {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig @@ -10133,6 +10362,8 @@ $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedAnalysisQuery != null && Object.hasOwnProperty.call(message, "savedAnalysisQuery")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedAnalysisQuery); return writer; }; @@ -10170,6 +10401,9 @@ case 1: message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); break; + case 3: + message.savedAnalysisQuery = reader.string(); + break; case 2: message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); break; @@ -10213,6 +10447,9 @@ if (error) return "analysisQuery." + error; } + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + if (!$util.isString(message.savedAnalysisQuery)) + return "savedAnalysisQuery: string expected"; if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); if (error) @@ -10238,6 +10475,8 @@ throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.analysisQuery: object expected"); message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); } + if (object.savedAnalysisQuery != null) + message.savedAnalysisQuery = String(object.savedAnalysisQuery); if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.outputConfig: object expected"); @@ -10262,11 +10501,14 @@ if (options.defaults) { object.analysisQuery = null; object.outputConfig = null; + object.savedAnalysisQuery = ""; } if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + object.savedAnalysisQuery = message.savedAnalysisQuery; return object; }; @@ -10444,26 +10686,32 @@ return AnalyzeIamPolicyLongrunningResponse; })(); - v1.AnalyzeMoveRequest = (function() { + v1.SavedQuery = (function() { /** - * Properties of an AnalyzeMoveRequest. + * Properties of a SavedQuery. * @memberof google.cloud.asset.v1 - * @interface IAnalyzeMoveRequest - * @property {string|null} [resource] AnalyzeMoveRequest resource - * @property {string|null} [destinationParent] AnalyzeMoveRequest destinationParent - * @property {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null} [view] AnalyzeMoveRequest view + * @interface ISavedQuery + * @property {string|null} [name] SavedQuery name + * @property {string|null} [description] SavedQuery description + * @property {google.protobuf.ITimestamp|null} [createTime] SavedQuery createTime + * @property {string|null} [creator] SavedQuery creator + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] SavedQuery lastUpdateTime + * @property {string|null} [lastUpdater] SavedQuery lastUpdater + * @property {Object.|null} [labels] SavedQuery labels + * @property {google.cloud.asset.v1.SavedQuery.IQueryContent|null} [content] SavedQuery content */ /** - * Constructs a new AnalyzeMoveRequest. + * Constructs a new SavedQuery. * @memberof google.cloud.asset.v1 - * @classdesc Represents an AnalyzeMoveRequest. - * @implements IAnalyzeMoveRequest + * @classdesc Represents a SavedQuery. + * @implements ISavedQuery * @constructor - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.ISavedQuery=} [properties] Properties to set */ - function AnalyzeMoveRequest(properties) { + function SavedQuery(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10471,101 +10719,186 @@ } /** - * AnalyzeMoveRequest resource. - * @member {string} resource - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * SavedQuery name. + * @member {string} name + * @memberof google.cloud.asset.v1.SavedQuery * @instance */ - AnalyzeMoveRequest.prototype.resource = ""; + SavedQuery.prototype.name = ""; /** - * AnalyzeMoveRequest destinationParent. - * @member {string} destinationParent - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * SavedQuery description. + * @member {string} description + * @memberof google.cloud.asset.v1.SavedQuery * @instance */ - AnalyzeMoveRequest.prototype.destinationParent = ""; + SavedQuery.prototype.description = ""; /** - * AnalyzeMoveRequest view. - * @member {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} view - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * SavedQuery createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.SavedQuery * @instance */ - AnalyzeMoveRequest.prototype.view = 0; + SavedQuery.prototype.createTime = null; /** - * Creates a new AnalyzeMoveRequest instance using the specified properties. + * SavedQuery creator. + * @member {string} creator + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.creator = ""; + + /** + * SavedQuery lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.lastUpdateTime = null; + + /** + * SavedQuery lastUpdater. + * @member {string} lastUpdater + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.lastUpdater = ""; + + /** + * SavedQuery labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.labels = $util.emptyObject; + + /** + * SavedQuery content. + * @member {google.cloud.asset.v1.SavedQuery.IQueryContent|null|undefined} content + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.content = null; + + /** + * Creates a new SavedQuery instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest instance + * @param {google.cloud.asset.v1.ISavedQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery instance */ - AnalyzeMoveRequest.create = function create(properties) { - return new AnalyzeMoveRequest(properties); + SavedQuery.create = function create(properties) { + return new SavedQuery(properties); }; /** - * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * Encodes the specified SavedQuery message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {google.cloud.asset.v1.ISavedQuery} message SavedQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeMoveRequest.encode = function encode(message, writer) { + SavedQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastUpdater != null && Object.hasOwnProperty.call(message, "lastUpdater")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastUpdater); + 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.asset.v1.SavedQuery.QueryContent.encode(message.content, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * Encodes the specified SavedQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {google.cloud.asset.v1.ISavedQuery} message SavedQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + SavedQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * Decodes a SavedQuery message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeMoveRequest.decode = function decode(reader, length) { + SavedQuery.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.asset.v1.AnalyzeMoveRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SavedQuery(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resource = reader.string(); + message.name = reader.string(); break; case 2: - message.destinationParent = reader.string(); + message.description = reader.string(); break; case 3: - message.view = reader.int32(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.creator = reader.string(); + break; + case 5: + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.lastUpdater = reader.string(); + break; + case 7: + 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 8: + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10576,237 +10909,2066 @@ }; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * Decodes a SavedQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeMoveRequest.decodeDelimited = function decodeDelimited(reader) { + SavedQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeMoveRequest message. + * Verifies a SavedQuery message. * @function verify - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeMoveRequest.verify = function verify(message) { + SavedQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) - if (!$util.isString(message.destinationParent)) - return "destinationParent: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.lastUpdater != null && message.hasOwnProperty("lastUpdater")) + if (!$util.isString(message.lastUpdater)) + return "lastUpdater: 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.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.asset.v1.SavedQuery.QueryContent.verify(message.content); + if (error) + return "content." + error; + } return null; }; /** - * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SavedQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery */ - AnalyzeMoveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveRequest) + SavedQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SavedQuery) return object; - var message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.destinationParent != null) - message.destinationParent = String(object.destinationParent); - switch (object.view) { - case "ANALYSIS_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "FULL": - case 1: - message.view = 1; - break; - case "BASIC": - case 2: - message.view = 2; - break; + var message = new $root.google.cloud.asset.v1.SavedQuery(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.lastUpdater != null) + message.lastUpdater = String(object.lastUpdater); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.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.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.content: object expected"); + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.fromObject(object.content); } return message; }; /** - * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * Creates a plain object from a SavedQuery message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.AnalyzeMoveRequest} message AnalyzeMoveRequest + * @param {google.cloud.asset.v1.SavedQuery} message SavedQuery * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeMoveRequest.toObject = function toObject(message, options) { + SavedQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.resource = ""; - object.destinationParent = ""; - object.view = options.enums === String ? "ANALYSIS_VIEW_UNSPECIFIED" : 0; + object.name = ""; + object.description = ""; + object.createTime = null; + object.creator = ""; + object.lastUpdateTime = null; + object.lastUpdater = ""; + object.content = null; } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) - object.destinationParent = message.destinationParent; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.lastUpdater != null && message.hasOwnProperty("lastUpdater")) + object.lastUpdater = message.lastUpdater; + 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.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.toObject(message.content, options); return object; }; /** - * Converts this AnalyzeMoveRequest to JSON. + * Converts this SavedQuery to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @instance * @returns {Object.} JSON object */ - AnalyzeMoveRequest.prototype.toJSON = function toJSON() { + SavedQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * AnalysisView enum. - * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView - * @enum {number} - * @property {number} ANALYSIS_VIEW_UNSPECIFIED=0 ANALYSIS_VIEW_UNSPECIFIED value - * @property {number} FULL=1 FULL value - * @property {number} BASIC=2 BASIC value - */ - AnalyzeMoveRequest.AnalysisView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ANALYSIS_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULL"] = 1; - values[valuesById[2] = "BASIC"] = 2; - return values; - })(); + SavedQuery.QueryContent = (function() { - return AnalyzeMoveRequest; - })(); + /** + * Properties of a QueryContent. + * @memberof google.cloud.asset.v1.SavedQuery + * @interface IQueryContent + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [iamPolicyAnalysisQuery] QueryContent iamPolicyAnalysisQuery + */ - v1.AnalyzeMoveResponse = (function() { + /** + * Constructs a new QueryContent. + * @memberof google.cloud.asset.v1.SavedQuery + * @classdesc Represents a QueryContent. + * @implements IQueryContent + * @constructor + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent=} [properties] Properties to set + */ + function QueryContent(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 AnalyzeMoveResponse. - * @memberof google.cloud.asset.v1 - * @interface IAnalyzeMoveResponse - * @property {Array.|null} [moveAnalysis] AnalyzeMoveResponse moveAnalysis - */ + /** + * QueryContent iamPolicyAnalysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} iamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + */ + QueryContent.prototype.iamPolicyAnalysisQuery = null; - /** - * Constructs a new AnalyzeMoveResponse. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an AnalyzeMoveResponse. - * @implements IAnalyzeMoveResponse - * @constructor - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set - */ - function AnalyzeMoveResponse(properties) { - this.moveAnalysis = []; - 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]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * AnalyzeMoveResponse moveAnalysis. - * @member {Array.} moveAnalysis - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @instance - */ - AnalyzeMoveResponse.prototype.moveAnalysis = $util.emptyArray; + /** + * QueryContent queryContent. + * @member {"iamPolicyAnalysisQuery"|undefined} queryContent + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + */ + Object.defineProperty(QueryContent.prototype, "queryContent", { + get: $util.oneOfGetter($oneOfFields = ["iamPolicyAnalysisQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new AnalyzeMoveResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse instance - */ - AnalyzeMoveResponse.create = function create(properties) { - return new AnalyzeMoveResponse(properties); - }; + /** + * Creates a new QueryContent instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent instance + */ + QueryContent.create = function create(properties) { + return new QueryContent(properties); + }; - /** - * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnalyzeMoveResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.moveAnalysis != null && message.moveAnalysis.length) - for (var i = 0; i < message.moveAnalysis.length; ++i) - $root.google.cloud.asset.v1.MoveAnalysis.encode(message.moveAnalysis[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified QueryContent message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent} message QueryContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iamPolicyAnalysisQuery != null && Object.hasOwnProperty.call(message, "iamPolicyAnalysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.iamPolicyAnalysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnalyzeMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified QueryContent message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent} message QueryContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AnalyzeMoveResponse.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.asset.v1.AnalyzeMoveResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.moveAnalysis && message.moveAnalysis.length)) - message.moveAnalysis = []; + /** + * Decodes a QueryContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryContent.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.asset.v1.SavedQuery.QueryContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryContent message. + * @function verify + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.iamPolicyAnalysisQuery != null && message.hasOwnProperty("iamPolicyAnalysisQuery")) { + properties.queryContent = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.iamPolicyAnalysisQuery); + if (error) + return "iamPolicyAnalysisQuery." + error; + } + } + return null; + }; + + /** + * Creates a QueryContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + */ + QueryContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SavedQuery.QueryContent) + return object; + var message = new $root.google.cloud.asset.v1.SavedQuery.QueryContent(); + if (object.iamPolicyAnalysisQuery != null) { + if (typeof object.iamPolicyAnalysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.QueryContent.iamPolicyAnalysisQuery: object expected"); + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.iamPolicyAnalysisQuery); + } + return message; + }; + + /** + * Creates a plain object from a QueryContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.QueryContent} message QueryContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.iamPolicyAnalysisQuery != null && message.hasOwnProperty("iamPolicyAnalysisQuery")) { + object.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.iamPolicyAnalysisQuery, options); + if (options.oneofs) + object.queryContent = "iamPolicyAnalysisQuery"; + } + return object; + }; + + /** + * Converts this QueryContent to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + * @returns {Object.} JSON object + */ + QueryContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryContent; + })(); + + return SavedQuery; + })(); + + v1.CreateSavedQueryRequest = (function() { + + /** + * Properties of a CreateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface ICreateSavedQueryRequest + * @property {string|null} [parent] CreateSavedQueryRequest parent + * @property {google.cloud.asset.v1.ISavedQuery|null} [savedQuery] CreateSavedQueryRequest savedQuery + * @property {string|null} [savedQueryId] CreateSavedQueryRequest savedQueryId + */ + + /** + * Constructs a new CreateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a CreateSavedQueryRequest. + * @implements ICreateSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest=} [properties] Properties to set + */ + function CreateSavedQueryRequest(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]]; + } + + /** + * CreateSavedQueryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.parent = ""; + + /** + * CreateSavedQueryRequest savedQuery. + * @member {google.cloud.asset.v1.ISavedQuery|null|undefined} savedQuery + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.savedQuery = null; + + /** + * CreateSavedQueryRequest savedQueryId. + * @member {string} savedQueryId + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.savedQueryId = ""; + + /** + * Creates a new CreateSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest instance + */ + CreateSavedQueryRequest.create = function create(properties) { + return new CreateSavedQueryRequest(properties); + }; + + /** + * Encodes the specified CreateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} message CreateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSavedQueryRequest.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.savedQuery != null && Object.hasOwnProperty.call(message, "savedQuery")) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedQueryId != null && Object.hasOwnProperty.call(message, "savedQueryId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedQueryId); + return writer; + }; + + /** + * Encodes the specified CreateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} message CreateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSavedQueryRequest.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.asset.v1.CreateSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + case 3: + message.savedQueryId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSavedQueryRequest.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.savedQuery != null && message.hasOwnProperty("savedQuery")) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQuery); + if (error) + return "savedQuery." + error; + } + if (message.savedQueryId != null && message.hasOwnProperty("savedQueryId")) + if (!$util.isString(message.savedQueryId)) + return "savedQueryId: string expected"; + return null; + }; + + /** + * Creates a CreateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + */ + CreateSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.CreateSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.CreateSavedQueryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.savedQuery != null) { + if (typeof object.savedQuery !== "object") + throw TypeError(".google.cloud.asset.v1.CreateSavedQueryRequest.savedQuery: object expected"); + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQuery); + } + if (object.savedQueryId != null) + message.savedQueryId = String(object.savedQueryId); + return message; + }; + + /** + * Creates a plain object from a CreateSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.CreateSavedQueryRequest} message CreateSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.savedQuery = null; + object.savedQueryId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) + object.savedQuery = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQuery, options); + if (message.savedQueryId != null && message.hasOwnProperty("savedQueryId")) + object.savedQueryId = message.savedQueryId; + return object; + }; + + /** + * Converts this CreateSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSavedQueryRequest; + })(); + + v1.GetSavedQueryRequest = (function() { + + /** + * Properties of a GetSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IGetSavedQueryRequest + * @property {string|null} [name] GetSavedQueryRequest name + */ + + /** + * Constructs a new GetSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GetSavedQueryRequest. + * @implements IGetSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IGetSavedQueryRequest=} [properties] Properties to set + */ + function GetSavedQueryRequest(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]]; + } + + /** + * GetSavedQueryRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @instance + */ + GetSavedQueryRequest.prototype.name = ""; + + /** + * Creates a new GetSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest instance + */ + GetSavedQueryRequest.create = function create(properties) { + return new GetSavedQueryRequest(properties); + }; + + /** + * Encodes the specified GetSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} message GetSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSavedQueryRequest.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 GetSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} message GetSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSavedQueryRequest.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.asset.v1.GetSavedQueryRequest(); + 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 GetSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSavedQueryRequest.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 GetSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + */ + GetSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GetSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.GetSavedQueryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.GetSavedQueryRequest} message GetSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSavedQueryRequest.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 GetSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + GetSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSavedQueryRequest; + })(); + + v1.ListSavedQueriesRequest = (function() { + + /** + * Properties of a ListSavedQueriesRequest. + * @memberof google.cloud.asset.v1 + * @interface IListSavedQueriesRequest + * @property {string|null} [parent] ListSavedQueriesRequest parent + * @property {string|null} [filter] ListSavedQueriesRequest filter + * @property {number|null} [pageSize] ListSavedQueriesRequest pageSize + * @property {string|null} [pageToken] ListSavedQueriesRequest pageToken + */ + + /** + * Constructs a new ListSavedQueriesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListSavedQueriesRequest. + * @implements IListSavedQueriesRequest + * @constructor + * @param {google.cloud.asset.v1.IListSavedQueriesRequest=} [properties] Properties to set + */ + function ListSavedQueriesRequest(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]]; + } + + /** + * ListSavedQueriesRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.parent = ""; + + /** + * ListSavedQueriesRequest filter. + * @member {string} filter + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.filter = ""; + + /** + * ListSavedQueriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.pageSize = 0; + + /** + * ListSavedQueriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSavedQueriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest instance + */ + ListSavedQueriesRequest.create = function create(properties) { + return new ListSavedQueriesRequest(properties); + }; + + /** + * Encodes the specified ListSavedQueriesRequest message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} message ListSavedQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesRequest.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 ListSavedQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} message ListSavedQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesRequest.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.asset.v1.ListSavedQueriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 4: + 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 ListSavedQueriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSavedQueriesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSavedQueriesRequest.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.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 ListSavedQueriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + */ + ListSavedQueriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListSavedQueriesRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListSavedQueriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListSavedQueriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.ListSavedQueriesRequest} message ListSavedQueriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSavedQueriesRequest.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 ListSavedQueriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSavedQueriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSavedQueriesRequest; + })(); + + v1.ListSavedQueriesResponse = (function() { + + /** + * Properties of a ListSavedQueriesResponse. + * @memberof google.cloud.asset.v1 + * @interface IListSavedQueriesResponse + * @property {Array.|null} [savedQueries] ListSavedQueriesResponse savedQueries + * @property {string|null} [nextPageToken] ListSavedQueriesResponse nextPageToken + */ + + /** + * Constructs a new ListSavedQueriesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListSavedQueriesResponse. + * @implements IListSavedQueriesResponse + * @constructor + * @param {google.cloud.asset.v1.IListSavedQueriesResponse=} [properties] Properties to set + */ + function ListSavedQueriesResponse(properties) { + this.savedQueries = []; + 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]]; + } + + /** + * ListSavedQueriesResponse savedQueries. + * @member {Array.} savedQueries + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + */ + ListSavedQueriesResponse.prototype.savedQueries = $util.emptyArray; + + /** + * ListSavedQueriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + */ + ListSavedQueriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSavedQueriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse instance + */ + ListSavedQueriesResponse.create = function create(properties) { + return new ListSavedQueriesResponse(properties); + }; + + /** + * Encodes the specified ListSavedQueriesResponse message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse} message ListSavedQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.savedQueries != null && message.savedQueries.length) + for (var i = 0; i < message.savedQueries.length; ++i) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQueries[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 ListSavedQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse} message ListSavedQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesResponse.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.asset.v1.ListSavedQueriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.savedQueries && message.savedQueries.length)) + message.savedQueries = []; + message.savedQueries.push($root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSavedQueriesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSavedQueriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.savedQueries != null && message.hasOwnProperty("savedQueries")) { + if (!Array.isArray(message.savedQueries)) + return "savedQueries: array expected"; + for (var i = 0; i < message.savedQueries.length; ++i) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQueries[i]); + if (error) + return "savedQueries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSavedQueriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + */ + ListSavedQueriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListSavedQueriesResponse) + return object; + var message = new $root.google.cloud.asset.v1.ListSavedQueriesResponse(); + if (object.savedQueries) { + if (!Array.isArray(object.savedQueries)) + throw TypeError(".google.cloud.asset.v1.ListSavedQueriesResponse.savedQueries: array expected"); + message.savedQueries = []; + for (var i = 0; i < object.savedQueries.length; ++i) { + if (typeof object.savedQueries[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListSavedQueriesResponse.savedQueries: object expected"); + message.savedQueries[i] = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQueries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSavedQueriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.ListSavedQueriesResponse} message ListSavedQueriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSavedQueriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.savedQueries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.savedQueries && message.savedQueries.length) { + object.savedQueries = []; + for (var j = 0; j < message.savedQueries.length; ++j) + object.savedQueries[j] = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQueries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSavedQueriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSavedQueriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSavedQueriesResponse; + })(); + + v1.UpdateSavedQueryRequest = (function() { + + /** + * Properties of an UpdateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IUpdateSavedQueryRequest + * @property {google.cloud.asset.v1.ISavedQuery|null} [savedQuery] UpdateSavedQueryRequest savedQuery + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSavedQueryRequest updateMask + */ + + /** + * Constructs a new UpdateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an UpdateSavedQueryRequest. + * @implements IUpdateSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest=} [properties] Properties to set + */ + function UpdateSavedQueryRequest(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]]; + } + + /** + * UpdateSavedQueryRequest savedQuery. + * @member {google.cloud.asset.v1.ISavedQuery|null|undefined} savedQuery + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + */ + UpdateSavedQueryRequest.prototype.savedQuery = null; + + /** + * UpdateSavedQueryRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + */ + UpdateSavedQueryRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest instance + */ + UpdateSavedQueryRequest.create = function create(properties) { + return new UpdateSavedQueryRequest(properties); + }; + + /** + * Encodes the specified UpdateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} message UpdateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.savedQuery != null && Object.hasOwnProperty.call(message, "savedQuery")) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQuery, 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 UpdateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} message UpdateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSavedQueryRequest.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.asset.v1.UpdateSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.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 UpdateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQuery); + if (error) + return "savedQuery." + 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 UpdateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + */ + UpdateSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.UpdateSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.UpdateSavedQueryRequest(); + if (object.savedQuery != null) { + if (typeof object.savedQuery !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateSavedQueryRequest.savedQuery: object expected"); + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQuery); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateSavedQueryRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.UpdateSavedQueryRequest} message UpdateSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.savedQuery = null; + object.updateMask = null; + } + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) + object.savedQuery = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQuery, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSavedQueryRequest; + })(); + + v1.DeleteSavedQueryRequest = (function() { + + /** + * Properties of a DeleteSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IDeleteSavedQueryRequest + * @property {string|null} [name] DeleteSavedQueryRequest name + */ + + /** + * Constructs a new DeleteSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a DeleteSavedQueryRequest. + * @implements IDeleteSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest=} [properties] Properties to set + */ + function DeleteSavedQueryRequest(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]]; + } + + /** + * DeleteSavedQueryRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @instance + */ + DeleteSavedQueryRequest.prototype.name = ""; + + /** + * Creates a new DeleteSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest instance + */ + DeleteSavedQueryRequest.create = function create(properties) { + return new DeleteSavedQueryRequest(properties); + }; + + /** + * Encodes the specified DeleteSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} message DeleteSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSavedQueryRequest.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 DeleteSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} message DeleteSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSavedQueryRequest.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.asset.v1.DeleteSavedQueryRequest(); + 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 DeleteSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSavedQueryRequest.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 DeleteSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + */ + DeleteSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.DeleteSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.DeleteSavedQueryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.DeleteSavedQueryRequest} message DeleteSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSavedQueryRequest.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 DeleteSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSavedQueryRequest; + })(); + + v1.AnalyzeMoveRequest = (function() { + + /** + * Properties of an AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveRequest + * @property {string|null} [resource] AnalyzeMoveRequest resource + * @property {string|null} [destinationParent] AnalyzeMoveRequest destinationParent + * @property {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null} [view] AnalyzeMoveRequest view + */ + + /** + * Constructs a new AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveRequest. + * @implements IAnalyzeMoveRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + */ + function AnalyzeMoveRequest(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]]; + } + + /** + * AnalyzeMoveRequest resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.resource = ""; + + /** + * AnalyzeMoveRequest destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.destinationParent = ""; + + /** + * AnalyzeMoveRequest view. + * @member {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} view + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.view = 0; + + /** + * Creates a new AnalyzeMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest instance + */ + AnalyzeMoveRequest.create = function create(properties) { + return new AnalyzeMoveRequest(properties); + }; + + /** + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.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.asset.v1.AnalyzeMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.destinationParent = reader.string(); + break; + case 3: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeMoveRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + */ + AnalyzeMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + switch (object.view) { + case "ANALYSIS_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeMoveRequest} message AnalyzeMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.destinationParent = ""; + object.view = options.enums === String ? "ANALYSIS_VIEW_UNSPECIFIED" : 0; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + return object; + }; + + /** + * Converts this AnalyzeMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AnalysisView enum. + * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView + * @enum {number} + * @property {number} ANALYSIS_VIEW_UNSPECIFIED=0 ANALYSIS_VIEW_UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} BASIC=2 BASIC value + */ + AnalyzeMoveRequest.AnalysisView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANALYSIS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "BASIC"] = 2; + return values; + })(); + + return AnalyzeMoveRequest; + })(); + + v1.AnalyzeMoveResponse = (function() { + + /** + * Properties of an AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveResponse + * @property {Array.|null} [moveAnalysis] AnalyzeMoveResponse moveAnalysis + */ + + /** + * Constructs a new AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveResponse. + * @implements IAnalyzeMoveResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + */ + function AnalyzeMoveResponse(properties) { + this.moveAnalysis = []; + 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]]; + } + + /** + * AnalyzeMoveResponse moveAnalysis. + * @member {Array.} moveAnalysis + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @instance + */ + AnalyzeMoveResponse.prototype.moveAnalysis = $util.emptyArray; + + /** + * Creates a new AnalyzeMoveResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse instance + */ + AnalyzeMoveResponse.create = function create(properties) { + return new AnalyzeMoveResponse(properties); + }; + + /** + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moveAnalysis != null && message.moveAnalysis.length) + for (var i = 0; i < message.moveAnalysis.length; ++i) + $root.google.cloud.asset.v1.MoveAnalysis.encode(message.moveAnalysis[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveResponse.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.asset.v1.AnalyzeMoveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.moveAnalysis && message.moveAnalysis.length)) + message.moveAnalysis = []; message.moveAnalysis.push($root.google.cloud.asset.v1.MoveAnalysis.decode(reader, reader.uint32())); break; default: @@ -11271,37 +13433,496 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + MoveAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.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.asset.v1.MoveAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAnalysisResult.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) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.blockers[i]); + if (error) + return "blockers." + error; + } + } + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + return null; + }; + + /** + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + */ + MoveAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); + if (object.blockers) { + if (!Array.isArray(object.blockers)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: array expected"); + message.blockers = []; + for (var i = 0; i < object.blockers.length; ++i) { + if (typeof object.blockers[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: object expected"); + message.blockers[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.blockers[i]); + } + } + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: object expected"); + message.warnings[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.warnings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.MoveAnalysisResult} message MoveAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.blockers = []; + object.warnings = []; + } + if (message.blockers && message.blockers.length) { + object.blockers = []; + for (var j = 0; j < message.blockers.length; ++j) + object.blockers[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.blockers[j], options); + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.warnings[j], options); + } + return object; + }; + + /** + * Converts this MoveAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + MoveAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveAnalysisResult; + })(); + + v1.MoveImpact = (function() { + + /** + * Properties of a MoveImpact. + * @memberof google.cloud.asset.v1 + * @interface IMoveImpact + * @property {string|null} [detail] MoveImpact detail + */ + + /** + * Constructs a new MoveImpact. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveImpact. + * @implements IMoveImpact + * @constructor + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + */ + function MoveImpact(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]]; + } + + /** + * MoveImpact detail. + * @member {string} detail + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + */ + MoveImpact.prototype.detail = ""; + + /** + * Creates a new MoveImpact instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact instance + */ + MoveImpact.create = function create(properties) { + return new MoveImpact(properties); + }; + + /** + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.detail); + return writer; + }; + + /** + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.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.asset.v1.MoveImpact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.detail = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveImpact message. + * @function verify + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveImpact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + */ + MoveImpact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveImpact) + return object; + var message = new $root.google.cloud.asset.v1.MoveImpact(); + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.MoveImpact} message MoveImpact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveImpact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.detail = ""; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + return object; + }; + + /** + * Converts this MoveImpact to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + * @returns {Object.} JSON object + */ + MoveImpact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveImpact; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} OS_INVENTORY=6 OS_INVENTORY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[6] = "OS_INVENTORY"] = 6; + values[valuesById[7] = "RELATIONSHIP"] = 7; + return values; + })(); + + v1.BatchGetEffectiveIamPoliciesRequest = (function() { + + /** + * Properties of a BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetEffectiveIamPoliciesRequest + * @property {string|null} [scope] BatchGetEffectiveIamPoliciesRequest scope + * @property {Array.|null} [names] BatchGetEffectiveIamPoliciesRequest names + */ + + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetEffectiveIamPoliciesRequest. + * @implements IBatchGetEffectiveIamPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + */ + function BatchGetEffectiveIamPoliciesRequest(properties) { + this.names = []; + 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]]; + } + + /** + * BatchGetEffectiveIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.scope = ""; + + /** + * BatchGetEffectiveIamPoliciesRequest names. + * @member {Array.} names + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest instance + */ + BatchGetEffectiveIamPoliciesRequest.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesRequest(properties); + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveAnalysisResult.decode = function decode(reader, length) { + BatchGetEffectiveIamPoliciesRequest.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.asset.v1.MoveAnalysisResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.blockers && message.blockers.length)) - message.blockers = []; - message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + message.scope = reader.string(); break; - case 2: - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + case 3: + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -11312,150 +13933,129 @@ }; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + BatchGetEffectiveIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MoveAnalysisResult message. + * Verifies a BatchGetEffectiveIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MoveAnalysisResult.verify = function verify(message) { + BatchGetEffectiveIamPoliciesRequest.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) { - var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.blockers[i]); - if (error) - return "blockers." + error; - } - } - if (message.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) { - var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.warnings[i]); - if (error) - return "warnings." + error; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; } return null; }; /** - * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest */ - MoveAnalysisResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.MoveAnalysisResult) + BatchGetEffectiveIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); - if (object.blockers) { - if (!Array.isArray(object.blockers)) - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: array expected"); - message.blockers = []; - for (var i = 0; i < object.blockers.length; ++i) { - if (typeof object.blockers[i] !== "object") - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: object expected"); - message.blockers[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.blockers[i]); - } - } - if (object.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: object expected"); - message.warnings[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.warnings[i]); - } + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); } return message; }; /** - * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static - * @param {google.cloud.asset.v1.MoveAnalysisResult} message MoveAnalysisResult + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveAnalysisResult.toObject = function toObject(message, options) { + BatchGetEffectiveIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.blockers = []; - object.warnings = []; - } - if (message.blockers && message.blockers.length) { - object.blockers = []; - for (var j = 0; j < message.blockers.length; ++j) - object.blockers[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.blockers[j], options); - } - if (message.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.warnings[j], options); + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.scope = ""; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; } return object; }; /** - * Converts this MoveAnalysisResult to JSON. + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - MoveAnalysisResult.prototype.toJSON = function toJSON() { + BatchGetEffectiveIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MoveAnalysisResult; + return BatchGetEffectiveIamPoliciesRequest; })(); - v1.MoveImpact = (function() { + v1.BatchGetEffectiveIamPoliciesResponse = (function() { /** - * Properties of a MoveImpact. + * Properties of a BatchGetEffectiveIamPoliciesResponse. * @memberof google.cloud.asset.v1 - * @interface IMoveImpact - * @property {string|null} [detail] MoveImpact detail + * @interface IBatchGetEffectiveIamPoliciesResponse + * @property {Array.|null} [policyResults] BatchGetEffectiveIamPoliciesResponse policyResults */ /** - * Constructs a new MoveImpact. + * Constructs a new BatchGetEffectiveIamPoliciesResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents a MoveImpact. - * @implements IMoveImpact + * @classdesc Represents a BatchGetEffectiveIamPoliciesResponse. + * @implements IBatchGetEffectiveIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set */ - function MoveImpact(properties) { + function BatchGetEffectiveIamPoliciesResponse(properties) { + this.policyResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11463,75 +14063,78 @@ } /** - * MoveImpact detail. - * @member {string} detail - * @memberof google.cloud.asset.v1.MoveImpact + * BatchGetEffectiveIamPoliciesResponse policyResults. + * @member {Array.} policyResults + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @instance */ - MoveImpact.prototype.detail = ""; + BatchGetEffectiveIamPoliciesResponse.prototype.policyResults = $util.emptyArray; /** - * Creates a new MoveImpact instance using the specified properties. + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse instance */ - MoveImpact.create = function create(properties) { - return new MoveImpact(properties); + BatchGetEffectiveIamPoliciesResponse.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesResponse(properties); }; /** - * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveImpact.encode = function encode(message, writer) { + BatchGetEffectiveIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.detail); + if (message.policyResults != null && message.policyResults.length) + for (var i = 0; i < message.policyResults.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.encode(message.policyResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveImpact.encodeDelimited = function encodeDelimited(message, writer) { + BatchGetEffectiveIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MoveImpact message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveImpact.decode = function decode(reader, length) { + BatchGetEffectiveIamPoliciesResponse.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.asset.v1.MoveImpact(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.detail = reader.string(); + case 2: + if (!(message.policyResults && message.policyResults.length)) + message.policyResults = []; + message.policyResults.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -11542,111 +14145,550 @@ }; /** - * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveImpact.decodeDelimited = function decodeDelimited(reader) { + BatchGetEffectiveIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MoveImpact message. + * Verifies a BatchGetEffectiveIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MoveImpact.verify = function verify(message) { + BatchGetEffectiveIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.detail != null && message.hasOwnProperty("detail")) - if (!$util.isString(message.detail)) - return "detail: string expected"; + if (message.policyResults != null && message.hasOwnProperty("policyResults")) { + if (!Array.isArray(message.policyResults)) + return "policyResults: array expected"; + for (var i = 0; i < message.policyResults.length; ++i) { + var error = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify(message.policyResults[i]); + if (error) + return "policyResults." + error; + } + } return null; }; /** - * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse */ - MoveImpact.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.MoveImpact) + BatchGetEffectiveIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1.MoveImpact(); - if (object.detail != null) - message.detail = String(object.detail); + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse(); + if (object.policyResults) { + if (!Array.isArray(object.policyResults)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.policyResults: array expected"); + message.policyResults = []; + for (var i = 0; i < object.policyResults.length; ++i) { + if (typeof object.policyResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.policyResults: object expected"); + message.policyResults[i] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.fromObject(object.policyResults[i]); + } + } return message; }; /** - * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.MoveImpact} message MoveImpact + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveImpact.toObject = function toObject(message, options) { + BatchGetEffectiveIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.detail = ""; - if (message.detail != null && message.hasOwnProperty("detail")) - object.detail = message.detail; + if (options.arrays || options.defaults) + object.policyResults = []; + if (message.policyResults && message.policyResults.length) { + object.policyResults = []; + for (var j = 0; j < message.policyResults.length; ++j) + object.policyResults[j] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.toObject(message.policyResults[j], options); + } return object; }; /** - * Converts this MoveImpact to JSON. + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - MoveImpact.prototype.toJSON = function toJSON() { + BatchGetEffectiveIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MoveImpact; - })(); + BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy = (function() { - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - * @property {number} OS_INVENTORY=6 OS_INVENTORY value - * @property {number} RELATIONSHIP=7 RELATIONSHIP value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - values[valuesById[6] = "OS_INVENTORY"] = 6; - values[valuesById[7] = "RELATIONSHIP"] = 7; - return values; + /** + * Properties of an EffectiveIamPolicy. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @interface IEffectiveIamPolicy + * @property {string|null} [fullResourceName] EffectiveIamPolicy fullResourceName + * @property {Array.|null} [policies] EffectiveIamPolicy policies + */ + + /** + * Constructs a new EffectiveIamPolicy. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @classdesc Represents an EffectiveIamPolicy. + * @implements IEffectiveIamPolicy + * @constructor + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy=} [properties] Properties to set + */ + function EffectiveIamPolicy(properties) { + this.policies = []; + 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]]; + } + + /** + * EffectiveIamPolicy fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + */ + EffectiveIamPolicy.prototype.fullResourceName = ""; + + /** + * EffectiveIamPolicy policies. + * @member {Array.} policies + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + */ + EffectiveIamPolicy.prototype.policies = $util.emptyArray; + + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy instance + */ + EffectiveIamPolicy.create = function create(properties) { + return new EffectiveIamPolicy(properties); + }; + + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy} message EffectiveIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.encode(message.policies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy} message EffectiveIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIamPolicy.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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + case 2: + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveIamPolicy message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveIamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) { + var error = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify(message.policies[i]); + if (error) + return "policies." + error; + } + } + return null; + }; + + /** + * Creates an EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + */ + EffectiveIamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) { + if (typeof object.policies[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies: object expected"); + message.policies[i] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.fromObject(object.policies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} message EffectiveIamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveIamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policies = []; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.toObject(message.policies[j], options); + } + return object; + }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + * @returns {Object.} JSON object + */ + EffectiveIamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EffectiveIamPolicy.PolicyInfo = (function() { + + /** + * Properties of a PolicyInfo. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @interface IPolicyInfo + * @property {string|null} [attachedResource] PolicyInfo attachedResource + * @property {google.iam.v1.IPolicy|null} [policy] PolicyInfo policy + */ + + /** + * Constructs a new PolicyInfo. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @classdesc Represents a PolicyInfo. + * @implements IPolicyInfo + * @constructor + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo=} [properties] Properties to set + */ + function PolicyInfo(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]]; + } + + /** + * PolicyInfo attachedResource. + * @member {string} attachedResource + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + */ + PolicyInfo.prototype.attachedResource = ""; + + /** + * PolicyInfo policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + */ + PolicyInfo.prototype.policy = null; + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo instance + */ + PolicyInfo.create = function create(properties) { + return new PolicyInfo(properties); + }; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo} message PolicyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResource != null && Object.hasOwnProperty.call(message, "attachedResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo} message PolicyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyInfo.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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attachedResource = reader.string(); + break; + case 2: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyInfo message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + if (!$util.isString(message.attachedResource)) + return "attachedResource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates a PolicyInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + */ + PolicyInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo(); + if (object.attachedResource != null) + message.attachedResource = String(object.attachedResource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a PolicyInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} message PolicyInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attachedResource = ""; + object.policy = null; + } + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + object.attachedResource = message.attachedResource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this PolicyInfo to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + * @returns {Object.} JSON object + */ + PolicyInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PolicyInfo; + })(); + + return EffectiveIamPolicy; + })(); + + return BatchGetEffectiveIamPoliciesResponse; })(); v1.TemporalAsset = (function() { @@ -12225,6 +15267,7 @@ * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory * @property {google.cloud.asset.v1.IRelatedAssets|null} [relatedAssets] Asset relatedAssets + * @property {google.cloud.asset.v1.IRelatedAsset|null} [relatedAsset] Asset relatedAsset * @property {Array.|null} [ancestors] Asset ancestors */ @@ -12333,6 +15376,14 @@ */ Asset.prototype.relatedAssets = null; + /** + * Asset relatedAsset. + * @member {google.cloud.asset.v1.IRelatedAsset|null|undefined} relatedAsset + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.relatedAsset = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -12405,6 +15456,8 @@ $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.relatedAssets != null && Object.hasOwnProperty.call(message, "relatedAssets")) $root.google.cloud.asset.v1.RelatedAssets.encode(message.relatedAssets, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.relatedAsset != null && Object.hasOwnProperty.call(message, "relatedAsset")) + $root.google.cloud.asset.v1.RelatedAsset.encode(message.relatedAsset, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; @@ -12474,6 +15527,9 @@ case 13: message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); break; + case 15: + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -12583,6 +15639,11 @@ if (error) return "relatedAssets." + error; } + if (message.relatedAsset != null && message.hasOwnProperty("relatedAsset")) { + var error = $root.google.cloud.asset.v1.RelatedAsset.verify(message.relatedAsset); + if (error) + return "relatedAsset." + error; + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -12659,6 +15720,11 @@ throw TypeError(".google.cloud.asset.v1.Asset.relatedAssets: object expected"); message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.fromObject(object.relatedAssets); } + if (object.relatedAsset != null) { + if (typeof object.relatedAsset !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.relatedAsset: object expected"); + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.fromObject(object.relatedAsset); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -12694,6 +15760,7 @@ object.updateTime = null; object.osInventory = null; object.relatedAssets = null; + object.relatedAsset = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12734,6 +15801,8 @@ object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) object.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.toObject(message.relatedAssets, options); + if (message.relatedAsset != null && message.hasOwnProperty("relatedAsset")) + object.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.toObject(message.relatedAsset, options); return object; }; @@ -13575,6 +16644,7 @@ * @property {string|null} [asset] RelatedAsset asset * @property {string|null} [assetType] RelatedAsset assetType * @property {Array.|null} [ancestors] RelatedAsset ancestors + * @property {string|null} [relationshipType] RelatedAsset relationshipType */ /** @@ -13617,6 +16687,14 @@ */ RelatedAsset.prototype.ancestors = $util.emptyArray; + /** + * RelatedAsset relationshipType. + * @member {string} relationshipType + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.relationshipType = ""; + /** * Creates a new RelatedAsset instance using the specified properties. * @function create @@ -13648,6 +16726,8 @@ if (message.ancestors != null && message.ancestors.length) for (var i = 0; i < message.ancestors.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestors[i]); + if (message.relationshipType != null && Object.hasOwnProperty.call(message, "relationshipType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.relationshipType); return writer; }; @@ -13693,6 +16773,9 @@ message.ancestors = []; message.ancestors.push(reader.string()); break; + case 4: + message.relationshipType = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -13741,6 +16824,9 @@ if (!$util.isString(message.ancestors[i])) return "ancestors: string[] expected"; } + if (message.relationshipType != null && message.hasOwnProperty("relationshipType")) + if (!$util.isString(message.relationshipType)) + return "relationshipType: string expected"; return null; }; @@ -13767,6 +16853,8 @@ for (var i = 0; i < object.ancestors.length; ++i) message.ancestors[i] = String(object.ancestors[i]); } + if (object.relationshipType != null) + message.relationshipType = String(object.relationshipType); return message; }; @@ -13788,6 +16876,7 @@ if (options.defaults) { object.asset = ""; object.assetType = ""; + object.relationshipType = ""; } if (message.asset != null && message.hasOwnProperty("asset")) object.asset = message.asset; @@ -13798,6 +16887,8 @@ for (var j = 0; j < message.ancestors.length; ++j) object.ancestors[j] = message.ancestors[j]; } + if (message.relationshipType != null && message.hasOwnProperty("relationshipType")) + object.relationshipType = message.relationshipType; return object; }; @@ -13840,6 +16931,9 @@ * @property {Array.|null} [versionedResources] ResourceSearchResult versionedResources * @property {Array.|null} [attachedResources] ResourceSearchResult attachedResources * @property {Object.|null} [relationships] ResourceSearchResult relationships + * @property {Array.|null} [tagKeys] ResourceSearchResult tagKeys + * @property {Array.|null} [tagValues] ResourceSearchResult tagValues + * @property {Array.|null} [tagValueIds] ResourceSearchResult tagValueIds * @property {string|null} [parentAssetType] ResourceSearchResult parentAssetType */ @@ -13858,6 +16952,9 @@ this.versionedResources = []; this.attachedResources = []; this.relationships = {}; + this.tagKeys = []; + this.tagValues = []; + this.tagValueIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14016,6 +17113,30 @@ */ ResourceSearchResult.prototype.relationships = $util.emptyObject; + /** + * ResourceSearchResult tagKeys. + * @member {Array.} tagKeys + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagKeys = $util.emptyArray; + + /** + * ResourceSearchResult tagValues. + * @member {Array.} tagValues + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagValues = $util.emptyArray; + + /** + * ResourceSearchResult tagValueIds. + * @member {Array.} tagValueIds + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagValueIds = $util.emptyArray; + /** * ResourceSearchResult parentAssetType. * @member {string} parentAssetType @@ -14094,6 +17215,15 @@ writer.uint32(/* id 21, wireType 2 =*/170).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.asset.v1.RelatedResources.encode(message.relationships[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.tagKeys != null && message.tagKeys.length) + for (var i = 0; i < message.tagKeys.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.tagKeys[i]); + if (message.tagValues != null && message.tagValues.length) + for (var i = 0; i < message.tagValues.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.tagValues[i]); + if (message.tagValueIds != null && message.tagValueIds.length) + for (var i = 0; i < message.tagValueIds.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.tagValueIds[i]); if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); return writer; @@ -14233,6 +17363,21 @@ } message.relationships[key] = value; break; + case 23: + if (!(message.tagKeys && message.tagKeys.length)) + message.tagKeys = []; + message.tagKeys.push(reader.string()); + break; + case 25: + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push(reader.string()); + break; + case 26: + if (!(message.tagValueIds && message.tagValueIds.length)) + message.tagValueIds = []; + message.tagValueIds.push(reader.string()); + break; case 103: message.parentAssetType = reader.string(); break; @@ -14366,6 +17511,27 @@ return "relationships." + error; } } + if (message.tagKeys != null && message.hasOwnProperty("tagKeys")) { + if (!Array.isArray(message.tagKeys)) + return "tagKeys: array expected"; + for (var i = 0; i < message.tagKeys.length; ++i) + if (!$util.isString(message.tagKeys[i])) + return "tagKeys: string[] expected"; + } + if (message.tagValues != null && message.hasOwnProperty("tagValues")) { + if (!Array.isArray(message.tagValues)) + return "tagValues: array expected"; + for (var i = 0; i < message.tagValues.length; ++i) + if (!$util.isString(message.tagValues[i])) + return "tagValues: string[] expected"; + } + if (message.tagValueIds != null && message.hasOwnProperty("tagValueIds")) { + if (!Array.isArray(message.tagValueIds)) + return "tagValueIds: array expected"; + for (var i = 0; i < message.tagValueIds.length; ++i) + if (!$util.isString(message.tagValueIds[i])) + return "tagValueIds: string[] expected"; + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) if (!$util.isString(message.parentAssetType)) return "parentAssetType: string expected"; @@ -14470,6 +17636,27 @@ message.relationships[keys[i]] = $root.google.cloud.asset.v1.RelatedResources.fromObject(object.relationships[keys[i]]); } } + if (object.tagKeys) { + if (!Array.isArray(object.tagKeys)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagKeys: array expected"); + message.tagKeys = []; + for (var i = 0; i < object.tagKeys.length; ++i) + message.tagKeys[i] = String(object.tagKeys[i]); + } + if (object.tagValues) { + if (!Array.isArray(object.tagValues)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagValues: array expected"); + message.tagValues = []; + for (var i = 0; i < object.tagValues.length; ++i) + message.tagValues[i] = String(object.tagValues[i]); + } + if (object.tagValueIds) { + if (!Array.isArray(object.tagValueIds)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagValueIds: array expected"); + message.tagValueIds = []; + for (var i = 0; i < object.tagValueIds.length; ++i) + message.tagValueIds[i] = String(object.tagValueIds[i]); + } if (object.parentAssetType != null) message.parentAssetType = String(object.parentAssetType); return message; @@ -14493,6 +17680,9 @@ object.versionedResources = []; object.folders = []; object.attachedResources = []; + object.tagKeys = []; + object.tagValues = []; + object.tagValueIds = []; } if (options.objects || options.defaults) { object.labels = {}; @@ -14571,6 +17761,21 @@ for (var j = 0; j < keys2.length; ++j) object.relationships[keys2[j]] = $root.google.cloud.asset.v1.RelatedResources.toObject(message.relationships[keys2[j]], options); } + if (message.tagKeys && message.tagKeys.length) { + object.tagKeys = []; + for (var j = 0; j < message.tagKeys.length; ++j) + object.tagKeys[j] = message.tagKeys[j]; + } + if (message.tagValues && message.tagValues.length) { + object.tagValues = []; + for (var j = 0; j < message.tagValues.length; ++j) + object.tagValues[j] = message.tagValues[j]; + } + if (message.tagValueIds && message.tagValueIds.length) { + object.tagValueIds = []; + for (var j = 0; j < message.tagValueIds.length; ++j) + object.tagValueIds[j] = message.tagValueIds[j]; + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) object.parentAssetType = message.parentAssetType; return object; @@ -47054,225 +50259,6 @@ return Timestamp; })(); - 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.Struct = (function() { /** @@ -48074,17 +51060,236 @@ }; /** - * Converts this ListValue to JSON. + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + 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.ListValue + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - ListValue.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListValue; + return Any; })(); protobuf.Duration = (function() { @@ -48517,6 +51722,504 @@ return protobuf; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(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]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.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.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.year = reader.int32(); + break; + case 2: + message.month = reader.int32(); + break; + case 3: + message.day = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Date; + })(); + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.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.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + return type; + })(); + google.iam = (function() { /** @@ -49891,504 +53594,6 @@ return iam; })(); - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(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]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.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.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Expr; - })(); - - type.Date = (function() { - - /** - * Properties of a Date. - * @memberof google.type - * @interface IDate - * @property {number|null} [year] Date year - * @property {number|null} [month] Date month - * @property {number|null} [day] Date day - */ - - /** - * Constructs a new Date. - * @memberof google.type - * @classdesc Represents a Date. - * @implements IDate - * @constructor - * @param {google.type.IDate=} [properties] Properties to set - */ - function Date(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]]; - } - - /** - * Date year. - * @member {number} year - * @memberof google.type.Date - * @instance - */ - Date.prototype.year = 0; - - /** - * Date month. - * @member {number} month - * @memberof google.type.Date - * @instance - */ - Date.prototype.month = 0; - - /** - * Date day. - * @member {number} day - * @memberof google.type.Date - * @instance - */ - Date.prototype.day = 0; - - /** - * Creates a new Date instance using the specified properties. - * @function create - * @memberof google.type.Date - * @static - * @param {google.type.IDate=} [properties] Properties to set - * @returns {google.type.Date} Date instance - */ - Date.create = function create(properties) { - return new Date(properties); - }; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encode - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.year != null && Object.hasOwnProperty.call(message, "year")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); - if (message.month != null && Object.hasOwnProperty.call(message, "month")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); - return writer; - }; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Date message from the specified reader or buffer. - * @function decode - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.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.type.Date(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.year = reader.int32(); - break; - case 2: - message.month = reader.int32(); - break; - case 3: - message.day = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Date message. - * @function verify - * @memberof google.type.Date - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Date.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.year != null && message.hasOwnProperty("year")) - if (!$util.isInteger(message.year)) - return "year: integer expected"; - if (message.month != null && message.hasOwnProperty("month")) - if (!$util.isInteger(message.month)) - return "month: integer expected"; - if (message.day != null && message.hasOwnProperty("day")) - if (!$util.isInteger(message.day)) - return "day: integer expected"; - return null; - }; - - /** - * Creates a Date message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Date - * @static - * @param {Object.} object Plain object - * @returns {google.type.Date} Date - */ - Date.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Date) - return object; - var message = new $root.google.type.Date(); - if (object.year != null) - message.year = object.year | 0; - if (object.month != null) - message.month = object.month | 0; - if (object.day != null) - message.day = object.day | 0; - return message; - }; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Date - * @static - * @param {google.type.Date} message Date - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Date.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.year = 0; - object.month = 0; - object.day = 0; - } - if (message.year != null && message.hasOwnProperty("year")) - object.year = message.year; - if (message.month != null && message.hasOwnProperty("month")) - object.month = message.month; - if (message.day != null && message.hasOwnProperty("day")) - object.day = message.day; - return object; - }; - - /** - * Converts this Date to JSON. - * @function toJSON - * @memberof google.type.Date - * @instance - * @returns {Object.} JSON object - */ - Date.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Date; - })(); - - return type; - })(); - google.identity = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 7fafb533d28..acc1f37e931 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -260,6 +260,114 @@ } } ] + }, + "CreateSavedQuery": { + "requestType": "CreateSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}/savedQueries", + "(google.api.http).body": "saved_query", + "(google.api.method_signature)": "parent,saved_query,saved_query_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}/savedQueries", + "body": "saved_query" + } + }, + { + "(google.api.method_signature)": "parent,saved_query,saved_query_id" + } + ] + }, + "GetSavedQuery": { + "requestType": "GetSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).get": "/v1/{name=*/*/savedQueries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=*/*/savedQueries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSavedQueries": { + "requestType": "ListSavedQueriesRequest", + "responseType": "ListSavedQueriesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/savedQueries", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/savedQueries" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateSavedQuery": { + "requestType": "UpdateSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).patch": "/v1/{saved_query.name=*/*/savedQueries/*}", + "(google.api.http).body": "saved_query", + "(google.api.method_signature)": "saved_query,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{saved_query.name=*/*/savedQueries/*}", + "body": "saved_query" + } + }, + { + "(google.api.method_signature)": "saved_query,update_mask" + } + ] + }, + "DeleteSavedQuery": { + "requestType": "DeleteSavedQueryRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=*/*/savedQueries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=*/*/savedQueries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchGetEffectiveIamPolicies": { + "requestType": "BatchGetEffectiveIamPoliciesRequest", + "responseType": "BatchGetEffectiveIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + } + } + ] } } }, @@ -984,6 +1092,13 @@ "(google.api.field_behavior)": "REQUIRED" } }, + "savedAnalysisQuery": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "executionTimeout": { "type": "google.protobuf.Duration", "id": 2, @@ -1113,6 +1228,13 @@ "(google.api.field_behavior)": "REQUIRED" } }, + "savedAnalysisQuery": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "outputConfig": { "type": "IamPolicyAnalysisOutputConfig", "id": 2, @@ -1125,6 +1247,190 @@ "AnalyzeIamPolicyLongrunningResponse": { "fields": {} }, + "SavedQuery": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/SavedQuery", + "(google.api.resource).pattern": "organizations/{organization}/savedQueries/{saved_query}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdater": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "content": { + "type": "QueryContent", + "id": 8 + } + }, + "nested": { + "QueryContent": { + "oneofs": { + "queryContent": { + "oneof": [ + "iamPolicyAnalysisQuery" + ] + } + }, + "fields": { + "iamPolicyAnalysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + } + } + } + } + }, + "CreateSavedQueryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/SavedQuery" + } + }, + "savedQuery": { + "type": "SavedQuery", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "savedQueryId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSavedQueryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/SavedQuery" + } + } + } + }, + "ListSavedQueriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/SavedQuery" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSavedQueriesResponse": { + "fields": { + "savedQueries": { + "rule": "repeated", + "type": "SavedQuery", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateSavedQueryRequest": { + "fields": { + "savedQuery": { + "type": "SavedQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSavedQueryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/SavedQuery" + } + } + } + }, "AnalyzeMoveRequest": { "fields": { "resource": { @@ -1222,6 +1528,65 @@ "RELATIONSHIP": 7 } }, + "BatchGetEffectiveIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "names": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + } + } + }, + "BatchGetEffectiveIamPoliciesResponse": { + "fields": { + "policyResults": { + "rule": "repeated", + "type": "EffectiveIamPolicy", + "id": 2 + } + }, + "nested": { + "EffectiveIamPolicy": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "policies": { + "rule": "repeated", + "type": "PolicyInfo", + "id": 2 + } + }, + "nested": { + "PolicyInfo": { + "fields": { + "attachedResource": { + "type": "string", + "id": 1 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 2 + } + } + } + } + } + } + }, "TemporalAsset": { "fields": { "window": { @@ -1327,7 +1692,14 @@ }, "relatedAssets": { "type": "RelatedAssets", - "id": 13 + "id": 13, + "options": { + "deprecated": true + } + }, + "relatedAsset": { + "type": "RelatedAsset", + "id": 15 }, "ancestors": { "rule": "repeated", @@ -1369,6 +1741,9 @@ } }, "RelatedAssets": { + "options": { + "deprecated": true + }, "fields": { "relationshipAttributes": { "type": "RelationshipAttributes", @@ -1382,6 +1757,9 @@ } }, "RelationshipAttributes": { + "options": { + "deprecated": true + }, "fields": { "type": { "type": "string", @@ -1418,6 +1796,10 @@ "rule": "repeated", "type": "string", "id": 3 + }, + "relationshipType": { + "type": "string", + "id": 4 } } }, @@ -1505,6 +1887,21 @@ "type": "RelatedResources", "id": 21 }, + "tagKeys": { + "rule": "repeated", + "type": "string", + "id": 23 + }, + "tagValues": { + "rule": "repeated", + "type": "string", + "id": 25 + }, + "tagValueIds": { + "rule": "repeated", + "type": "string", + "id": 26 + }, "parentAssetType": { "type": "string", "id": 103 @@ -4698,18 +5095,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Struct": { "fields": { "fields": { @@ -4773,6 +5158,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Duration": { "fields": { "seconds": { @@ -4796,6 +5193,54 @@ } } }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, "iam": { "nested": { "v1": { @@ -4919,54 +5364,6 @@ } } }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/date;date", - "java_multiple_files": true, - "java_outer_classname": "DateProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP", - "cc_enable_arenas": true - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - }, - "Date": { - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - } - } - } - } - }, "identity": { "nested": { "accesscontextmanager": { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index 38fcd423fb0..e385da62df9 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -30,7 +30,24 @@ function main(analysisQuery) { */ // const analysisQuery = {} /** - * Optional. Amount of time executable has to complete. See JSON representation of + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * MergeFrom (https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + */ + // const savedAnalysisQuery = 'abc123' + /** + * Optional. Amount of time executable has to complete. See JSON + * representation of * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json). * If this field is set with a value less than the RPC deadline, and the * execution of your query hasn't finished in the specified diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index abb0aa3fdee..fbba9d86a41 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -30,7 +30,24 @@ function main(analysisQuery, outputConfig) { */ // const analysisQuery = {} /** - * Required. Output configuration indicating where the results will be output to. + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * MergeFrom (https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + */ + // const savedAnalysisQuery = 'abc123' + /** + * Required. Output configuration indicating where the results will be output + * to. */ // const outputConfig = {} diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js new file mode 100644 index 00000000000..033ae273f29 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js @@ -0,0 +1,74 @@ +// 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(scope, names) { + // [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization id, visit here + * (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project id, visit here + * (https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + */ + // const scope = 'abc123' + /** + * Required. The names refer to the full_resource_names + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of searchable asset + * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + */ + // const names = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callBatchGetEffectiveIamPolicies() { + // Construct request + const request = { + scope, + names, + }; + + // Run request + const response = await assetClient.batchGetEffectiveIamPolicies(request); + console.log(response); + } + + callBatchGetEffectiveIamPolicies(); + // [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index 20c0bf80b72..6d8067479e2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -39,9 +39,8 @@ function main(parent, feedId, feed) { */ // const feedId = 'abc123' /** - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id */ diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js new file mode 100644 index 00000000000..48130bd57d8 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js @@ -0,0 +1,79 @@ +// 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, savedQuery, savedQueryId) { + // [START cloudasset_v1_generated_AssetService_CreateSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id")", or a project number (such + * as "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + */ + // const savedQuery = {} + /** + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + */ + // const savedQueryId = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callCreateSavedQuery() { + // Construct request + const request = { + parent, + savedQuery, + savedQueryId, + }; + + // Run request + const response = await assetClient.createSavedQuery(request); + console.log(response); + } + + callCreateSavedQuery(); + // [END cloudasset_v1_generated_AssetService_CreateSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js new file mode 100644 index 00000000000..0d1fb0c05cc --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js @@ -0,0 +1,62 @@ +// 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 cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callDeleteSavedQuery() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteSavedQuery(request); + console.log(response); + } + + callDeleteSavedQuery(); + // [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index 97fc5e5f3ed..c9a2107938d 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -63,7 +63,8 @@ function main(parent, outputConfig) { */ // const contentType = {} /** - * Required. Output configuration indicating where the results will be output to. + * Required. Output configuration indicating where the results will be output + * to. */ // const outputConfig = {} /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js new file mode 100644 index 00000000000..c15cd1c395a --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js @@ -0,0 +1,61 @@ +// 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 cloudasset_v1_generated_AssetService_GetSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callGetSavedQuery() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getSavedQuery(request); + console.log(response); + } + + callGetSavedQuery(); + // [END cloudasset_v1_generated_AssetService_GetSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index 768cd0c6866..ae4c321b8d2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -26,10 +26,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js new file mode 100644 index 00000000000..97b7a598922 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js @@ -0,0 +1,85 @@ +// 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 cloudasset_v1_generated_AssetService_ListSavedQueries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + /** + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListSavedQueries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assetClient.listSavedQueriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSavedQueries(); + // [END cloudasset_v1_generated_AssetService_ListSavedQueries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index b0cd4dcc6b6..110dd00f85c 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -26,9 +26,9 @@ function main(scope) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the IAM policies within the `scope`. The caller must be granted - * the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the * `cloudasset.assets.searchAllIamPolicies` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: @@ -43,7 +43,7 @@ function main(scope) { * query (https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the * IAM policies within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM * policy structure, see IAM policy @@ -77,27 +77,29 @@ function main(scope) { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". */ // const query = 'abc123' /** - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. */ // const pageSize = 1234 /** - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. */ // const pageToken = 'abc123' /** - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * searchable asset * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type @@ -112,9 +114,9 @@ function main(scope) { */ // const assetTypes = 'abc123' /** - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index 20fe964d82f..8c22917886c 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -26,8 +26,9 @@ function main(scope) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the resources within the `scope`. The caller must be granted the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the * `cloudasset.assets.searchAllResources` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: @@ -79,8 +80,8 @@ function main(scope) { */ // const query = 'abc123' /** - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the searchable asset + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the searchable asset * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots resources whose asset type starts @@ -93,23 +94,24 @@ function main(scope) { */ // const assetTypes = 'abc123' /** - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. */ // const pageSize = 1234 /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. */ // const pageToken = 'abc123' /** - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * * name @@ -130,10 +132,10 @@ function main(scope) { */ // const orderBy = 'abc123' /** - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): * * name @@ -142,6 +144,9 @@ function main(scope) { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index 2b51e15f699..2cbdd3610cc 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -26,8 +26,8 @@ function main(feed, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js new file mode 100644 index 00000000000..c9c77ca777c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js @@ -0,0 +1,68 @@ +// 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(savedQuery, updateMask) { + // [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const savedQuery = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callUpdateSavedQuery() { + // Construct request + const request = { + savedQuery, + updateMask, + }; + + // Run request + const response = await assetClient.updateSavedQuery(request); + console.log(response); + } + + callUpdateSavedQuery(); + // [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index ad5e39dd0f4..9b186674bfb 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -15,14 +15,14 @@ "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_async", "title": "AssetService exportAssets Sample", "origin": "API_DEFINITION", - "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset proto as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", + "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", "canonical": true, "file": "asset_service.export_assets.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 107, + "end": 108, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 114, + "end": 115, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 68, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 180, + "end": 185, "type": "FULL" } ], @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 147, + "end": 149, "type": "FULL" } ], @@ -538,7 +538,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 78, "type": "FULL" } ], @@ -551,6 +551,10 @@ "name": "analysis_query", "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" }, + { + "name": "saved_analysis_query", + "type": "TYPE_STRING" + }, { "name": "execution_timeout", "type": ".google.protobuf.Duration" @@ -582,7 +586,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 73, "type": "FULL" } ], @@ -595,6 +599,10 @@ "name": "analysis_query", "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" }, + { + "name": "saved_analysis_query", + "type": "TYPE_STRING" + }, { "name": "output_config", "type": ".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig" @@ -662,6 +670,274 @@ } } } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_CreateSavedQuery_async", + "title": "AssetService createSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Creates a saved query in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.create_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "saved_query", + "type": ".google.cloud.asset.v1.SavedQuery" + }, + { + "name": "saved_query_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_GetSavedQuery_async", + "title": "AssetService getSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Gets details about a saved query.", + "canonical": true, + "file": "asset_service.get_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListSavedQueries_async", + "title": "AssetService listSavedQueries Sample", + "origin": "API_DEFINITION", + "description": " Lists all saved queries in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_saved_queries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.ListSavedQueriesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_UpdateSavedQuery_async", + "title": "AssetService updateSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Updates a saved query.", + "canonical": true, + "file": "asset_service.update_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "async": true, + "parameters": [ + { + "name": "saved_query", + "type": ".google.cloud.asset.v1.SavedQuery" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_DeleteSavedQuery_async", + "title": "AssetService deleteSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Deletes a saved query.", + "canonical": true, + "file": "asset_service.delete_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async", + "title": "AssetService batchGetEffectiveIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Gets effective IAM policies for a batch of resources.", + "canonical": true, + "file": "asset_service.batch_get_effective_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 1d1725ec543..f98ad77a9b0 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -175,15 +175,27 @@ export class AssetServiceClient { folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), + folderSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/savedQueries/{saved_query}' + ), inventoryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/instances/{instance}/inventory' ), organizationFeedPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), + organizationSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/savedQueries/{saved_query}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), projectFeedPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/feeds/{feed}' ), + projectSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/savedQueries/{saved_query}' + ), servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' ), @@ -208,6 +220,11 @@ export class AssetServiceClient { 'nextPageToken', 'results' ), + listSavedQueries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'savedQueries' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -315,6 +332,12 @@ export class AssetServiceClient { 'analyzeIamPolicy', 'analyzeIamPolicyLongrunning', 'analyzeMove', + 'createSavedQuery', + 'getSavedQuery', + 'listSavedQueries', + 'updateSavedQuery', + 'deleteSavedQuery', + 'batchGetEffectiveIamPolicies', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -550,9 +573,8 @@ export class AssetServiceClient { * Required. This is the client-assigned asset feed identifier and it needs to * be unique under a specific parent project/folder/organization. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] @@ -808,8 +830,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. @@ -987,8 +1009,26 @@ export class AssetServiceClient { * The request object that will be sent. * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery * Required. The request query. + * @param {string} [request.savedAnalysisQuery] + * Optional. The name of a saved query, which must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. * @param {google.protobuf.Duration} [request.executionTimeout] - * Optional. Amount of time executable has to complete. See JSON representation of + * Optional. Amount of time executable has to complete. See JSON + * representation of * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). * * If this field is set with a value less than the RPC deadline, and the @@ -1119,41 +1159,527 @@ export class AssetServiceClient { {} | undefined ] >; - analyzeMove( - request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | 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({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeMove(request, options, callback); + } + /** + * Creates a saved query in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id")", or a project number (such + * as "projects/12345"). + * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * @param {string} request.savedQueryId + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * @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 [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * 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/asset_service.create_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_CreateSavedQuery_async + */ + createSavedQuery( + request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | undefined, + {} | undefined + ] + >; + createSavedQuery( + request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + createSavedQuery( + request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + createSavedQuery( + request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + | protos.google.cloud.asset.v1.ICreateSavedQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | 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.createSavedQuery(request, options, callback); + } + /** + * Gets details about a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the saved query and it must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @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 [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * 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/asset_service.get_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_GetSavedQuery_async + */ + getSavedQuery( + request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | undefined, + {} | undefined + ] + >; + getSavedQuery( + request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + getSavedQuery( + request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + getSavedQuery( + request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | 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.getSavedQuery(request, options, callback); + } + /** + * Updates a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery + * Required. The saved query to update. + * + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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 [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * 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/asset_service.update_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_UpdateSavedQuery_async + */ + updateSavedQuery( + request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | undefined, + {} | undefined + ] + >; + updateSavedQuery( + request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSavedQuery( + request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSavedQuery( + request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + | protos.google.cloud.asset.v1.IUpdateSavedQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | 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({ + 'saved_query.name': request.savedQuery!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSavedQuery(request, options, callback); + } + /** + * Deletes a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the saved query to delete. It must be in the format + * of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @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/asset_service.delete_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_DeleteSavedQuery_async + */ + deleteSavedQuery( + request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | undefined, + {} | undefined + ] + >; + deleteSavedQuery( + request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSavedQuery( + request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSavedQuery( + request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.asset.v1.IDeleteSavedQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | 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.deleteSavedQuery(request, options, callback); + } + /** + * Gets effective IAM policies for a batch of resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. Only IAM policies on or below the scope will be returned. + * + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * + * To know how to get organization id, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * + * To know how to get folder or project id, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * @param {string[]} request.names + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * @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 [BatchGetEffectiveIamPoliciesResponse]{@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse}. + * 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/asset_service.batch_get_effective_iam_policies.js + * region_tag:cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async + */ + batchGetEffectiveIamPolicies( + request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + ( + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | undefined + ), + {} | undefined + ] + >; + batchGetEffectiveIamPolicies( + request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, options: CallOptions, callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined > ): void; - analyzeMove( - request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + batchGetEffectiveIamPolicies( + request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined > ): void; - analyzeMove( - request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + batchGetEffectiveIamPolicies( + request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + ( + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | undefined + ), {} | undefined ] > | void { @@ -1170,23 +1696,28 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - resource: request.resource || '', + scope: request.scope || '', }); this.initialize(); - return this.innerApiCalls.analyzeMove(request, options, callback); + return this.innerApiCalls.batchGetEffectiveIamPolicies( + request, + options, + callback + ); } /** * Exports assets with time and resource types to a given Cloud Storage * location/BigQuery table. For Cloud Storage location destinations, the * output format is newline-delimited JSON. Each line represents a - * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON format; for BigQuery table - * destinations, the output table stores the fields in asset proto as columns. - * This API implements the {@link google.longrunning.Operation|google.longrunning.Operation} API - * , which allows you to keep track of the export. We recommend intervals of - * at least 2 seconds with exponential retry to poll the export operation - * result. For regular-size resource parent, the export operation usually - * finishes within 5 minutes. + * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON + * format; for BigQuery table destinations, the output table stores the fields + * in asset Protobuf as columns. This API implements the + * {@link google.longrunning.Operation|google.longrunning.Operation} API, which + * allows you to keep track of the export. We recommend intervals of at least + * 2 seconds with exponential retry to poll the export operation result. For + * regular-size resource parent, the export operation usually finishes within + * 5 minutes. * * @param {Object} request * The request object that will be sent. @@ -1224,7 +1755,8 @@ export class AssetServiceClient { * Asset content type. If not specified, no content but the asset name will be * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output to. + * Required. Output configuration indicating where the results will be output + * to. * @param {string[]} request.relationshipTypes * A list of relationship types to export, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if @@ -1376,18 +1908,37 @@ export class AssetServiceClient { * accesses on which resources, and writes the analysis results to a Google * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the * output format is the JSON format that represents a - * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. This method implements the - * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation - * status. We recommend intervals of at least 2 seconds with exponential - * backoff retry to poll the operation result. The metadata contains the - * metadata for the long-running operation. + * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. + * This method implements the + * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows + * you to track the operation status. We recommend intervals of at least 2 + * seconds with exponential backoff retry to poll the operation result. The + * metadata contains the metadata for the long-running operation. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery * Required. The request query. + * @param {string} [request.savedAnalysisQuery] + * Optional. The name of a saved query, which must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output to. + * Required. Output configuration indicating where the results will be output + * to. * @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. @@ -1529,10 +2080,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -1669,10 +2221,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -1765,10 +2318,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -1863,8 +2417,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the resources within the `scope`. The caller must be granted the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -1916,8 +2471,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -1931,19 +2486,20 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * @@ -1964,10 +2520,10 @@ export class AssetServiceClient { * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -1978,6 +2534,9 @@ export class AssetServiceClient { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey @@ -2085,8 +2644,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the resources within the `scope`. The caller must be granted the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2138,8 +2698,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2153,19 +2713,20 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * @@ -2186,10 +2747,10 @@ export class AssetServiceClient { * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -2200,6 +2761,9 @@ export class AssetServiceClient { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey @@ -2255,8 +2819,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the resources within the `scope`. The caller must be granted the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2308,8 +2873,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2323,19 +2888,20 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * @@ -2356,10 +2922,10 @@ export class AssetServiceClient { * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -2370,6 +2936,9 @@ export class AssetServiceClient { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey @@ -2427,9 +2996,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the IAM policies within the `scope`. The caller must be granted - * the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2444,7 +3013,7 @@ export class AssetServiceClient { * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the * IAM policies within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM * policy structure, see [IAM policy @@ -2480,21 +3049,23 @@ export class AssetServiceClient { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2510,9 +3081,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -2613,9 +3184,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the IAM policies within the `scope`. The caller must be granted - * the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2630,7 +3201,7 @@ export class AssetServiceClient { * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the * IAM policies within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM * policy structure, see [IAM policy @@ -2666,21 +3237,23 @@ export class AssetServiceClient { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2696,9 +3269,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -2747,9 +3320,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The search is - * limited to the IAM policies within the `scope`. The caller must be granted - * the + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2764,7 +3337,7 @@ export class AssetServiceClient { * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the * IAM policies within the specified `scope`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM * policy structure, see [IAM policy @@ -2800,21 +3373,23 @@ export class AssetServiceClient { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2830,9 +3405,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of the - * results. The default order is ascending. Add " DESC" after the field name - * to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -2874,6 +3449,240 @@ export class AssetServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists all saved queries in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @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 [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * 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 `listSavedQueriesAsync()` + * 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. + */ + listSavedQueries( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest | null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse + ] + >; + listSavedQueries( + request: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse | null | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + ): void; + listSavedQueries( + request: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse | null | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + ): void; + listSavedQueries( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + | protos.google.cloud.asset.v1.IListSavedQueriesResponse + | null + | undefined, + protos.google.cloud.asset.v1.ISavedQuery + >, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse | null | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest | null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse + ] + > | 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.listSavedQueries(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 parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @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 [SavedQuery]{@link google.cloud.asset.v1.SavedQuery} 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 `listSavedQueriesAsync()` + * 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. + */ + listSavedQueriesStream( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + 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 defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.createStream( + this.innerApiCalls.listSavedQueries as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSavedQueries`, 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 parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @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 + * [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. 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/asset_service.list_saved_queries.js + * region_tag:cloudasset_v1_generated_AssetService_ListSavedQueries_async + */ + listSavedQueriesAsync( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + 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 || '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.asyncIterate( + this.innerApiCalls['listSavedQueries'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -2977,6 +3786,46 @@ export class AssetServiceClient { return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; } + /** + * Return a fully-qualified folderSavedQuery resource name string. + * + * @param {string} folder + * @param {string} saved_query + * @returns {string} Resource name string. + */ + folderSavedQueryPath(folder: string, savedQuery: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.render({ + folder: folder, + saved_query: savedQuery, + }); + } + + /** + * Parse the folder from FolderSavedQuery resource. + * + * @param {string} folderSavedQueryName + * A fully-qualified path representing folder_saved_query resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSavedQueryName(folderSavedQueryName: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.match( + folderSavedQueryName + ).folder; + } + + /** + * Parse the saved_query from FolderSavedQuery resource. + * + * @param {string} folderSavedQueryName + * A fully-qualified path representing folder_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromFolderSavedQueryName(folderSavedQueryName: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.match( + folderSavedQueryName + ).saved_query; + } + /** * Return a fully-qualified inventory resource name string. * @@ -3069,6 +3918,73 @@ export class AssetServiceClient { ).feed; } + /** + * Return a fully-qualified organizationSavedQuery resource name string. + * + * @param {string} organization + * @param {string} saved_query + * @returns {string} Resource name string. + */ + organizationSavedQueryPath(organization: string, savedQuery: string) { + return this.pathTemplates.organizationSavedQueryPathTemplate.render({ + organization: organization, + saved_query: savedQuery, + }); + } + + /** + * Parse the organization from OrganizationSavedQuery resource. + * + * @param {string} organizationSavedQueryName + * A fully-qualified path representing organization_saved_query resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSavedQueryName( + organizationSavedQueryName: string + ) { + return this.pathTemplates.organizationSavedQueryPathTemplate.match( + organizationSavedQueryName + ).organization; + } + + /** + * Parse the saved_query from OrganizationSavedQuery resource. + * + * @param {string} organizationSavedQueryName + * A fully-qualified path representing organization_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromOrganizationSavedQueryName( + organizationSavedQueryName: string + ) { + return this.pathTemplates.organizationSavedQueryPathTemplate.match( + organizationSavedQueryName + ).saved_query; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + /** * Return a fully-qualified projectFeed resource name string. * @@ -3107,6 +4023,46 @@ export class AssetServiceClient { .feed; } + /** + * Return a fully-qualified projectSavedQuery resource name string. + * + * @param {string} project + * @param {string} saved_query + * @returns {string} Resource name string. + */ + projectSavedQueryPath(project: string, savedQuery: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.render({ + project: project, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from ProjectSavedQuery resource. + * + * @param {string} projectSavedQueryName + * A fully-qualified path representing project_saved_query resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSavedQueryName(projectSavedQueryName: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.match( + projectSavedQueryName + ).project; + } + + /** + * Parse the saved_query from ProjectSavedQuery resource. + * + * @param {string} projectSavedQueryName + * A fully-qualified path representing project_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromProjectSavedQueryName(projectSavedQueryName: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.match( + projectSavedQueryName + ).saved_query; + } + /** * Return a fully-qualified servicePerimeter resource name string. * diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index ced7e2fd6b7..9be8722e81e 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -86,6 +86,30 @@ "AnalyzeMove": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSavedQueries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchGetEffectiveIamPolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/src/v1/gapic_metadata.json b/packages/google-cloud-asset/src/v1/gapic_metadata.json index 68aa629a313..1aceb2f63ab 100644 --- a/packages/google-cloud-asset/src/v1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1/gapic_metadata.json @@ -50,6 +50,31 @@ "analyzeMove" ] }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, "ExportAssets": { "methods": [ "exportAssets" @@ -80,6 +105,13 @@ "searchAllIamPoliciesStream", "searchAllIamPoliciesAsync" ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] } } }, @@ -126,6 +158,31 @@ "analyzeMove" ] }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, "ExportAssets": { "methods": [ "exportAssets" @@ -156,6 +213,13 @@ "searchAllIamPoliciesStream", "searchAllIamPoliciesAsync" ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] } } } diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 9791b5636c2..5fd697ad2ce 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -1257,15 +1257,15 @@ describe('v1.AssetServiceClient', () => { }); }); - describe('exportAssets', () => { - it('invokes exportAssets without error', async () => { + describe('createSavedQuery', () => { + it('invokes createSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1277,27 +1277,26 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportAssets(request); - const [response] = await operation.promise(); + client.innerApiCalls.createSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.createSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.exportAssets as SinonStub) + (client.innerApiCalls.createSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes exportAssets without error using callback', async () => { + it('invokes createSavedQuery without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1309,19 +1308,16 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.exportAssets = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.createSavedQuery = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.exportAssets( + client.createSavedQuery( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - > | null + result?: protos.google.cloud.asset.v1.ISavedQuery | null ) => { if (err) { reject(err); @@ -1331,27 +1327,23 @@ describe('v1.AssetServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.exportAssets as SinonStub) + (client.innerApiCalls.createSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes exportAssets with call error', async () => { + it('invokes createSavedQuery with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1363,103 +1355,46 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.exportAssets = stubLongRunningCall( + client.innerApiCalls.createSavedQuery = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.exportAssets(request), expectedError); + await assert.rejects(client.createSavedQuery(request), expectedError); assert( - (client.innerApiCalls.exportAssets as SinonStub) + (client.innerApiCalls.createSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes exportAssets with LRO error', async () => { + it('invokes createSavedQuery with closed client', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportAssets = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.exportAssets(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkExportAssetsProgress without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - 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.checkExportAssetsProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportAssetsProgress with error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - 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.checkExportAssetsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSavedQuery(request), expectedError); }); }); - describe('analyzeIamPolicyLongrunning', () => { - it('invokes analyzeIamPolicyLongrunning without error', async () => { + describe('getSavedQuery', () => { + it('invokes getSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1468,32 +1403,29 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.analyzeIamPolicyLongrunning = - stubLongRunningCall(expectedResponse); - const [operation] = await client.analyzeIamPolicyLongrunning(request); - const [response] = await operation.promise(); + client.innerApiCalls.getSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.getSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + (client.innerApiCalls.getSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { + it('invokes getSavedQuery without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1502,19 +1434,16 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.analyzeIamPolicyLongrunning = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getSavedQuery = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.analyzeIamPolicyLongrunning( + client.getSavedQuery( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata - > | null + result?: protos.google.cloud.asset.v1.ISavedQuery | null ) => { if (err) { reject(err); @@ -1524,31 +1453,26 @@ describe('v1.AssetServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + (client.innerApiCalls.getSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes analyzeIamPolicyLongrunning with call error', async () => { + it('invokes getSavedQuery with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1557,110 +1481,47 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + client.innerApiCalls.getSavedQuery = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.analyzeIamPolicyLongrunning(request), - expectedError - ); + await assert.rejects(client.getSavedQuery(request), expectedError); assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + (client.innerApiCalls.getSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { + it('invokes getSavedQuery with closed client', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.analyzeIamPolicyLongrunning(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - 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.checkAnalyzeIamPolicyLongrunningProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkAnalyzeIamPolicyLongrunningProgress with error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - 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.checkAnalyzeIamPolicyLongrunningProgress(''), - expectedError + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSavedQuery(request), expectedError); }); }); - describe('listAssets', () => { - it('invokes listAssets without error', async () => { + describe('updateSavedQuery', () => { + it('invokes updateSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedHeaderRequestParams = 'saved_query.name='; const expectedOptions = { otherArgs: { headers: { @@ -1668,32 +1529,31 @@ describe('v1.AssetServiceClient', () => { }, }, }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - ]; - client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); - const [response] = await client.listAssets(request); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.updateSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.updateSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.updateSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssets without error using callback', async () => { + it('invokes updateSavedQuery without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedHeaderRequestParams = 'saved_query.name='; const expectedOptions = { otherArgs: { headers: { @@ -1701,19 +1561,17 @@ describe('v1.AssetServiceClient', () => { }, }, }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - ]; - client.innerApiCalls.listAssets = + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.updateSavedQuery = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listAssets( + client.updateSavedQuery( request, ( err?: Error | null, - result?: protos.google.cloud.asset.v1.IAsset[] | null + result?: protos.google.cloud.asset.v1.ISavedQuery | null ) => { if (err) { reject(err); @@ -1726,23 +1584,24 @@ describe('v1.AssetServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.updateSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listAssets with error', async () => { + it('invokes updateSavedQuery with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedHeaderRequestParams = 'saved_query.name='; const expectedOptions = { otherArgs: { headers: { @@ -1751,42 +1610,1126 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listAssets = stubSimpleCall( + client.innerApiCalls.updateSavedQuery = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listAssets(request), expectedError); + await assert.rejects(client.updateSavedQuery(request), expectedError); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.updateSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssetsStream without error', async () => { + it('invokes updateSavedQuery with closed client', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSavedQuery(request), expectedError); + }); + }); + + describe('deleteSavedQuery', () => { + it('invokes deleteSavedQuery without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSavedQuery(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSavedQuery without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSavedQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSavedQuery( + 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.deleteSavedQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSavedQuery with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSavedQuery = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSavedQuery(request), expectedError); + assert( + (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSavedQuery with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSavedQuery(request), expectedError); + }); + }); + + describe('batchGetEffectiveIamPolicies', () => { + it('invokes batchGetEffectiveIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() + ); + client.innerApiCalls.batchGetEffectiveIamPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.batchGetEffectiveIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchGetEffectiveIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() + ); + client.innerApiCalls.batchGetEffectiveIamPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchGetEffectiveIamPolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchGetEffectiveIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchGetEffectiveIamPolicies(request), + expectedError + ); + assert( + (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchGetEffectiveIamPolicies with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchGetEffectiveIamPolicies(request), + expectedError + ); + }); + }); + + describe('exportAssets', () => { + it('invokes exportAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAssets(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportAssets( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportAssets with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportAssets(request), expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportAssets(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkExportAssetsProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkExportAssetsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAssetsProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkExportAssetsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('analyzeIamPolicyLongrunning', () => { + it('invokes analyzeIamPolicyLongrunning without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = + stubLongRunningCall(expectedResponse); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicyLongrunning( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeIamPolicyLongrunning with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.analyzeIamPolicyLongrunning(request), + expectedError + ); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkAnalyzeIamPolicyLongrunningProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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.checkAnalyzeIamPolicyLongrunningProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IAsset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), ]; - client.descriptors.page.listAssets.createStream = + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchAllResources', () => { + it('invokes searchAllResources without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.innerApiCalls.searchAllResources = + stubSimpleCall(expectedResponse); + const [response] = await client.searchAllResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResources without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.innerApiCalls.searchAllResources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IResourceSearchResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllResources with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAllResources(request), expectedError); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResourcesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAssetsStream(request); + const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.Asset[] = []; - stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { - responses.push(response); - }); + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -1797,40 +2740,42 @@ describe('v1.AssetServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.searchAllResources.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) - ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + .calledWith(client.innerApiCalls.searchAllResources, request) + ); + assert.strictEqual( + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listAssetsStream with error', async () => { + it('invokes searchAllResourcesStream with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listAssetsStream(request); + client.descriptors.page.searchAllResources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.Asset[] = []; - stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { - responses.push(response); - }); + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -1840,103 +2785,109 @@ describe('v1.AssetServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.searchAllResources.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.searchAllResources, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets without error', async () => { + it('uses async iteration with searchAllResources without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), ]; - client.descriptors.page.listAssets.asyncIterate = + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.asset.v1.IAsset[] = []; - const iterable = client.listAssetsAsync(request); + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + []; + const iterable = client.searchAllResourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets with error', async () => { + it('uses async iteration with searchAllResources with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listAssetsAsync(request); + client.descriptors.page.searchAllResources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllResourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IAsset[] = []; + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('searchAllResources', () => { - it('invokes searchAllResources without error', async () => { + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; @@ -1949,34 +2900,34 @@ describe('v1.AssetServiceClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllResources = + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.searchAllResources(request); + const [response] = await client.searchAllIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllResources as SinonStub) + (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllResources without error using callback', async () => { + it('invokes searchAllIamPolicies without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; @@ -1989,23 +2940,25 @@ describe('v1.AssetServiceClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllResources = + client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.searchAllResources( + client.searchAllIamPolicies( request, ( err?: Error | null, - result?: protos.google.cloud.asset.v1.IResourceSearchResult[] | null + result?: + | protos.google.cloud.asset.v1.IIamPolicySearchResult[] + | null ) => { if (err) { reject(err); @@ -2018,20 +2971,20 @@ describe('v1.AssetServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllResources as SinonStub) + (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes searchAllResources with error', async () => { + it('invokes searchAllIamPolicies with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; @@ -2043,49 +2996,49 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.searchAllResources = stubSimpleCall( + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.searchAllResources(request), expectedError); + await assert.rejects(client.searchAllIamPolicies(request), expectedError); assert( - (client.innerApiCalls.searchAllResources as SinonStub) + (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllResourcesStream without error', async () => { + it('invokes searchAllIamPoliciesStream without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllResources.createStream = + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchAllResourcesStream(request); + const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { responses.push(response); } ); @@ -2099,39 +3052,39 @@ describe('v1.AssetServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.searchAllResources.createStream as SinonStub) + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllResources, request) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.createStream as SinonStub + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes searchAllResourcesStream with error', async () => { + it('invokes searchAllIamPoliciesStream with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.createStream = + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchAllResourcesStream(request); + const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { responses.push(response); } ); @@ -2144,80 +3097,80 @@ describe('v1.AssetServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.searchAllResources.createStream as SinonStub) + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllResources, request) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.createStream as SinonStub + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllResources without error', async () => { + it('uses async iteration with searchAllIamPolicies without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllResources.asyncIterate = + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; - const iterable = client.searchAllResourcesAsync(request); + const iterable = client.searchAllIamPoliciesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllResources with error', async () => { + it('uses async iteration with searchAllIamPolicies with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.asyncIterate = + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchAllResourcesAsync(request); + const iterable = client.searchAllIamPoliciesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2225,31 +3178,31 @@ describe('v1.AssetServiceClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('searchAllIamPolicies', () => { - it('invokes searchAllIamPolicies without error', async () => { + describe('listSavedQueries', () => { + it('invokes listSavedQueries without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2258,38 +3211,31 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.innerApiCalls.searchAllIamPolicies = - stubSimpleCall(expectedResponse); - const [response] = await client.searchAllIamPolicies(request); + client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); + const [response] = await client.listSavedQueries(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) + (client.innerApiCalls.listSavedQueries as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllIamPolicies without error using callback', async () => { + it('invokes listSavedQueries without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2298,26 +3244,18 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.innerApiCalls.searchAllIamPolicies = + client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.searchAllIamPolicies( + client.listSavedQueries( request, ( err?: Error | null, - result?: - | protos.google.cloud.asset.v1.IIamPolicySearchResult[] - | null + result?: protos.google.cloud.asset.v1.ISavedQuery[] | null ) => { if (err) { reject(err); @@ -2330,23 +3268,23 @@ describe('v1.AssetServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) + (client.innerApiCalls.listSavedQueries as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes searchAllIamPolicies with error', async () => { + it('invokes listSavedQueries with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2355,49 +3293,42 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( + client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.searchAllIamPolicies(request), expectedError); + await assert.rejects(client.listSavedQueries(request), expectedError); assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) + (client.innerApiCalls.listSavedQueries as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllIamPoliciesStream without error', async () => { + it('invokes listSavedQueriesStream without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.descriptors.page.searchAllIamPolicies.createStream = + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchAllIamPoliciesStream(request); + const stream = client.listSavedQueriesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = - []; + const responses: protos.google.cloud.asset.v1.SavedQuery[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + (response: protos.google.cloud.asset.v1.SavedQuery) => { responses.push(response); } ); @@ -2411,39 +3342,38 @@ describe('v1.AssetServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + (client.descriptors.page.listSavedQueries.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + .calledWith(client.innerApiCalls.listSavedQueries, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + client.descriptors.page.listSavedQueries.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes searchAllIamPoliciesStream with error', async () => { + it('invokes listSavedQueriesStream with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.createStream = + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchAllIamPoliciesStream(request); + const stream = client.listSavedQueriesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = - []; + const responses: protos.google.cloud.asset.v1.SavedQuery[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + (response: protos.google.cloud.asset.v1.SavedQuery) => { responses.push(response); } ); @@ -2456,94 +3386,86 @@ describe('v1.AssetServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + (client.descriptors.page.listSavedQueries.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + .calledWith(client.innerApiCalls.listSavedQueries, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + client.descriptors.page.listSavedQueries.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllIamPolicies without error', async () => { + it('uses async iteration with listSavedQueries without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.descriptors.page.searchAllIamPolicies.asyncIterate = + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = - []; - const iterable = client.searchAllIamPoliciesAsync(request); + const responses: protos.google.cloud.asset.v1.ISavedQuery[] = []; + const iterable = client.listSavedQueriesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllIamPolicies with error', async () => { + it('uses async iteration with listSavedQueries with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.asyncIterate = + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchAllIamPoliciesAsync(request); + const iterable = client.listSavedQueriesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = - []; + const responses: protos.google.cloud.asset.v1.ISavedQuery[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); @@ -2690,6 +3612,61 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('folderSavedQuery', () => { + const fakePath = '/rendered/path/folderSavedQuery'; + const expectedParameters = { + folder: 'folderValue', + saved_query: 'savedQueryValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSavedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSavedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSavedQueryPath', () => { + const result = client.folderSavedQueryPath( + 'folderValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSavedQueryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSavedQueryName', () => { + const result = client.matchFolderFromFolderSavedQueryName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSavedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromFolderSavedQueryName', () => { + const result = client.matchSavedQueryFromFolderSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.folderSavedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('inventory', () => { const fakePath = '/rendered/path/inventory'; const expectedParameters = { @@ -2810,6 +3787,107 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('organizationSavedQuery', () => { + const fakePath = '/rendered/path/organizationSavedQuery'; + const expectedParameters = { + organization: 'organizationValue', + saved_query: 'savedQueryValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSavedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSavedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSavedQueryPath', () => { + const result = client.organizationSavedQueryPath( + 'organizationValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSavedQueryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSavedQueryName', () => { + const result = + client.matchOrganizationFromOrganizationSavedQueryName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromOrganizationSavedQueryName', () => { + const result = + client.matchSavedQueryFromOrganizationSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + ( + client.pathTemplates.organizationSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectFeed', () => { const fakePath = '/rendered/path/projectFeed'; const expectedParameters = { @@ -2859,6 +3937,68 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('projectSavedQuery', () => { + const fakePath = '/rendered/path/projectSavedQuery'; + const expectedParameters = { + project: 'projectValue', + saved_query: 'savedQueryValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSavedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSavedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSavedQueryPath', () => { + const result = client.projectSavedQueryPath( + 'projectValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSavedQueryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSavedQueryName', () => { + const result = client.matchProjectFromProjectSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromProjectSavedQueryName', () => { + const result = + client.matchSavedQueryFromProjectSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + ( + client.pathTemplates.projectSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servicePerimeter', () => { const fakePath = '/rendered/path/servicePerimeter'; const expectedParameters = { From ac58a714cefa0a39d69704c3962a7c436e1eead9 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 19 May 2022 15:03:07 -0700 Subject: [PATCH 395/429] test: increase sample test timeout (#628) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 08d93ee343d..48644ffe329 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -12,7 +12,7 @@ "repository": "googleapis/nodejs-asset", "private": true, "scripts": { - "test": "mocha --timeout 360000" + "test": "mocha --timeout 600000" }, "dependencies": { "@google-cloud/asset": "^3.23.1", From 08bc0c1a3907918ddd0a0189254372bcc443ead0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Jun 2022 22:15:11 +0200 Subject: [PATCH 396/429] fix(deps): update dependency @google-cloud/bigquery to v6 (#630) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 48644ffe329..4084ff185b4 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/asset": "^3.23.1", - "@google-cloud/bigquery": "^5.5.0", + "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^2.0.0", "@google-cloud/storage": "^5.0.0", "uuid": "^8.0.0", From 6f90795a2ff31d1bccb68fb5de5d71fae2e75e16 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Jun 2022 22:15:23 +0200 Subject: [PATCH 397/429] fix(deps): update dependency @google-cloud/storage to v6 (#629) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 4084ff185b4..4d17638bb18 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -18,7 +18,7 @@ "@google-cloud/asset": "^3.23.1", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^2.0.0", - "@google-cloud/storage": "^5.0.0", + "@google-cloud/storage": "^6.0.0", "uuid": "^8.0.0", "yargs": "^16.0.0" }, From 5c3a81a1bbb6b883b3675cc8aea6b020e5b494f6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:04:13 +0200 Subject: [PATCH 398/429] chore(deps): update dependency jsdoc-fresh to v2 (#632) 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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 47278a1e35d..aee9bded704 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -54,7 +54,7 @@ "codecov": "^3.6.5", "gts": "^3.1.0", "jsdoc": "^3.6.3", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", "mocha": "^9.2.2", From f095690f0723a7bc74d5a5b31b9089971db2a407 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:39:26 -0700 Subject: [PATCH 399/429] samples: fix compute test, update dependency to V3 (#634) * samples: fix compute test, update dependency to V3 --- .../google-cloud-asset/samples/package.json | 2 +- .../samples/test/sample.test.js | 68 ++++++++++++++++--- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 4d17638bb18..52b81d34f5a 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -17,7 +17,7 @@ "dependencies": { "@google-cloud/asset": "^3.23.1", "@google-cloud/bigquery": "^6.0.0", - "@google-cloud/compute": "^2.0.0", + "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", "uuid": "^8.0.0", "yargs": "^16.0.0" diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 21b1baf8378..8727a710f81 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -34,11 +34,8 @@ const options = { }; const datasetId = `asset_nodejs_${uuid.v4()}`.replace(/-/gi, '_'); -const Compute = require('@google-cloud/compute'); -const zone = new Compute().zone('us-central1-c'); -const vmName = `asset-nodejs-${uuid.v4()}`; - -let vm; +const compute = require('@google-cloud/compute'); +const instancesClient = new compute.InstancesClient(); // Some of these tests can take an extremely long time, and occasionally // timeout, see: @@ -48,17 +45,68 @@ function sleep(ms) { } describe('quickstart sample tests', () => { + let projectId; + let zone; + let instanceName; + let machineType; + let sourceImage; + let networkName; before(async () => { + zone = 'us-central1-a'; + instanceName = `asset-nodejs-${uuid.v4()}`; + machineType = 'n1-standard-1'; + sourceImage = + 'projects/ubuntu-os-cloud/global/images/family/ubuntu-1804-lts'; + networkName = 'global/networks/default'; + projectId = await instancesClient.getProjectId(); + await bucket.create(); await bigquery.createDataset(datasetId, options); await bigquery.dataset(datasetId).exists(); - [vm] = await zone.createVM(vmName, {os: 'ubuntu'}); + // [vm] = await zone.vm(vmName, {os: 'ubuntu'}); + + const [response] = await instancesClient.insert({ + instanceResource: { + name: instanceName, + disks: [ + { + // Describe the size and source image of the boot disk to attach to the instance. + initializeParams: { + diskSizeGb: '10', + sourceImage, + }, + autoDelete: true, + boot: true, + type: 'PERSISTENT', + }, + ], + machineType: `zones/${zone}/machineTypes/${machineType}`, + networkInterfaces: [ + { + // Use the network interface provided in the networkName argument. + name: networkName, + }, + ], + }, + project: projectId, + zone, + }); + let operation = response.latestResponse; + const operationsClient = new compute.ZoneOperationsClient(); + + // Wait for the create operation to complete. + while (operation.status !== 'DONE') { + [operation] = await operationsClient.wait({ + operation: operation.name, + project: projectId, + zone: operation.zone.split('/').pop(), + }); + } }); after(async () => { await bucket.delete(); await bigquery.dataset(datasetId).delete({force: true}).catch(console.warn); - await vm.delete(); }); it('should export assets to specified path', async () => { @@ -114,10 +162,10 @@ describe('quickstart sample tests', () => { assert.include(stdout, assetName); }); - it.skip('should search all resources successfully', async () => { - const query = `name:${vmName}`; + it('should search all resources successfully', async () => { + const query = `name:${instanceName}`; const stdout = execSync(`node searchAllResources '' ${query}`); - assert.include(stdout, vmName); + assert.include(stdout, instanceName); }); it('should search all iam policies successfully', async () => { From 591ddca6322ca9b717b1016dc8a86a557174bb19 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Jun 2022 01:34:39 +0200 Subject: [PATCH 400/429] chore(deps): update dependency jsdoc-region-tag to v2 (#633) Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index aee9bded704..deb77ee6751 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -55,7 +55,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^1.0.4", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.4", "mocha": "^9.2.2", "null-loader": "^4.0.0", From 4a33c7dd948dbbfb7ae73f1f0efa9f4e2730dda1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 17 Jun 2022 10:51:41 -0700 Subject: [PATCH 401/429] chore(main): release 4.0.0 (#626) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 4.0.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> --- packages/google-cloud-asset/CHANGELOG.md | 22 +++++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- ...nippet_metadata.google.cloud.asset.v1.json | 2 +- ...metadata.google.cloud.asset.v1p1beta1.json | 2 +- ...metadata.google.cloud.asset.v1p2beta1.json | 2 +- ...metadata.google.cloud.asset.v1p4beta1.json | 2 +- ...metadata.google.cloud.asset.v1p5beta1.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 8 files changed, 29 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 840585cb837..3ac392c0e93 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,28 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [4.0.0](https://github.com/googleapis/nodejs-asset/compare/v3.23.1...v4.0.0) (2022-06-16) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#625) + +### Features + +* Add SavedQuery CURD support ([#627](https://github.com/googleapis/nodejs-asset/issues/627)) ([d3727de](https://github.com/googleapis/nodejs-asset/commit/d3727de308b7f42bf974b494d4f06d7b4fc91993)) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/bigquery to v6 ([#630](https://github.com/googleapis/nodejs-asset/issues/630)) ([d779420](https://github.com/googleapis/nodejs-asset/commit/d77942087598d508cdbe1786b6b6a01d5db46174)) +* **deps:** update dependency @google-cloud/storage to v6 ([#629](https://github.com/googleapis/nodejs-asset/issues/629)) ([1fb5d23](https://github.com/googleapis/nodejs-asset/commit/1fb5d23a0384eb4f67c5c27c367c9dadda201dca)) + + +### Build System + +* update library to use Node 12 ([#625](https://github.com/googleapis/nodejs-asset/issues/625)) ([20eec3e](https://github.com/googleapis/nodejs-asset/commit/20eec3e3a5e23a469d08b0a9c415a9ad2d4c5b0d)) + ### [3.23.1](https://github.com/googleapis/nodejs-asset/compare/v3.23.0...v3.23.1) (2022-02-11) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index deb77ee6751..babfe8909f4 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "3.23.1", + "version": "4.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index 9b186674bfb..03a1d1721ad 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "3.23.1", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 9a31fa4f83a..8f0bf3c281f 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "3.23.1", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index 3087192b5d3..ff04d947b9c 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "3.23.1", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index fd1133c5f2b..de6941ede91 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "3.23.1", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index 11317ea6ba4..d23f9f175d4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "3.23.1", + "version": "4.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 52b81d34f5a..a90eadbf9a1 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^3.23.1", + "@google-cloud/asset": "^4.0.0", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", From 637c2936b000d05df12b9b3ea616013c2bc7fdd7 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:29 -0400 Subject: [PATCH 402/429] feat: support regapic LRO (#635) 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 --- .../src/v1/asset_service_client.ts | 32 ++++++++++++------- .../src/v1p1beta1/asset_service_client.ts | 11 +++---- .../src/v1p2beta1/asset_service_client.ts | 11 +++---- .../src/v1p4beta1/asset_service_client.ts | 27 +++++++++------- .../src/v1p5beta1/asset_service_client.ts | 11 +++---- 5 files changed, 50 insertions(+), 42 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index f98ad77a9b0..e76fc628c39 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class AssetServiceClient { * * @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 AssetServiceClient { * 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. @@ -228,16 +228,24 @@ export class AssetServiceClient { }; 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=*/*/operations/*/**}', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const exportAssetsResponse = protoFilesRoot.lookup( '.google.cloud.asset.v1.ExportAssetsResponse' diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index b6c159dd5b0..4af0db9a36d 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -69,7 +69,7 @@ export class AssetServiceClient { * * @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] @@ -92,11 +92,10 @@ export class AssetServiceClient { * 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. diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 202899c3822..7d31629ff3f 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -61,7 +61,7 @@ export class AssetServiceClient { * * @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] @@ -84,11 +84,10 @@ export class AssetServiceClient { * 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. diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts index 6074a83eb71..ff1a27bfd24 100644 --- a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, } from 'google-gax'; @@ -67,7 +68,7 @@ export class AssetServiceClient { * * @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] @@ -90,11 +91,10 @@ export class AssetServiceClient { * 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. @@ -158,16 +158,19 @@ export class AssetServiceClient { this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); 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 = []; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const exportIamPolicyAnalysisResponse = protoFilesRoot.lookup( '.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse' diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index f262b6f9298..056d6ba6894 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -70,7 +70,7 @@ export class AssetServiceClient { * * @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] @@ -93,11 +93,10 @@ export class AssetServiceClient { * 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. From 9bc4bc9154fef796c4683fe3a623ab14ef77ea26 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:34 +0000 Subject: [PATCH 403/429] chore(main): release 4.1.0 (#636) :robot: I have created a release *beep* *boop* --- ## [4.1.0](https://github.com/googleapis/nodejs-asset/compare/v4.0.0...v4.1.0) (2022-06-29) ### Features * support regapic LRO ([#635](https://github.com/googleapis/nodejs-asset/issues/635)) ([140ce9d](https://github.com/googleapis/nodejs-asset/commit/140ce9d312545671ad3f3f4bbcd4657081f2298e)) --- 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-asset/CHANGELOG.md | 7 +++++++ packages/google-cloud-asset/package.json | 2 +- .../v1/snippet_metadata.google.cloud.asset.v1.json | 2 +- .../snippet_metadata.google.cloud.asset.v1p1beta1.json | 2 +- .../snippet_metadata.google.cloud.asset.v1p2beta1.json | 2 +- .../snippet_metadata.google.cloud.asset.v1p4beta1.json | 2 +- .../snippet_metadata.google.cloud.asset.v1p5beta1.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 3ac392c0e93..a65a89ead8b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [4.1.0](https://github.com/googleapis/nodejs-asset/compare/v4.0.0...v4.1.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#635](https://github.com/googleapis/nodejs-asset/issues/635)) ([140ce9d](https://github.com/googleapis/nodejs-asset/commit/140ce9d312545671ad3f3f4bbcd4657081f2298e)) + ## [4.0.0](https://github.com/googleapis/nodejs-asset/compare/v3.23.1...v4.0.0) (2022-06-16) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index babfe8909f4..02084f73427 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "4.0.0", + "version": "4.1.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index 03a1d1721ad..8d55ae162da 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.0.0", + "version": "4.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 8f0bf3c281f..1bc23e650f5 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.0.0", + "version": "4.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index ff04d947b9c..d79fb5dfba8 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.0.0", + "version": "4.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index de6941ede91..aa628bb61df 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.0.0", + "version": "4.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index d23f9f175d4..1af4fd3d517 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.0.0", + "version": "4.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index a90eadbf9a1..36706abfe28 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^4.0.0", + "@google-cloud/asset": "^4.1.0", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", From 12d1b049265ba534ecfc81a1bcd662cc22342338 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 22:52:15 +0200 Subject: [PATCH 404/429] chore(deps): update dependency linkinator to v4 (#639) 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.0.4` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 02084f73427..2b8eb21dcf2 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -56,7 +56,7 @@ "jsdoc": "^3.6.3", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.4", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From 866582dc5c760ad120e642645202a5239fe3b16e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:22:19 +0000 Subject: [PATCH 405/429] chore: remove unused proto imports (#643) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API Committer: haochunzhang@ PiperOrigin-RevId: 468010360 Source-Link: https://github.com/googleapis/googleapis/commit/4bda29977c0ba0f71873967509b4b715875fe393 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ed040614d04743f16cf4e4844b716fed998f94c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGVkMDQwNjE0ZDA0NzQzZjE2Y2Y0ZTQ4NDRiNzE2ZmVkOTk4Zjk0YyJ9 feat: Release of query system Committer: lvv@ PiperOrigin-RevId: 466748663 Source-Link: https://github.com/googleapis/googleapis/commit/80d630f734c00f627511254d696149d9e0d7b635 Source-Link: https://github.com/googleapis/googleapis-gen/commit/252f5ade18a31a72f12810bbfd1d83d56a8e72e1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjUyZjVhZGUxOGEzMWE3MmYxMjgxMGJiZmQxZDgzZDU2YThlNzJlMSJ9 feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API Committer: haochunzhang@ PiperOrigin-RevId: 466134014 Source-Link: https://github.com/googleapis/googleapis/commit/63c73fb06ed5920d9a69aa212cedf7481a4e5b4e Source-Link: https://github.com/googleapis/googleapis-gen/commit/2350945f7a70ecaaecf9a1fdd7d6e70ac50e862d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjM1MDk0NWY3YTcwZWNhYWVjZjlhMWZkZDdkNmU3MGFjNTBlODYyZCJ9 --- .../google/cloud/asset/v1/asset_service.proto | 265 +- .../protos/google/cloud/asset/v1/assets.proto | 6 +- .../google/cloud/asset/v1p1beta1/assets.proto | 1 - .../cloud/asset/v1p2beta1/asset_service.proto | 2 - .../google/cloud/asset/v1p2beta1/assets.proto | 2 - .../google/cloud/asset/v1p5beta1/assets.proto | 3 - .../google-cloud-asset/protos/protos.d.ts | 1203 +++++++-- packages/google-cloud-asset/protos/protos.js | 2375 +++++++++++++++-- .../google-cloud-asset/protos/protos.json | 232 +- .../v1/asset_service.query_assets.js | 120 + .../asset_service.search_all_iam_policies.js | 4 +- .../v1/asset_service.search_all_resources.js | 8 + ...nippet_metadata.google.cloud.asset.v1.json | 74 +- .../src/v1/asset_service_client.ts | 364 ++- .../src/v1/asset_service_client_config.json | 8 +- .../src/v1/gapic_metadata.json | 10 + .../test/gapic_asset_service_v1.ts | 431 +++ 17 files changed, 4659 insertions(+), 449 deletions(-) create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index cf581222616..1c34327291d 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -26,6 +26,7 @@ import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/type/expr.proto"; @@ -197,6 +198,27 @@ service AssetService { }; } + // Issue a job that queries assets using a SQL statement compatible with + // [BigQuery Standard + // SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + // + // If the query execution finishes within timeout and there's no pagination, + // the full query results will be returned in the `QueryAssetsResponse`. + // + // Otherwise, full query results can be obtained by issuing extra requests + // with the `job_reference` from the a previous `QueryAssets` call. + // + // Note, the query result has approximately 10 GB limitation enforced by + // BigQuery + // https://cloud.google.com/bigquery/docs/best-practices-performance-output, + // queries return larger results will result in errors. + rpc QueryAssets(QueryAssetsRequest) returns (QueryAssetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=*/*}:queryAssets" + body: "*" + }; + } + // Creates a saved query in a parent project/folder/organization. rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery) { option (google.api.http) = { @@ -856,6 +878,14 @@ message SearchAllResourcesRequest { // * `labels.env:*` to find Cloud resources that have a label "env". // * `kmsKey:key` to find Cloud resources encrypted with a customer-managed // encryption key whose name contains the word "key". + // * `relationships:instance-group-1` to find Cloud resources that have + // relationships with "instance-group-1" in the related resource name. + // * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that + // have relationships of type "INSTANCE_TO_INSTANCEGROUP". + // * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + // compute instances that have relationships with "instance-group-1" in the + // compute instance group resource name, for relationship type + // "INSTANCE_TO_INSTANCEGROUP". // * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a // word. // * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain @@ -999,8 +1029,8 @@ message SearchAllIamPoliciesRequest { // compared against each Cloud IAM policy binding, including its principals, // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only // contain the bindings that match your query. To learn more about the IAM - // policy structure, see [IAM policy - // doc](https://cloud.google.com/iam/docs/policies#structure). + // policy structure, see the [IAM policy + // documentation](https://cloud.google.com/iam/help/allow-policies/structure). // // Examples: // @@ -1730,28 +1760,203 @@ message MoveImpact { string detail = 1; } -// Asset content type. -enum ContentType { - // Unspecified content type. - CONTENT_TYPE_UNSPECIFIED = 0; +// Output configuration query assets. +message QueryAssetsOutputConfig { + // BigQuery destination. + message BigQueryDestination { + // Required. The BigQuery dataset where the query results will be saved. It + // has the format of "projects/{projectId}/datasets/{datasetId}". + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - // Resource metadata. - RESOURCE = 1; + // Required. The BigQuery table where the query results will be saved. If + // this table does not exist, a new table with the given name will be + // created. + string table = 2 [(google.api.field_behavior) = REQUIRED]; - // The actual IAM policy set on a resource. - IAM_POLICY = 2; + // Specifies the action that occurs if the destination table or partition + // already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + // overwrites the entire table or all the partitions data. + // * WRITE_APPEND: If the table or partition already exists, BigQuery + // appends the data to the table or the latest partition. + // * WRITE_EMPTY: If the table already exists and contains data, an error is + // returned. + string write_disposition = 3; + } - // The Cloud Organization Policy set on an asset. - ORG_POLICY = 4; + // BigQuery destination where the query results will be saved. + BigQueryDestination bigquery_destination = 1; +} - // The Cloud Access context manager Policy set on an asset. - ACCESS_POLICY = 5; +// QueryAssets request. +message QueryAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"), + // or a folder number (such as "folders/123"). + // + // Only assets belonging to the `parent` will be returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; - // The runtime OS Inventory information. - OS_INVENTORY = 6; + oneof query { + // Optional. A SQL statement that's compatible with [BigQuery Standard + // SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + string statement = 2 [(google.api.field_behavior) = OPTIONAL]; - // The related resources. - RELATIONSHIP = 7; + // Optional. Reference to the query job, which is from the + // `QueryAssetsResponse` of previous `QueryAssets` call. + string job_reference = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The maximum number of rows to return in the results. Responses + // are limited to 10 MB and 1000 rows. + // + // By default, the maximum row count is 1000. When the byte or row count limit + // is reached, the rest of the query results will be paginated. + // + // The field will be ignored when [output_config] is specified. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from previous `QueryAssets`. + // + // The field will be ignored when [output_config] is specified. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the maximum amount of time that the client is willing + // to wait for the query to complete. By default, this limit is 5 min for the + // first query, and 1 minute for the following queries. If the query is + // complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + // false. + // + // Like BigQuery [jobs.query + // API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + // The call is not guaranteed to wait for the specified timeout; it typically + // returns after around 200 seconds (200,000 milliseconds), even if the query + // is not complete. + // + // The field will be ignored when [output_config] is specified. + google.protobuf.Duration timeout = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies what time period or point in time to query asset metadata at. + // * unset - query asset metadata as it is right now + // * [read_time_window] - query asset metadata as it was at any point in time + // between [start_time] and [end_time]. + // * [read_time] - query asset metadata as it was at that point in time. + // If data for the timestamp/date range selected does not exist, + // it will simply return a valid response with no rows. + oneof time { + // Optional. [start_time] is required. [start_time] must be less than + // [end_time] Defaults [end_time] to now if [start_time] is set and + // [end_time] isn't. Maximum permitted time range is 7 days. + TimeWindow read_time_window = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Queries cloud assets as they appeared at the specified point in + // time. + google.protobuf.Timestamp read_time = 8 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Destination where the query results will be saved. + // + // When this field is specified, the query results won't be saved in the + // [QueryAssetsResponse.query_result]. Instead + // [QueryAssetsResponse.output_config] will be set. + // + // Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + // to check the status of the query job when passed to a following + // [QueryAssets] API call. + QueryAssetsOutputConfig output_config = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// QueryAssets response. +message QueryAssetsResponse { + // Reference to a query job. + string job_reference = 1; + + // The query response, which can be either an `error` or a valid `response`. + // + // If `done` == `false` and the query result is being saved in a output, the + // output_config field will be set. + // If `done` == `true`, exactly one of + // `error`, `query_result` or `output_config` will be set. + bool done = 2; + + oneof response { + // Error status. + google.rpc.Status error = 3; + + // Result of the query. + QueryResult query_result = 4; + + // Output configuration which indicates instead of being returned in API + // response on the fly, the query result will be saved in a specific output. + QueryAssetsOutputConfig output_config = 5; + } +} + +// Execution results of the query. +// +// The result is formatted as rows represented by BigQuery compatible [schema]. +// When pagination is necessary, it will contains the page token to retrieve +// the results of following pages. +message QueryResult { + // Each row hold a query result in the format of `Struct`. + repeated google.protobuf.Struct rows = 1; + + // Describes the format of the [rows]. + TableSchema schema = 2; + + // Token to retrieve the next page of the results. + string next_page_token = 3; + + // Total rows of the whole query results. + int64 total_rows = 4; +} + +// BigQuery Compatible table schema. +message TableSchema { + // Describes the fields in a table. + repeated TableFieldSchema fields = 1; +} + +// A field in TableSchema. +message TableFieldSchema { + // The field name. The name must contain only letters (a-z, A-Z), + // numbers (0-9), or underscores (_), and must start with a letter or + // underscore. The maximum length is 128 characters. + string field = 1; + + // The field data type. Possible values include + // * STRING + // * BYTES + // * INTEGER + // * FLOAT + // * BOOLEAN + // * TIMESTAMP + // * DATE + // * TIME + // * DATETIME + // * GEOGRAPHY, + // * NUMERIC, + // * BIGNUMERIC, + // * RECORD + // (where RECORD indicates that the field contains a nested schema). + string type = 2; + + // The field mode. Possible values include NULLABLE, REQUIRED and + // REPEATED. The default value is NULLABLE. + string mode = 3; + + // Describes the nested schema fields if the type property is set + // to RECORD. + repeated TableFieldSchema fields = 4; } // A request message for @@ -1841,3 +2046,27 @@ message BatchGetEffectiveIamPoliciesResponse { // [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. repeated EffectiveIamPolicy policy_results = 2; } + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The Cloud Organization Policy set on an asset. + ORG_POLICY = 4; + + // The Cloud Access context manager Policy set on an asset. + ACCESS_POLICY = 5; + + // The runtime OS Inventory information. + OS_INVENTORY = 6; + + // The related resources. + RELATIONSHIP = 7; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index ebc093ca388..83a23693ae8 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.asset.v1; -import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/cloud/osconfig/v1/inventory.proto"; @@ -128,8 +127,8 @@ message Asset { // effectively policy is the union of both the policy set on this resource // and each policy set on all of the resource's ancestry resource levels in // the hierarchy. See - // [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for - // more information. + // [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + // for more information. google.iam.v1.Policy iam_policy = 4; // A representation of an [organization @@ -307,6 +306,7 @@ message RelatedAsset { } // A result of Resource Search, containing information of a cloud resource. +// Next ID: 29 message ResourceSearchResult { // The full resource name of this resource. Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto index 549ea688ba9..c0ac1403acc 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.asset.v1p1beta1; import "google/iam/v1/policy.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto index a19ee75fabd..92f285f8652 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -22,10 +22,8 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/asset/v1p2beta1/assets.proto"; -import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Asset.V1p2Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset"; diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto index 33d93e1c3b3..bc2a9c511f2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -17,9 +17,7 @@ syntax = "proto3"; package google.cloud.asset.v1p2beta1; -import "google/api/annotations.proto"; import "google/iam/v1/policy.proto"; -import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto index b9d1e199157..7ad133a5484 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto @@ -16,16 +16,13 @@ syntax = "proto3"; package google.cloud.asset.v1p5beta1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; -import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1p5Beta1"; diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 9e8aa4d040e..6c2a5502b27 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -228,6 +228,20 @@ export namespace google { */ public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest): Promise; + /** + * Calls QueryAssets. + * @param request QueryAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryAssetsResponse + */ + public queryAssets(request: google.cloud.asset.v1.IQueryAssetsRequest, callback: google.cloud.asset.v1.AssetService.QueryAssetsCallback): void; + + /** + * Calls QueryAssets. + * @param request QueryAssetsRequest message or plain object + * @returns Promise + */ + public queryAssets(request: google.cloud.asset.v1.IQueryAssetsRequest): Promise; + /** * Calls CreateSavedQuery. * @param request CreateSavedQueryRequest message or plain object @@ -406,6 +420,13 @@ export namespace google { */ type AnalyzeMoveCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeMoveResponse) => void; + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#queryAssets}. + * @param error Error, if any + * @param [response] QueryAssetsResponse + */ + type QueryAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.QueryAssetsResponse) => void; + /** * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. * @param error Error, if any @@ -5818,344 +5839,1095 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5, - OS_INVENTORY = 6, - RELATIONSHIP = 7 - } - - /** Properties of a BatchGetEffectiveIamPoliciesRequest. */ - interface IBatchGetEffectiveIamPoliciesRequest { - - /** BatchGetEffectiveIamPoliciesRequest scope */ - scope?: (string|null); + /** Properties of a QueryAssetsOutputConfig. */ + interface IQueryAssetsOutputConfig { - /** BatchGetEffectiveIamPoliciesRequest names */ - names?: (string[]|null); + /** QueryAssetsOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null); } - /** Represents a BatchGetEffectiveIamPoliciesRequest. */ - class BatchGetEffectiveIamPoliciesRequest implements IBatchGetEffectiveIamPoliciesRequest { + /** Represents a QueryAssetsOutputConfig. */ + class QueryAssetsOutputConfig implements IQueryAssetsOutputConfig { /** - * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * Constructs a new QueryAssetsOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest); - - /** BatchGetEffectiveIamPoliciesRequest scope. */ - public scope: string; + constructor(properties?: google.cloud.asset.v1.IQueryAssetsOutputConfig); - /** BatchGetEffectiveIamPoliciesRequest names. */ - public names: string[]; + /** QueryAssetsOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null); /** - * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * Creates a new QueryAssetsOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetEffectiveIamPoliciesRequest instance + * @returns QueryAssetsOutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + public static create(properties?: google.cloud.asset.v1.IQueryAssetsOutputConfig): google.cloud.asset.v1.QueryAssetsOutputConfig; /** - * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. - * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * Encodes the specified QueryAssetsOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. + * @param message QueryAssetsOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IQueryAssetsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. - * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * Encodes the specified QueryAssetsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. + * @param message QueryAssetsOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IQueryAssetsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetEffectiveIamPoliciesRequest + * @returns QueryAssetsOutputConfig * @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.asset.v1.BatchGetEffectiveIamPoliciesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryAssetsOutputConfig; /** - * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetEffectiveIamPoliciesRequest + * @returns QueryAssetsOutputConfig * @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.asset.v1.BatchGetEffectiveIamPoliciesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryAssetsOutputConfig; /** - * Verifies a BatchGetEffectiveIamPoliciesRequest message. + * Verifies a QueryAssetsOutputConfig 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 BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryAssetsOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetEffectiveIamPoliciesRequest + * @returns QueryAssetsOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsOutputConfig; /** - * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. - * @param message BatchGetEffectiveIamPoliciesRequest + * Creates a plain object from a QueryAssetsOutputConfig message. Also converts values to other types if specified. + * @param message QueryAssetsOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.QueryAssetsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. + * Converts this QueryAssetsOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetEffectiveIamPoliciesResponse. */ - interface IBatchGetEffectiveIamPoliciesResponse { - - /** BatchGetEffectiveIamPoliciesResponse policyResults */ - policyResults?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]|null); - } - - /** Represents a BatchGetEffectiveIamPoliciesResponse. */ - class BatchGetEffectiveIamPoliciesResponse implements IBatchGetEffectiveIamPoliciesResponse { - - /** - * Constructs a new BatchGetEffectiveIamPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse); - - /** BatchGetEffectiveIamPoliciesResponse policyResults. */ - public policyResults: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]; - - /** - * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetEffectiveIamPoliciesResponse instance - */ - public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; - - /** - * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. - * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. - * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetEffectiveIamPoliciesResponse - * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse; - - /** - * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetEffectiveIamPoliciesResponse - * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse; - - /** - * Verifies a BatchGetEffectiveIamPoliciesResponse 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 BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetEffectiveIamPoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; - - /** - * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. - * @param message BatchGetEffectiveIamPoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace QueryAssetsOutputConfig { - namespace BatchGetEffectiveIamPoliciesResponse { + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { - /** Properties of an EffectiveIamPolicy. */ - interface IEffectiveIamPolicy { + /** BigQueryDestination dataset */ + dataset?: (string|null); - /** EffectiveIamPolicy fullResourceName */ - fullResourceName?: (string|null); + /** BigQueryDestination table */ + table?: (string|null); - /** EffectiveIamPolicy policies */ - policies?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]|null); + /** BigQueryDestination writeDisposition */ + writeDisposition?: (string|null); } - /** Represents an EffectiveIamPolicy. */ - class EffectiveIamPolicy implements IEffectiveIamPolicy { + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { /** - * Constructs a new EffectiveIamPolicy. + * Constructs a new BigQueryDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy); + constructor(properties?: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination); - /** EffectiveIamPolicy fullResourceName. */ - public fullResourceName: string; + /** BigQueryDestination dataset. */ + public dataset: string; - /** EffectiveIamPolicy policies. */ - public policies: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]; + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination writeDisposition. */ + public writeDisposition: string; /** - * Creates a new EffectiveIamPolicy instance using the specified properties. + * Creates a new BigQueryDestination instance using the specified properties. * @param [properties] Properties to set - * @returns EffectiveIamPolicy instance + * @returns BigQueryDestination instance */ - public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + public static create(properties?: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; /** - * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. - * @param message EffectiveIamPolicy message or plain object to encode + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. - * @param message EffectiveIamPolicy message or plain object to encode + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * Decodes a BigQueryDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EffectiveIamPolicy + * @returns BigQueryDestination * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; /** - * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EffectiveIamPolicy + * @returns BigQueryDestination * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; /** - * Verifies an EffectiveIamPolicy message. + * Verifies a BigQueryDestination 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 EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EffectiveIamPolicy + * @returns BigQueryDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; /** - * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. - * @param message EffectiveIamPolicy + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EffectiveIamPolicy to JSON. + * Converts this BigQueryDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - namespace EffectiveIamPolicy { + /** Properties of a QueryAssetsRequest. */ + interface IQueryAssetsRequest { - /** Properties of a PolicyInfo. */ - interface IPolicyInfo { + /** QueryAssetsRequest parent */ + parent?: (string|null); - /** PolicyInfo attachedResource */ - attachedResource?: (string|null); + /** QueryAssetsRequest statement */ + statement?: (string|null); - /** PolicyInfo policy */ - policy?: (google.iam.v1.IPolicy|null); - } + /** QueryAssetsRequest jobReference */ + jobReference?: (string|null); - /** Represents a PolicyInfo. */ - class PolicyInfo implements IPolicyInfo { + /** QueryAssetsRequest pageSize */ + pageSize?: (number|null); - /** - * Constructs a new PolicyInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo); + /** QueryAssetsRequest pageToken */ + pageToken?: (string|null); - /** PolicyInfo attachedResource. */ - public attachedResource: string; + /** QueryAssetsRequest timeout */ + timeout?: (google.protobuf.IDuration|null); - /** PolicyInfo policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** QueryAssetsRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); - /** - * Creates a new PolicyInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyInfo instance - */ - public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + /** QueryAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. - * @param message PolicyInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + } - /** + /** Represents a QueryAssetsRequest. */ + class QueryAssetsRequest implements IQueryAssetsRequest { + + /** + * Constructs a new QueryAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryAssetsRequest); + + /** QueryAssetsRequest parent. */ + public parent: string; + + /** QueryAssetsRequest statement. */ + public statement?: (string|null); + + /** QueryAssetsRequest jobReference. */ + public jobReference?: (string|null); + + /** QueryAssetsRequest pageSize. */ + public pageSize: number; + + /** QueryAssetsRequest pageToken. */ + public pageToken: string; + + /** QueryAssetsRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** QueryAssetsRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** QueryAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** QueryAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + + /** QueryAssetsRequest query. */ + public query?: ("statement"|"jobReference"); + + /** QueryAssetsRequest time. */ + public time?: ("readTimeWindow"|"readTime"); + + /** + * Creates a new QueryAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryAssetsRequest): google.cloud.asset.v1.QueryAssetsRequest; + + /** + * Encodes the specified QueryAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @param message QueryAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @param message QueryAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAssetsRequest + * @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.asset.v1.QueryAssetsRequest; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAssetsRequest + * @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.asset.v1.QueryAssetsRequest; + + /** + * Verifies a QueryAssetsRequest 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 QueryAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsRequest; + + /** + * Creates a plain object from a QueryAssetsRequest message. Also converts values to other types if specified. + * @param message QueryAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryAssetsResponse. */ + interface IQueryAssetsResponse { + + /** QueryAssetsResponse jobReference */ + jobReference?: (string|null); + + /** QueryAssetsResponse done */ + done?: (boolean|null); + + /** QueryAssetsResponse error */ + error?: (google.rpc.IStatus|null); + + /** QueryAssetsResponse queryResult */ + queryResult?: (google.cloud.asset.v1.IQueryResult|null); + + /** QueryAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + } + + /** Represents a QueryAssetsResponse. */ + class QueryAssetsResponse implements IQueryAssetsResponse { + + /** + * Constructs a new QueryAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryAssetsResponse); + + /** QueryAssetsResponse jobReference. */ + public jobReference: string; + + /** QueryAssetsResponse done. */ + public done: boolean; + + /** QueryAssetsResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** QueryAssetsResponse queryResult. */ + public queryResult?: (google.cloud.asset.v1.IQueryResult|null); + + /** QueryAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + + /** QueryAssetsResponse response. */ + public response?: ("error"|"queryResult"|"outputConfig"); + + /** + * Creates a new QueryAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryAssetsResponse): google.cloud.asset.v1.QueryAssetsResponse; + + /** + * Encodes the specified QueryAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @param message QueryAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @param message QueryAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAssetsResponse + * @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.asset.v1.QueryAssetsResponse; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAssetsResponse + * @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.asset.v1.QueryAssetsResponse; + + /** + * Verifies a QueryAssetsResponse 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 QueryAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsResponse; + + /** + * Creates a plain object from a QueryAssetsResponse message. Also converts values to other types if specified. + * @param message QueryAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryResult. */ + interface IQueryResult { + + /** QueryResult rows */ + rows?: (google.protobuf.IStruct[]|null); + + /** QueryResult schema */ + schema?: (google.cloud.asset.v1.ITableSchema|null); + + /** QueryResult nextPageToken */ + nextPageToken?: (string|null); + + /** QueryResult totalRows */ + totalRows?: (number|Long|string|null); + } + + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { + + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryResult); + + /** QueryResult rows. */ + public rows: google.protobuf.IStruct[]; + + /** QueryResult schema. */ + public schema?: (google.cloud.asset.v1.ITableSchema|null); + + /** QueryResult nextPageToken. */ + public nextPageToken: string; + + /** QueryResult totalRows. */ + public totalRows: (number|Long|string); + + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryResult): google.cloud.asset.v1.QueryResult; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @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.asset.v1.QueryResult; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @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.asset.v1.QueryResult; + + /** + * Verifies a QueryResult 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 QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryResult; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableSchema. */ + interface ITableSchema { + + /** TableSchema fields */ + fields?: (google.cloud.asset.v1.ITableFieldSchema[]|null); + } + + /** Represents a TableSchema. */ + class TableSchema implements ITableSchema { + + /** + * Constructs a new TableSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITableSchema); + + /** TableSchema fields. */ + public fields: google.cloud.asset.v1.ITableFieldSchema[]; + + /** + * Creates a new TableSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TableSchema instance + */ + public static create(properties?: google.cloud.asset.v1.ITableSchema): google.cloud.asset.v1.TableSchema; + + /** + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableSchema + * @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.asset.v1.TableSchema; + + /** + * Decodes a TableSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableSchema + * @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.asset.v1.TableSchema; + + /** + * Verifies a TableSchema 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 TableSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TableSchema; + + /** + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @param message TableSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TableSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableFieldSchema. */ + interface ITableFieldSchema { + + /** TableFieldSchema field */ + field?: (string|null); + + /** TableFieldSchema type */ + type?: (string|null); + + /** TableFieldSchema mode */ + mode?: (string|null); + + /** TableFieldSchema fields */ + fields?: (google.cloud.asset.v1.ITableFieldSchema[]|null); + } + + /** Represents a TableFieldSchema. */ + class TableFieldSchema implements ITableFieldSchema { + + /** + * Constructs a new TableFieldSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITableFieldSchema); + + /** TableFieldSchema field. */ + public field: string; + + /** TableFieldSchema type. */ + public type: string; + + /** TableFieldSchema mode. */ + public mode: string; + + /** TableFieldSchema fields. */ + public fields: google.cloud.asset.v1.ITableFieldSchema[]; + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TableFieldSchema instance + */ + public static create(properties?: google.cloud.asset.v1.ITableFieldSchema): google.cloud.asset.v1.TableFieldSchema; + + /** + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableFieldSchema + * @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.asset.v1.TableFieldSchema; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableFieldSchema + * @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.asset.v1.TableFieldSchema; + + /** + * Verifies a TableFieldSchema 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 TableFieldSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableFieldSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TableFieldSchema; + + /** + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @param message TableFieldSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TableFieldSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableFieldSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetEffectiveIamPoliciesRequest. */ + interface IBatchGetEffectiveIamPoliciesRequest { + + /** BatchGetEffectiveIamPoliciesRequest scope */ + scope?: (string|null); + + /** BatchGetEffectiveIamPoliciesRequest names */ + names?: (string[]|null); + } + + /** Represents a BatchGetEffectiveIamPoliciesRequest. */ + class BatchGetEffectiveIamPoliciesRequest implements IBatchGetEffectiveIamPoliciesRequest { + + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest); + + /** BatchGetEffectiveIamPoliciesRequest scope. */ + public scope: string; + + /** BatchGetEffectiveIamPoliciesRequest names. */ + public names: string[]; + + /** + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetEffectiveIamPoliciesRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetEffectiveIamPoliciesRequest + * @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.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetEffectiveIamPoliciesRequest + * @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.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Verifies a BatchGetEffectiveIamPoliciesRequest 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 BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetEffectiveIamPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchGetEffectiveIamPoliciesResponse. */ + interface IBatchGetEffectiveIamPoliciesResponse { + + /** BatchGetEffectiveIamPoliciesResponse policyResults */ + policyResults?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]|null); + } + + /** Represents a BatchGetEffectiveIamPoliciesResponse. */ + class BatchGetEffectiveIamPoliciesResponse implements IBatchGetEffectiveIamPoliciesResponse { + + /** + * Constructs a new BatchGetEffectiveIamPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse); + + /** BatchGetEffectiveIamPoliciesResponse policyResults. */ + public policyResults: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]; + + /** + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetEffectiveIamPoliciesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetEffectiveIamPoliciesResponse + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetEffectiveIamPoliciesResponse + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Verifies a BatchGetEffectiveIamPoliciesResponse 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 BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetEffectiveIamPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchGetEffectiveIamPoliciesResponse { + + /** Properties of an EffectiveIamPolicy. */ + interface IEffectiveIamPolicy { + + /** EffectiveIamPolicy fullResourceName */ + fullResourceName?: (string|null); + + /** EffectiveIamPolicy policies */ + policies?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]|null); + } + + /** Represents an EffectiveIamPolicy. */ + class EffectiveIamPolicy implements IEffectiveIamPolicy { + + /** + * Constructs a new EffectiveIamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy); + + /** EffectiveIamPolicy fullResourceName. */ + public fullResourceName: string; + + /** EffectiveIamPolicy policies. */ + public policies: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]; + + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveIamPolicy instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveIamPolicy + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveIamPolicy + * @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.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Verifies an EffectiveIamPolicy 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 EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveIamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @param message EffectiveIamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EffectiveIamPolicy { + + /** Properties of a PolicyInfo. */ + interface IPolicyInfo { + + /** PolicyInfo attachedResource */ + attachedResource?: (string|null); + + /** PolicyInfo policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents a PolicyInfo. */ + class PolicyInfo implements IPolicyInfo { + + /** + * Constructs a new PolicyInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo); + + /** PolicyInfo attachedResource. */ + public attachedResource: string; + + /** PolicyInfo policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyInfo instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. * @param message PolicyInfo message or plain object to encode * @param [writer] Writer to encode to @@ -6213,6 +6985,17 @@ export namespace google { } } + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5, + OS_INVENTORY = 6, + RELATIONSHIP = 7 + } + /** Properties of a TemporalAsset. */ interface ITemporalAsset { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index db3d462a048..9e10617b851 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -527,6 +527,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#queryAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef QueryAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.QueryAssetsResponse} [response] QueryAssetsResponse + */ + + /** + * Calls QueryAssets. + * @function queryAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IQueryAssetsRequest} request QueryAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.QueryAssetsCallback} callback Node-style callback called with the error, if any, and QueryAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.queryAssets = function queryAssets(request, callback) { + return this.rpcCall(queryAssets, $root.google.cloud.asset.v1.QueryAssetsRequest, $root.google.cloud.asset.v1.QueryAssetsResponse, request, callback); + }, "name", { value: "QueryAssets" }); + + /** + * Calls QueryAssets. + * @function queryAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IQueryAssetsRequest} request QueryAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. * @memberof google.cloud.asset.v1.AssetService @@ -13787,50 +13820,24 @@ return MoveImpact; })(); - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - * @property {number} OS_INVENTORY=6 OS_INVENTORY value - * @property {number} RELATIONSHIP=7 RELATIONSHIP value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - values[valuesById[6] = "OS_INVENTORY"] = 6; - values[valuesById[7] = "RELATIONSHIP"] = 7; - return values; - })(); - - v1.BatchGetEffectiveIamPoliciesRequest = (function() { + v1.QueryAssetsOutputConfig = (function() { /** - * Properties of a BatchGetEffectiveIamPoliciesRequest. + * Properties of a QueryAssetsOutputConfig. * @memberof google.cloud.asset.v1 - * @interface IBatchGetEffectiveIamPoliciesRequest - * @property {string|null} [scope] BatchGetEffectiveIamPoliciesRequest scope - * @property {Array.|null} [names] BatchGetEffectiveIamPoliciesRequest names + * @interface IQueryAssetsOutputConfig + * @property {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null} [bigqueryDestination] QueryAssetsOutputConfig bigqueryDestination */ /** - * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * Constructs a new QueryAssetsOutputConfig. * @memberof google.cloud.asset.v1 - * @classdesc Represents a BatchGetEffectiveIamPoliciesRequest. - * @implements IBatchGetEffectiveIamPoliciesRequest + * @classdesc Represents a QueryAssetsOutputConfig. + * @implements IQueryAssetsOutputConfig * @constructor - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig=} [properties] Properties to set */ - function BatchGetEffectiveIamPoliciesRequest(properties) { - this.names = []; + function QueryAssetsOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13838,91 +13845,75 @@ } /** - * BatchGetEffectiveIamPoliciesRequest scope. - * @member {string} scope - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest - * @instance - */ - BatchGetEffectiveIamPoliciesRequest.prototype.scope = ""; - - /** - * BatchGetEffectiveIamPoliciesRequest names. - * @member {Array.} names - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * QueryAssetsOutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @instance */ - BatchGetEffectiveIamPoliciesRequest.prototype.names = $util.emptyArray; + QueryAssetsOutputConfig.prototype.bigqueryDestination = null; /** - * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * Creates a new QueryAssetsOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest instance + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig instance */ - BatchGetEffectiveIamPoliciesRequest.create = function create(properties) { - return new BatchGetEffectiveIamPoliciesRequest(properties); + QueryAssetsOutputConfig.create = function create(properties) { + return new QueryAssetsOutputConfig(properties); }; /** - * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * Encodes the specified QueryAssetsOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig} message QueryAssetsOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetEffectiveIamPoliciesRequest.encode = function encode(message, writer) { + QueryAssetsOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.names != null && message.names.length) - for (var i = 0; i < message.names.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * Encodes the specified QueryAssetsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig} message QueryAssetsOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetEffectiveIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + QueryAssetsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetEffectiveIamPoliciesRequest.decode = function decode(reader, length) { + QueryAssetsOutputConfig.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.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.scope = reader.string(); - break; - case 3: - if (!(message.names && message.names.length)) - message.names = []; - message.names.push(reader.string()); + message.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13933,181 +13924,2159 @@ }; /** - * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetEffectiveIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + QueryAssetsOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetEffectiveIamPoliciesRequest message. + * Verifies a QueryAssetsOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetEffectiveIamPoliciesRequest.verify = function verify(message) { + QueryAssetsOutputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.names != null && message.hasOwnProperty("names")) { - if (!Array.isArray(message.names)) - return "names: array expected"; - for (var i = 0; i < message.names.length; ++i) - if (!$util.isString(message.names[i])) - return "names: string[] expected"; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + var error = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; } return null; }; /** - * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryAssetsOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig */ - BatchGetEffectiveIamPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest) + QueryAssetsOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsOutputConfig) return object; - var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.names) { - if (!Array.isArray(object.names)) - throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names: array expected"); - message.names = []; - for (var i = 0; i < object.names.length; ++i) - message.names[i] = String(object.names[i]); + var message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig(); + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.fromObject(object.bigqueryDestination); } return message; }; /** - * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * Creates a plain object from a QueryAssetsOutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @static - * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig} message QueryAssetsOutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetEffectiveIamPoliciesRequest.toObject = function toObject(message, options) { + QueryAssetsOutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.names = []; if (options.defaults) - object.scope = ""; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - if (message.names && message.names.length) { - object.names = []; - for (var j = 0; j < message.names.length; ++j) - object.names[j] = message.names[j]; - } + object.bigqueryDestination = null; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + object.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.toObject(message.bigqueryDestination, options); return object; }; /** - * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. + * Converts this QueryAssetsOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig * @instance * @returns {Object.} JSON object */ - BatchGetEffectiveIamPoliciesRequest.prototype.toJSON = function toJSON() { + QueryAssetsOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetEffectiveIamPoliciesRequest; - })(); + QueryAssetsOutputConfig.BigQueryDestination = (function() { - v1.BatchGetEffectiveIamPoliciesResponse = (function() { + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {string|null} [writeDisposition] BigQueryDestination writeDisposition + */ - /** - * Properties of a BatchGetEffectiveIamPoliciesResponse. - * @memberof google.cloud.asset.v1 - * @interface IBatchGetEffectiveIamPoliciesResponse - * @property {Array.|null} [policyResults] BatchGetEffectiveIamPoliciesResponse policyResults - */ + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } - /** - * Constructs a new BatchGetEffectiveIamPoliciesResponse. - * @memberof google.cloud.asset.v1 - * @classdesc Represents a BatchGetEffectiveIamPoliciesResponse. - * @implements IBatchGetEffectiveIamPoliciesResponse - * @constructor - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set - */ - function BatchGetEffectiveIamPoliciesResponse(properties) { - this.policyResults = []; - 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]]; - } + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; - /** - * BatchGetEffectiveIamPoliciesResponse policyResults. - * @member {Array.} policyResults - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse - * @instance - */ - BatchGetEffectiveIamPoliciesResponse.prototype.policyResults = $util.emptyArray; + /** + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; - /** - * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse instance - */ - BatchGetEffectiveIamPoliciesResponse.create = function create(properties) { - return new BatchGetEffectiveIamPoliciesResponse(properties); - }; + /** + * BigQueryDestination writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.writeDisposition = ""; - /** - * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchGetEffectiveIamPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policyResults != null && message.policyResults.length) - for (var i = 0; i < message.policyResults.length; ++i) - $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.encode(message.policyResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; - /** - * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.writeDisposition); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.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.asset.v1.QueryAssetsOutputConfig.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataset = reader.string(); + break; + case 2: + message.table = reader.string(); + break; + case 3: + message.writeDisposition = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.writeDisposition = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + object.writeDisposition = message.writeDisposition; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BigQueryDestination; + })(); + + return QueryAssetsOutputConfig; + })(); + + v1.QueryAssetsRequest = (function() { + + /** + * Properties of a QueryAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IQueryAssetsRequest + * @property {string|null} [parent] QueryAssetsRequest parent + * @property {string|null} [statement] QueryAssetsRequest statement + * @property {string|null} [jobReference] QueryAssetsRequest jobReference + * @property {number|null} [pageSize] QueryAssetsRequest pageSize + * @property {string|null} [pageToken] QueryAssetsRequest pageToken + * @property {google.protobuf.IDuration|null} [timeout] QueryAssetsRequest timeout + * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] QueryAssetsRequest readTimeWindow + * @property {google.protobuf.ITimestamp|null} [readTime] QueryAssetsRequest readTime + * @property {google.cloud.asset.v1.IQueryAssetsOutputConfig|null} [outputConfig] QueryAssetsRequest outputConfig + */ + + /** + * Constructs a new QueryAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryAssetsRequest. + * @implements IQueryAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IQueryAssetsRequest=} [properties] Properties to set + */ + function QueryAssetsRequest(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]]; + } + + /** + * QueryAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.parent = ""; + + /** + * QueryAssetsRequest statement. + * @member {string|null|undefined} statement + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.statement = null; + + /** + * QueryAssetsRequest jobReference. + * @member {string|null|undefined} jobReference + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.jobReference = null; + + /** + * QueryAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.pageSize = 0; + + /** + * QueryAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.pageToken = ""; + + /** + * QueryAssetsRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.timeout = null; + + /** + * QueryAssetsRequest readTimeWindow. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.readTimeWindow = null; + + /** + * QueryAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.readTime = null; + + /** + * QueryAssetsRequest outputConfig. + * @member {google.cloud.asset.v1.IQueryAssetsOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.outputConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryAssetsRequest query. + * @member {"statement"|"jobReference"|undefined} query + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + Object.defineProperty(QueryAssetsRequest.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["statement", "jobReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryAssetsRequest time. + * @member {"readTimeWindow"|"readTime"|undefined} time + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + Object.defineProperty(QueryAssetsRequest.prototype, "time", { + get: $util.oneOfGetter($oneOfFields = ["readTimeWindow", "readTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.IQueryAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest instance + */ + QueryAssetsRequest.create = function create(properties) { + return new QueryAssetsRequest(properties); + }; + + /** + * Encodes the specified QueryAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.IQueryAssetsRequest} message QueryAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsRequest.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.statement != null && Object.hasOwnProperty.call(message, "statement")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.statement); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobReference); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.QueryAssetsOutputConfig.encode(message.outputConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.IQueryAssetsRequest} message QueryAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsRequest.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.asset.v1.QueryAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.statement = reader.string(); + break; + case 3: + message.jobReference = reader.string(); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); + break; + case 6: + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 8: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.statement != null && message.hasOwnProperty("statement")) { + properties.query = 1; + if (!$util.isString(message.statement)) + return "statement: string expected"; + } + if (message.jobReference != null && message.hasOwnProperty("jobReference")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.jobReference)) + return "jobReference: 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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + properties.time = 1; + { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.readTimeWindow); + if (error) + return "readTimeWindow." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.time === 1) + return "time: multiple values"; + properties.time = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a QueryAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest + */ + QueryAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.statement != null) + message.statement = String(object.statement); + if (object.jobReference != null) + message.jobReference = String(object.jobReference); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a QueryAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.QueryAssetsRequest} message QueryAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.timeout = null; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.statement != null && message.hasOwnProperty("statement")) { + object.statement = message.statement; + if (options.oneofs) + object.query = "statement"; + } + if (message.jobReference != null && message.hasOwnProperty("jobReference")) { + object.jobReference = message.jobReference; + if (options.oneofs) + object.query = "jobReference"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); + if (options.oneofs) + object.time = "readTimeWindow"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (options.oneofs) + object.time = "readTime"; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this QueryAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAssetsRequest; + })(); + + v1.QueryAssetsResponse = (function() { + + /** + * Properties of a QueryAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IQueryAssetsResponse + * @property {string|null} [jobReference] QueryAssetsResponse jobReference + * @property {boolean|null} [done] QueryAssetsResponse done + * @property {google.rpc.IStatus|null} [error] QueryAssetsResponse error + * @property {google.cloud.asset.v1.IQueryResult|null} [queryResult] QueryAssetsResponse queryResult + * @property {google.cloud.asset.v1.IQueryAssetsOutputConfig|null} [outputConfig] QueryAssetsResponse outputConfig + */ + + /** + * Constructs a new QueryAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryAssetsResponse. + * @implements IQueryAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IQueryAssetsResponse=} [properties] Properties to set + */ + function QueryAssetsResponse(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]]; + } + + /** + * QueryAssetsResponse jobReference. + * @member {string} jobReference + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.jobReference = ""; + + /** + * QueryAssetsResponse done. + * @member {boolean} done + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.done = false; + + /** + * QueryAssetsResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.error = null; + + /** + * QueryAssetsResponse queryResult. + * @member {google.cloud.asset.v1.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.queryResult = null; + + /** + * QueryAssetsResponse outputConfig. + * @member {google.cloud.asset.v1.IQueryAssetsOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.outputConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryAssetsResponse response. + * @member {"error"|"queryResult"|"outputConfig"|undefined} response + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + Object.defineProperty(QueryAssetsResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["error", "queryResult", "outputConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.IQueryAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse instance + */ + QueryAssetsResponse.create = function create(properties) { + return new QueryAssetsResponse(properties); + }; + + /** + * Encodes the specified QueryAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.IQueryAssetsResponse} message QueryAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobReference); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.asset.v1.QueryResult.encode(message.queryResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.QueryAssetsOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.IQueryAssetsResponse} message QueryAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsResponse.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.asset.v1.QueryAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobReference = reader.string(); + break; + case 2: + message.done = reader.bool(); + break; + case 3: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 4: + message.queryResult = $root.google.cloud.asset.v1.QueryResult.decode(reader, reader.uint32()); + break; + case 5: + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.jobReference != null && message.hasOwnProperty("jobReference")) + if (!$util.isString(message.jobReference)) + return "jobReference: string expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.response = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.asset.v1.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + } + return null; + }; + + /** + * Creates a QueryAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse + */ + QueryAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsResponse(); + if (object.jobReference != null) + message.jobReference = String(object.jobReference); + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.asset.v1.QueryResult.fromObject(object.queryResult); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a QueryAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.QueryAssetsResponse} message QueryAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobReference = ""; + object.done = false; + } + if (message.jobReference != null && message.hasOwnProperty("jobReference")) + object.jobReference = message.jobReference; + 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.response = "error"; + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + object.queryResult = $root.google.cloud.asset.v1.QueryResult.toObject(message.queryResult, options); + if (options.oneofs) + object.response = "queryResult"; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + object.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.toObject(message.outputConfig, options); + if (options.oneofs) + object.response = "outputConfig"; + } + return object; + }; + + /** + * Converts this QueryAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryAssetsResponse; + })(); + + v1.QueryResult = (function() { + + /** + * Properties of a QueryResult. + * @memberof google.cloud.asset.v1 + * @interface IQueryResult + * @property {Array.|null} [rows] QueryResult rows + * @property {google.cloud.asset.v1.ITableSchema|null} [schema] QueryResult schema + * @property {string|null} [nextPageToken] QueryResult nextPageToken + * @property {number|Long|null} [totalRows] QueryResult totalRows + */ + + /** + * Constructs a new QueryResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.cloud.asset.v1.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.rows = []; + 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]]; + } + + /** + * QueryResult rows. + * @member {Array.} rows + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.rows = $util.emptyArray; + + /** + * QueryResult schema. + * @member {google.cloud.asset.v1.ITableSchema|null|undefined} schema + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.schema = null; + + /** + * QueryResult nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.nextPageToken = ""; + + /** + * QueryResult totalRows. + * @member {number|Long} totalRows + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.totalRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.IQueryResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.protobuf.Struct.encode(message.rows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.asset.v1.TableSchema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalRows); + return writer; + }; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.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.asset.v1.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; + case 2: + message.schema = $root.google.cloud.asset.v1.TableSchema.decode(reader, reader.uint32()); + break; + case 3: + message.nextPageToken = reader.string(); + break; + case 4: + message.totalRows = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.asset.v1.TableSchema.verify(message.schema); + if (error) + return "schema." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalRows != null && message.hasOwnProperty("totalRows")) + if (!$util.isInteger(message.totalRows) && !(message.totalRows && $util.isInteger(message.totalRows.low) && $util.isInteger(message.totalRows.high))) + return "totalRows: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryResult) + return object; + var message = new $root.google.cloud.asset.v1.QueryResult(); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.asset.v1.QueryResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.asset.v1.QueryResult.rows: object expected"); + message.rows[i] = $root.google.protobuf.Struct.fromObject(object.rows[i]); + } + } + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.asset.v1.QueryResult.schema: object expected"); + message.schema = $root.google.cloud.asset.v1.TableSchema.fromObject(object.schema); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalRows != null) + if ($util.Long) + (message.totalRows = $util.Long.fromValue(object.totalRows)).unsigned = false; + else if (typeof object.totalRows === "string") + message.totalRows = parseInt(object.totalRows, 10); + else if (typeof object.totalRows === "number") + message.totalRows = object.totalRows; + else if (typeof object.totalRows === "object") + message.totalRows = new $util.LongBits(object.totalRows.low >>> 0, object.totalRows.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) { + object.schema = null; + object.nextPageToken = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalRows = options.longs === String ? "0" : 0; + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.protobuf.Struct.toObject(message.rows[j], options); + } + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.asset.v1.TableSchema.toObject(message.schema, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalRows != null && message.hasOwnProperty("totalRows")) + if (typeof message.totalRows === "number") + object.totalRows = options.longs === String ? String(message.totalRows) : message.totalRows; + else + object.totalRows = options.longs === String ? $util.Long.prototype.toString.call(message.totalRows) : options.longs === Number ? new $util.LongBits(message.totalRows.low >>> 0, message.totalRows.high >>> 0).toNumber() : message.totalRows; + return object; + }; + + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryResult; + })(); + + v1.TableSchema = (function() { + + /** + * Properties of a TableSchema. + * @memberof google.cloud.asset.v1 + * @interface ITableSchema + * @property {Array.|null} [fields] TableSchema fields + */ + + /** + * Constructs a new TableSchema. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TableSchema. + * @implements ITableSchema + * @constructor + * @param {google.cloud.asset.v1.ITableSchema=} [properties] Properties to set + */ + function TableSchema(properties) { + this.fields = []; + 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]]; + } + + /** + * TableSchema fields. + * @member {Array.} fields + * @memberof google.cloud.asset.v1.TableSchema + * @instance + */ + TableSchema.prototype.fields = $util.emptyArray; + + /** + * Creates a new TableSchema instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.ITableSchema=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TableSchema} TableSchema instance + */ + TableSchema.create = function create(properties) { + return new TableSchema(properties); + }; + + /** + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.ITableSchema} message TableSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.asset.v1.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.ITableSchema} message TableSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TableSchema} TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSchema.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.asset.v1.TableSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TableSchema} TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableSchema message. + * @function verify + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.asset.v1.TableFieldSchema.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a TableSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TableSchema} TableSchema + */ + TableSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TableSchema) + return object; + var message = new $root.google.cloud.asset.v1.TableSchema(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.asset.v1.TableSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.asset.v1.TableSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.asset.v1.TableFieldSchema.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.TableSchema} message TableSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.asset.v1.TableFieldSchema.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this TableSchema to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TableSchema + * @instance + * @returns {Object.} JSON object + */ + TableSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableSchema; + })(); + + v1.TableFieldSchema = (function() { + + /** + * Properties of a TableFieldSchema. + * @memberof google.cloud.asset.v1 + * @interface ITableFieldSchema + * @property {string|null} [field] TableFieldSchema field + * @property {string|null} [type] TableFieldSchema type + * @property {string|null} [mode] TableFieldSchema mode + * @property {Array.|null} [fields] TableFieldSchema fields + */ + + /** + * Constructs a new TableFieldSchema. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TableFieldSchema. + * @implements ITableFieldSchema + * @constructor + * @param {google.cloud.asset.v1.ITableFieldSchema=} [properties] Properties to set + */ + function TableFieldSchema(properties) { + this.fields = []; + 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]]; + } + + /** + * TableFieldSchema field. + * @member {string} field + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.field = ""; + + /** + * TableFieldSchema type. + * @member {string} type + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.type = ""; + + /** + * TableFieldSchema mode. + * @member {string} mode + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.mode = ""; + + /** + * TableFieldSchema fields. + * @member {Array.} fields + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.fields = $util.emptyArray; + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.ITableFieldSchema=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema instance + */ + TableFieldSchema.create = function create(properties) { + return new TableFieldSchema(properties); + }; + + /** + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.ITableFieldSchema} message TableFieldSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFieldSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mode); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.asset.v1.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.ITableFieldSchema} message TableFieldSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFieldSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFieldSchema.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.asset.v1.TableFieldSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + message.mode = reader.string(); + break; + case 4: + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFieldSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableFieldSchema message. + * @function verify + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableFieldSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + if (!$util.isString(message.mode)) + return "mode: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.asset.v1.TableFieldSchema.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a TableFieldSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema + */ + TableFieldSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TableFieldSchema) + return object; + var message = new $root.google.cloud.asset.v1.TableFieldSchema(); + if (object.field != null) + message.field = String(object.field); + if (object.type != null) + message.type = String(object.type); + if (object.mode != null) + message.mode = String(object.mode); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.asset.v1.TableFieldSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.asset.v1.TableFieldSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.asset.v1.TableFieldSchema.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.TableFieldSchema} message TableFieldSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableFieldSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) { + object.field = ""; + object.type = ""; + object.mode = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = message.mode; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.asset.v1.TableFieldSchema.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this TableFieldSchema to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + * @returns {Object.} JSON object + */ + TableFieldSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableFieldSchema; + })(); + + v1.BatchGetEffectiveIamPoliciesRequest = (function() { + + /** + * Properties of a BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetEffectiveIamPoliciesRequest + * @property {string|null} [scope] BatchGetEffectiveIamPoliciesRequest scope + * @property {Array.|null} [names] BatchGetEffectiveIamPoliciesRequest names + */ + + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetEffectiveIamPoliciesRequest. + * @implements IBatchGetEffectiveIamPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + */ + function BatchGetEffectiveIamPoliciesRequest(properties) { + this.names = []; + 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]]; + } + + /** + * BatchGetEffectiveIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.scope = ""; + + /** + * BatchGetEffectiveIamPoliciesRequest names. + * @member {Array.} names + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest instance + */ + BatchGetEffectiveIamPoliciesRequest.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesRequest(properties); + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetEffectiveIamPoliciesRequest.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.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scope = reader.string(); + break; + case 3: + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetEffectiveIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetEffectiveIamPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetEffectiveIamPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + */ + BatchGetEffectiveIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetEffectiveIamPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.scope = ""; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchGetEffectiveIamPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchGetEffectiveIamPoliciesRequest; + })(); + + v1.BatchGetEffectiveIamPoliciesResponse = (function() { + + /** + * Properties of a BatchGetEffectiveIamPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetEffectiveIamPoliciesResponse + * @property {Array.|null} [policyResults] BatchGetEffectiveIamPoliciesResponse policyResults + */ + + /** + * Constructs a new BatchGetEffectiveIamPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetEffectiveIamPoliciesResponse. + * @implements IBatchGetEffectiveIamPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set + */ + function BatchGetEffectiveIamPoliciesResponse(properties) { + this.policyResults = []; + 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]]; + } + + /** + * BatchGetEffectiveIamPoliciesResponse policyResults. + * @member {Array.} policyResults + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @instance + */ + BatchGetEffectiveIamPoliciesResponse.prototype.policyResults = $util.emptyArray; + + /** + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse instance + */ + BatchGetEffectiveIamPoliciesResponse.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesResponse(properties); + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyResults != null && message.policyResults.length) + for (var i = 0; i < message.policyResults.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.encode(message.policyResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ BatchGetEffectiveIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); @@ -14691,6 +16660,30 @@ return BatchGetEffectiveIamPoliciesResponse; })(); + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} OS_INVENTORY=6 OS_INVENTORY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[6] = "OS_INVENTORY"] = 6; + values[valuesById[7] = "RELATIONSHIP"] = 7; + return values; + })(); + v1.TemporalAsset = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index acc1f37e931..073cdd91fb8 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -261,6 +261,22 @@ } ] }, + "QueryAssets": { + "requestType": "QueryAssetsRequest", + "responseType": "QueryAssetsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}:queryAssets", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}:queryAssets", + "body": "*" + } + } + ] + }, "CreateSavedQuery": { "requestType": "CreateSavedQueryRequest", "responseType": "SavedQuery", @@ -1517,15 +1533,202 @@ } } }, - "ContentType": { - "values": { - "CONTENT_TYPE_UNSPECIFIED": 0, - "RESOURCE": 1, - "IAM_POLICY": 2, - "ORG_POLICY": 4, - "ACCESS_POLICY": 5, - "OS_INVENTORY": 6, - "RELATIONSHIP": 7 + "QueryAssetsOutputConfig": { + "fields": { + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 1 + } + }, + "nested": { + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "writeDisposition": { + "type": "string", + "id": 3 + } + } + } + } + }, + "QueryAssetsRequest": { + "oneofs": { + "query": { + "oneof": [ + "statement", + "jobReference" + ] + }, + "time": { + "oneof": [ + "readTimeWindow", + "readTime" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "statement": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobReference": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readTimeWindow": { + "type": "TimeWindow", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputConfig": { + "type": "QueryAssetsOutputConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryAssetsResponse": { + "oneofs": { + "response": { + "oneof": [ + "error", + "queryResult", + "outputConfig" + ] + } + }, + "fields": { + "jobReference": { + "type": "string", + "id": 1 + }, + "done": { + "type": "bool", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 3 + }, + "queryResult": { + "type": "QueryResult", + "id": 4 + }, + "outputConfig": { + "type": "QueryAssetsOutputConfig", + "id": 5 + } + } + }, + "QueryResult": { + "fields": { + "rows": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 1 + }, + "schema": { + "type": "TableSchema", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalRows": { + "type": "int64", + "id": 4 + } + } + }, + "TableSchema": { + "fields": { + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 1 + } + } + }, + "TableFieldSchema": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "mode": { + "type": "string", + "id": 3 + }, + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 4 + } } }, "BatchGetEffectiveIamPoliciesRequest": { @@ -1587,6 +1790,17 @@ } } }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5, + "OS_INVENTORY": 6, + "RELATIONSHIP": 7 + } + }, "TemporalAsset": { "fields": { "window": { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js new file mode 100644 index 00000000000..b84f4a568af --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js @@ -0,0 +1,120 @@ +// 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 cloudasset_v1_generated_AssetService_QueryAssets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * Only assets belonging to the `parent` will be returned. + */ + // const parent = 'abc123' + /** + * Optional. A SQL statement that's compatible with BigQuery Standard + * SQL (http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + */ + // const statement = 'abc123' + /** + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + */ + // const jobReference = 'abc123' + /** + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * The field will be ignored when output_config is specified. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from previous `QueryAssets`. + * The field will be ignored when output_config is specified. + */ + // const pageToken = 'abc123' + /** + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * Like BigQuery jobs.query + * API (https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * The field will be ignored when output_config is specified. + */ + // const timeout = {} + /** + * Optional. start_time is required. start_time must be less than + * end_time Defaults end_time to now if start_time is set and + * end_time isn't. Maximum permitted time range is 7 days. + */ + // const readTimeWindow = {} + /** + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + */ + // const readTime = {} + /** + * Optional. Destination where the query results will be saved. + * When this field is specified, the query results won't be saved in the + * QueryAssetsResponse.query_result. Instead + * QueryAssetsResponse.output_config will be set. + * Meanwhile, QueryAssetsResponse.job_reference will be set and can be used + * to check the status of the query job when passed to a following + * QueryAssets API call. + */ + // const outputConfig = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callQueryAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.queryAssets(request); + console.log(response); + } + + callQueryAssets(); + // [END cloudasset_v1_generated_AssetService_QueryAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index 110dd00f85c..4149c7d86ef 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -46,8 +46,8 @@ function main(scope) { * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM - * policy structure, see IAM policy - * doc (https://cloud.google.com/iam/docs/policies#structure). + * policy structure, see the IAM policy + * documentation (https://cloud.google.com/iam/help/allow-policies/structure). * Examples: * * `policy:amy@gmail.com` to find IAM policy bindings that specify user * "amy@gmail.com". diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index 8c22917886c..a893363d6fd 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -59,6 +59,14 @@ function main(scope) { * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed * encryption key whose name contains the word "key". + * * `relationships:instance-group-1` to find Cloud resources that have + * relationships with "instance-group-1" in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that + * have relationships of type "INSTANCE_TO_INSTANCEGROUP". + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * compute instances that have relationships with "instance-group-1" in the + * compute instance group resource name, for relationship type + * "INSTANCE_TO_INSTANCEGROUP". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index 8d55ae162da..df028f8ba00 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 185, + "end": 193, "type": "FULL" } ], @@ -671,6 +671,78 @@ } } }, + { + "regionTag": "cloudasset_v1_generated_AssetService_QueryAssets_async", + "title": "AssetService queryAssets Sample", + "origin": "API_DEFINITION", + "description": " Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. Otherwise, full query results can be obtained by issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. Note, the query result has approximately 10 GB limitation enforced by BigQuery https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger results will result in errors.", + "canonical": true, + "file": "asset_service.query_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 112, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryAssets", + "fullName": "google.cloud.asset.v1.AssetService.QueryAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "statement", + "type": "TYPE_STRING" + }, + { + "name": "job_reference", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "timeout", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time_window", + "type": ".google.cloud.asset.v1.TimeWindow" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.QueryAssetsOutputConfig" + } + ], + "resultType": ".google.cloud.asset.v1.QueryAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "QueryAssets", + "fullName": "google.cloud.asset.v1.AssetService.QueryAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, { "regionTag": "cloudasset_v1_generated_AssetService_CreateSavedQuery_async", "title": "AssetService createSavedQuery Sample", diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index e76fc628c39..ac27f5f4a84 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -340,6 +340,7 @@ export class AssetServiceClient { 'analyzeIamPolicy', 'analyzeIamPolicyLongrunning', 'analyzeMove', + 'queryAssets', 'createSavedQuery', 'getSavedQuery', 'listSavedQueries', @@ -1223,6 +1224,156 @@ export class AssetServiceClient { this.initialize(); return this.innerApiCalls.analyzeMove(request, options, callback); } + /** + * Issue a job that queries assets using a SQL statement compatible with + * [BigQuery Standard + * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + * + * If the query execution finishes within timeout and there's no pagination, + * the full query results will be returned in the `QueryAssetsResponse`. + * + * Otherwise, full query results can be obtained by issuing extra requests + * with the `job_reference` from the a previous `QueryAssets` call. + * + * Note, the query result has approximately 10 GB limitation enforced by + * BigQuery + * https://cloud.google.com/bigquery/docs/best-practices-performance-output, + * queries return larger results will result in errors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * + * Only assets belonging to the `parent` will be returned. + * @param {string} [request.statement] + * Optional. A SQL statement that's compatible with [BigQuery Standard + * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + * @param {string} [request.jobReference] + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + * @param {number} [request.pageSize] + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * + * The field will be ignored when [output_config] is specified. + * @param {string} [request.pageToken] + * Optional. A page token received from previous `QueryAssets`. + * + * The field will be ignored when [output_config] is specified. + * @param {google.protobuf.Duration} [request.timeout] + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * + * Like BigQuery [jobs.query + * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * + * The field will be ignored when [output_config] is specified. + * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] + * Optional. [start_time] is required. [start_time] must be less than + * [end_time] Defaults [end_time] to now if [start_time] is set and + * [end_time] isn't. Maximum permitted time range is 7 days. + * @param {google.protobuf.Timestamp} [request.readTime] + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig} [request.outputConfig] + * Optional. Destination where the query results will be saved. + * + * When this field is specified, the query results won't be saved in the + * [QueryAssetsResponse.query_result]. Instead + * [QueryAssetsResponse.output_config] will be set. + * + * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + * to check the status of the query job when passed to a following + * [QueryAssets] API call. + * @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 [QueryAssetsResponse]{@link google.cloud.asset.v1.QueryAssetsResponse}. + * 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/asset_service.query_assets.js + * region_tag:cloudasset_v1_generated_AssetService_QueryAssets_async + */ + queryAssets( + request?: protos.google.cloud.asset.v1.IQueryAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | undefined, + {} | undefined + ] + >; + queryAssets( + request: protos.google.cloud.asset.v1.IQueryAssetsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, + {} | null | undefined + > + ): void; + queryAssets( + request: protos.google.cloud.asset.v1.IQueryAssetsRequest, + callback: Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, + {} | null | undefined + > + ): void; + queryAssets( + request?: protos.google.cloud.asset.v1.IQueryAssetsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | 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.queryAssets(request, options, callback); + } /** * Creates a saved query in a parent project/folder/organization. * @@ -2460,6 +2611,14 @@ export class AssetServiceClient { * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed * encryption key whose name contains the word "key". + * * `relationships:instance-group-1` to find Cloud resources that have + * relationships with "instance-group-1" in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that + * have relationships of type "INSTANCE_TO_INSTANCEGROUP". + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * compute instances that have relationships with "instance-group-1" in the + * compute instance group resource name, for relationship type + * "INSTANCE_TO_INSTANCEGROUP". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain @@ -2687,6 +2846,14 @@ export class AssetServiceClient { * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed * encryption key whose name contains the word "key". + * * `relationships:instance-group-1` to find Cloud resources that have + * relationships with "instance-group-1" in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that + * have relationships of type "INSTANCE_TO_INSTANCEGROUP". + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * compute instances that have relationships with "instance-group-1" in the + * compute instance group resource name, for relationship type + * "INSTANCE_TO_INSTANCEGROUP". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain @@ -2862,6 +3029,14 @@ export class AssetServiceClient { * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed * encryption key whose name contains the word "key". + * * `relationships:instance-group-1` to find Cloud resources that have + * relationships with "instance-group-1" in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that + * have relationships of type "INSTANCE_TO_INSTANCEGROUP". + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * compute instances that have relationships with "instance-group-1" in the + * compute instance group resource name, for relationship type + * "INSTANCE_TO_INSTANCEGROUP". * * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a * word. * * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain @@ -3024,8 +3199,8 @@ export class AssetServiceClient { * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). * * Examples: * @@ -3212,8 +3387,8 @@ export class AssetServiceClient { * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). * * Examples: * @@ -3348,8 +3523,8 @@ export class AssetServiceClient { * compared against each Cloud IAM policy binding, including its principals, * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only * contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). * * Examples: * @@ -3691,6 +3866,183 @@ export class AssetServiceClient { 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 -- // -------------------- diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index 9be8722e81e..c74ddac1ee1 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -87,6 +87,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "QueryAssets": { + "timeout_millis": 200000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, "CreateSavedQuery": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" @@ -108,7 +113,8 @@ "retry_params_name": "default" }, "BatchGetEffectiveIamPolicies": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 300000, + "retry_codes_name": "unavailable", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1/gapic_metadata.json b/packages/google-cloud-asset/src/v1/gapic_metadata.json index 1aceb2f63ab..452c8a6e6af 100644 --- a/packages/google-cloud-asset/src/v1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1/gapic_metadata.json @@ -50,6 +50,11 @@ "analyzeMove" ] }, + "QueryAssets": { + "methods": [ + "queryAssets" + ] + }, "CreateSavedQuery": { "methods": [ "createSavedQuery" @@ -158,6 +163,11 @@ "analyzeMove" ] }, + "QueryAssets": { + "methods": [ + "queryAssets" + ] + }, "CreateSavedQuery": { "methods": [ "createSavedQuery" diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 5fd697ad2ce..56132b55739 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -1257,6 +1257,132 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('queryAssets', () => { + it('invokes queryAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsResponse() + ); + client.innerApiCalls.queryAssets = stubSimpleCall(expectedResponse); + const [response] = await client.queryAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes queryAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsResponse() + ); + client.innerApiCalls.queryAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IQueryAssetsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes queryAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.queryAssets(request), expectedError); + assert( + (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes queryAssets with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryAssets(request), expectedError); + }); + }); + describe('createSavedQuery', () => { it('invokes createSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ @@ -3471,6 +3597,311 @@ describe('v1.AssetServiceClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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 assetserviceModule.v1.AssetServiceClient({ + 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('accessLevel', () => { From 71294f32ef0653d7b6a872bc0a5b1d41dbad6cd6 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:04:28 +0000 Subject: [PATCH 406/429] fix: better support for fallback mode (#646) - [ ] 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 --- .../v1/asset_service.analyze_iam_policy.js | 3 + ..._service.analyze_iam_policy_longrunning.js | 3 + .../v1/asset_service.analyze_move.js | 3 + .../asset_service.batch_get_assets_history.js | 3 + ...ervice.batch_get_effective_iam_policies.js | 3 + .../generated/v1/asset_service.create_feed.js | 3 + .../v1/asset_service.create_saved_query.js | 3 + .../generated/v1/asset_service.delete_feed.js | 3 + .../v1/asset_service.delete_saved_query.js | 3 + .../v1/asset_service.export_assets.js | 3 + .../generated/v1/asset_service.get_feed.js | 3 + .../v1/asset_service.get_saved_query.js | 3 + .../generated/v1/asset_service.list_assets.js | 3 + .../generated/v1/asset_service.list_feeds.js | 3 + .../v1/asset_service.list_saved_queries.js | 3 + .../v1/asset_service.query_assets.js | 3 + .../asset_service.search_all_iam_policies.js | 3 + .../v1/asset_service.search_all_resources.js | 3 + .../generated/v1/asset_service.update_feed.js | 3 + .../v1/asset_service.update_saved_query.js | 3 + ...nippet_metadata.google.cloud.asset.v1.json | 40 ++--- .../asset_service.search_all_iam_policies.js | 3 + .../asset_service.search_all_resources.js | 3 + ...metadata.google.cloud.asset.v1p1beta1.json | 4 +- .../v1p2beta1/asset_service.create_feed.js | 3 + .../v1p2beta1/asset_service.delete_feed.js | 3 + .../v1p2beta1/asset_service.get_feed.js | 3 + .../v1p2beta1/asset_service.list_feeds.js | 3 + .../v1p2beta1/asset_service.update_feed.js | 3 + ...metadata.google.cloud.asset.v1p2beta1.json | 10 +- .../v1p5beta1/asset_service.list_assets.js | 3 + ...metadata.google.cloud.asset.v1p5beta1.json | 2 +- .../src/v1/asset_service_client.ts | 24 +-- .../src/v1p1beta1/asset_service_client.ts | 12 +- .../src/v1p2beta1/asset_service_client.ts | 3 +- .../src/v1p5beta1/asset_service_client.ts | 8 +- .../test/gapic_asset_service_v1.ts | 156 +++++++++-------- .../test/gapic_asset_service_v1p1beta1.ts | 160 ++++++++--------- .../test/gapic_asset_service_v1p2beta1.ts | 164 +++++++++--------- .../test/gapic_asset_service_v1p5beta1.ts | 160 ++++++++--------- 40 files changed, 460 insertions(+), 367 deletions(-) diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index e385da62df9..fb13179b665 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -23,6 +23,9 @@ function main(analysisQuery) { // [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_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-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index fbba9d86a41..703f46b47a7 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -23,6 +23,9 @@ function main(analysisQuery, outputConfig) { // [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_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-asset/samples/generated/v1/asset_service.analyze_move.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js index 5db1a709792..0d6bdd5b6ec 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js @@ -23,6 +23,9 @@ function main(resource, destinationParent) { // [START cloudasset_v1_generated_AssetService_AnalyzeMove_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-asset/samples/generated/v1/asset_service.batch_get_assets_history.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js index 3f098370933..da9d3d72e3e 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_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-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js index 033ae273f29..eab2d1e8c32 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js @@ -23,6 +23,9 @@ function main(scope, names) { // [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_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-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index 6d8067479e2..deeabb513b5 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -23,6 +23,9 @@ function main(parent, feedId, feed) { // [START cloudasset_v1_generated_AssetService_CreateFeed_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-asset/samples/generated/v1/asset_service.create_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js index 48130bd57d8..8870f9608ec 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js @@ -23,6 +23,9 @@ function main(parent, savedQuery, savedQueryId) { // [START cloudasset_v1_generated_AssetService_CreateSavedQuery_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-asset/samples/generated/v1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js index a812d1f86d0..876503f1204 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js @@ -23,6 +23,9 @@ function main(name) { // [START cloudasset_v1_generated_AssetService_DeleteFeed_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-asset/samples/generated/v1/asset_service.delete_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js index 0d1fb0c05cc..7ec550b0bd6 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js @@ -23,6 +23,9 @@ function main(name) { // [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_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-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index c9a2107938d..59b7182a88b 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -23,6 +23,9 @@ function main(parent, outputConfig) { // [START cloudasset_v1_generated_AssetService_ExportAssets_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-asset/samples/generated/v1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js index fa19d10604d..5662d4ab801 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js @@ -23,6 +23,9 @@ function main(name) { // [START cloudasset_v1_generated_AssetService_GetFeed_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-asset/samples/generated/v1/asset_service.get_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js index c15cd1c395a..9d54d692533 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js @@ -23,6 +23,9 @@ function main(name) { // [START cloudasset_v1_generated_AssetService_GetSavedQuery_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-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index ae4c321b8d2..29b82e4a3cd 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1_generated_AssetService_ListAssets_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-asset/samples/generated/v1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js index 40f34be94c9..46c49c07824 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1_generated_AssetService_ListFeeds_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-asset/samples/generated/v1/asset_service.list_saved_queries.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js index 97b7a598922..e1f9a66db53 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1_generated_AssetService_ListSavedQueries_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-asset/samples/generated/v1/asset_service.query_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js index b84f4a568af..09128ea3738 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1_generated_AssetService_QueryAssets_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-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index 4149c7d86ef..5c3b05e67aa 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -23,6 +23,9 @@ function main(scope) { // [START cloudasset_v1_generated_AssetService_SearchAllIamPolicies_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-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index a893363d6fd..401168ae69b 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -23,6 +23,9 @@ function main(scope) { // [START cloudasset_v1_generated_AssetService_SearchAllResources_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-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index 2cbdd3610cc..6e28a96bdfc 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -23,6 +23,9 @@ function main(feed, updateMask) { // [START cloudasset_v1_generated_AssetService_UpdateFeed_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-asset/samples/generated/v1/asset_service.update_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js index c9c77ca777c..5c30529d5d4 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js @@ -23,6 +23,9 @@ function main(savedQuery, updateMask) { // [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_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-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index df028f8ba00..ac4878611e2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 108, + "end": 111, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 115, + "end": 118, "type": "FULL" } ], @@ -146,7 +146,7 @@ "segments": [ { "start": 25, - "end": 93, + "end": 96, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -250,7 +250,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -290,7 +290,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -330,7 +330,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -374,7 +374,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 193, + "end": 196, "type": "FULL" } ], @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 149, + "end": 152, "type": "FULL" } ], @@ -538,7 +538,7 @@ "segments": [ { "start": 25, - "end": 78, + "end": 81, "type": "FULL" } ], @@ -586,7 +586,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -634,7 +634,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 70, "type": "FULL" } ], @@ -682,7 +682,7 @@ "segments": [ { "start": 25, - "end": 112, + "end": 115, "type": "FULL" } ], @@ -754,7 +754,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], @@ -802,7 +802,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -842,7 +842,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 80, "type": "FULL" } ], @@ -894,7 +894,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -938,7 +938,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -978,7 +978,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js index efca9eea6a8..8c4de0d46c0 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js @@ -23,6 +23,9 @@ function main(scope) { // [START cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_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-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js index f61f89b07d9..201744f6e9f 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js @@ -23,6 +23,9 @@ function main(scope) { // [START cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_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-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 1bc23e650f5..5d6a71705f1 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 87, + "end": 90, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 78, + "end": 81, "type": "FULL" } ], diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js index 3c5c9593d12..5a9b6fcce53 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js @@ -23,6 +23,9 @@ function main(parent, feedId, feed) { // [START cloudasset_v1p2beta1_generated_AssetService_CreateFeed_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-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js index afb214a4735..7f201ef9dae 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js @@ -23,6 +23,9 @@ function main(name) { // [START cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_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-asset/samples/generated/v1p2beta1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js index ceea2505f70..69fab689e7d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js @@ -23,6 +23,9 @@ function main(name) { // [START cloudasset_v1p2beta1_generated_AssetService_GetFeed_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-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js index b4fb74eef3f..04eaca34d72 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1p2beta1_generated_AssetService_ListFeeds_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-asset/samples/generated/v1p2beta1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js index b52f8607c19..f49d4ab1fa4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js @@ -23,6 +23,9 @@ function main(feed, updateMask) { // [START cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_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-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index d79fb5dfba8..726c55588f9 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 72, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -110,7 +110,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -150,7 +150,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -194,7 +194,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js index f009cb69c68..0306d7cec86 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js @@ -23,6 +23,9 @@ function main(parent) { // [START cloudasset_v1p5beta1_generated_AssetService_ListAssets_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-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index 1af4fd3d517..bd24cf9c8dc 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 87, + "end": 90, "type": "FULL" } ], diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index ac27f5f4a84..f2d9dda721e 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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'); /** @@ -370,7 +369,8 @@ export class AssetServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -2055,7 +2055,7 @@ export class AssetServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.exportAssets, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.asset.v1.ExportAssetsResponse, @@ -2225,7 +2225,7 @@ export class AssetServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.analyzeIamPolicyLongrunning, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, @@ -2464,7 +2464,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as gax.GaxCall, + this.innerApiCalls.listAssets as GaxCall, request, callSettings ); @@ -2563,7 +2563,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2981,7 +2981,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllResources.createStream( - this.innerApiCalls.searchAllResources as gax.GaxCall, + this.innerApiCalls.searchAllResources as GaxCall, request, callSettings ); @@ -3166,7 +3166,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3490,7 +3490,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.createStream( - this.innerApiCalls.searchAllIamPolicies as gax.GaxCall, + this.innerApiCalls.searchAllIamPolicies as GaxCall, request, callSettings ); @@ -3628,7 +3628,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3797,7 +3797,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSavedQueries.createStream( - this.innerApiCalls.listSavedQueries as gax.GaxCall, + this.innerApiCalls.listSavedQueries as GaxCall, request, callSettings ); @@ -3862,7 +3862,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.listSavedQueries.asyncIterate( this.innerApiCalls['listSavedQueries'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 4af0db9a36d..cb630357e42 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -28,7 +28,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -246,7 +245,8 @@ export class AssetServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -493,7 +493,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllResources.createStream( - this.innerApiCalls.searchAllResources as gax.GaxCall, + this.innerApiCalls.searchAllResources as GaxCall, request, callSettings ); @@ -562,7 +562,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -740,7 +740,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllIamPolicies.createStream( - this.innerApiCalls.searchAllIamPolicies as gax.GaxCall, + this.innerApiCalls.searchAllIamPolicies as GaxCall, request, callSettings ); @@ -804,7 +804,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 7d31629ff3f..5631758cf61 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -240,7 +240,8 @@ export class AssetServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 056d6ba6894..c52aee52958 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -28,7 +28,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -254,7 +253,8 @@ export class AssetServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -497,7 +497,7 @@ export class AssetServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssets.createStream( - this.innerApiCalls.listAssets as gax.GaxCall, + this.innerApiCalls.listAssets as GaxCall, request, callSettings ); @@ -566,7 +566,7 @@ export class AssetServiceClient { this.initialize(); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 56132b55739..6901fd1cbdf 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -145,99 +145,101 @@ function stubAsyncIterationCall( } describe('v1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetserviceModule.v1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1.AssetServiceClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - fallback: true, + it('has port', () => { + const port = assetserviceModule.v1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); + assert(client); }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.assetServiceStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.assetServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().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 assetserviceModule.v1.AssetServiceClient({ - 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 assetserviceModule.v1.AssetServiceClient({ + 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('batchGetAssetsHistory', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index 09f86e7f2f1..55b72abcafd 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -113,101 +113,103 @@ function stubAsyncIterationCall( } describe('v1p1beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + assert(client); }); - client.initialize(); - assert(client.assetServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); }); - assert.strictEqual(client.assetServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + 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('searchAllResources', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index 3355554e530..e6fa8b52180 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1p2beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - fallback: true, + it('has port', () => { + const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + assert(client); }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.assetServiceStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.assetServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().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 assetserviceModule.v1p2beta1.AssetServiceClient({ - 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); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + 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('createFeed', () => { diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 40c82a12fef..6d865b7fee1 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -113,101 +113,103 @@ function stubAsyncIterationCall( } describe('v1p5beta1.AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assetserviceModule.v1p5beta1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - assetserviceModule.v1p5beta1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetserviceModule.v1p5beta1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p5beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p5beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = assetserviceModule.v1p5beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.assetServiceStub, undefined); - await client.initialize(); - assert(client.assetServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); + assert(client); }); - client.initialize(); - assert(client.assetServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); }); - assert.strictEqual(client.assetServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + 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('listAssets', () => { From f04bd222bf8e08c2b99ba060301920e9ea13cfc2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:18:20 -0700 Subject: [PATCH 407/429] chore(main): release 4.2.0 (#645) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 4.2.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-asset/CHANGELOG.md | 15 +++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../snippet_metadata.google.cloud.asset.v1.json | 2 +- ...pet_metadata.google.cloud.asset.v1p1beta1.json | 2 +- ...pet_metadata.google.cloud.asset.v1p2beta1.json | 2 +- ...pet_metadata.google.cloud.asset.v1p4beta1.json | 2 +- ...pet_metadata.google.cloud.asset.v1p5beta1.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 8 files changed, 22 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index a65a89ead8b..453e86bd57b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,21 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [4.2.0](https://github.com/googleapis/nodejs-asset/compare/v4.1.0...v4.2.0) (2022-08-23) + + +### Features + +* Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API ([201d2b8](https://github.com/googleapis/nodejs-asset/commit/201d2b8431b1c04ed1b6fd90dc22ec943474aed8)) +* Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API ([201d2b8](https://github.com/googleapis/nodejs-asset/commit/201d2b8431b1c04ed1b6fd90dc22ec943474aed8)) +* Release of query system ([201d2b8](https://github.com/googleapis/nodejs-asset/commit/201d2b8431b1c04ed1b6fd90dc22ec943474aed8)) + + +### Bug Fixes + +* better support for fallback mode ([#646](https://github.com/googleapis/nodejs-asset/issues/646)) ([716c50e](https://github.com/googleapis/nodejs-asset/commit/716c50e0f0552419855d3fffd85a1d0a4fbdfe31)) +* remove pip install statements ([#649](https://github.com/googleapis/nodejs-asset/issues/649)) ([981571d](https://github.com/googleapis/nodejs-asset/commit/981571dd4c85437a437a60596d401568b8c4debe)) + ## [4.1.0](https://github.com/googleapis/nodejs-asset/compare/v4.0.0...v4.1.0) (2022-06-29) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 2b8eb21dcf2..c823631b627 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "4.1.0", + "version": "4.2.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index ac4878611e2..65ffdbc2ebe 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.1.0", + "version": "4.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 5d6a71705f1..5edea90dda2 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.1.0", + "version": "4.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index 726c55588f9..c0fbf66a547 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.1.0", + "version": "4.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index aa628bb61df..93e0593be4d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.1.0", + "version": "4.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index bd24cf9c8dc..d31d46706f9 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.1.0", + "version": "4.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 36706abfe28..67ab886b674 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^4.1.0", + "@google-cloud/asset": "^4.2.0", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", From 4d13f2031b4c40707b68e76d34247d8ae641aefe 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 20:10:13 +0000 Subject: [PATCH 408/429] fix: change import long to require (#648) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../google-cloud-asset/protos/protos.d.ts | 1860 ++- packages/google-cloud-asset/protos/protos.js | 10283 +++++++++++----- .../google-cloud-asset/protos/protos.json | 65 + .../samples/test/sample.test.js | 3 +- 4 files changed, 9392 insertions(+), 2819 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 6c2a5502b27..e808832e802 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/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 { @@ -330,140 +330,140 @@ export namespace google { namespace AssetService { /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|exportAssets}. * @param error Error, if any * @param [response] Operation */ type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listAssets}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|listAssets}. * @param error Error, if any * @param [response] ListAssetsResponse */ type ListAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetAssetsHistory}. * @param error Error, if any * @param [response] BatchGetAssetsHistoryResponse */ type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|createFeed}. * @param error Error, if any * @param [response] Feed */ type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|getFeed}. * @param error Error, if any * @param [response] Feed */ type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|listFeeds}. * @param error Error, if any * @param [response] ListFeedsResponse */ type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateFeed}. * @param error Error, if any * @param [response] Feed */ type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteFeed}. * @param error Error, if any * @param [response] Empty */ type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllResources}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllResources}. * @param error Error, if any * @param [response] SearchAllResourcesResponse */ type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllResourcesResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllIamPolicies}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllIamPolicies}. * @param error Error, if any * @param [response] SearchAllIamPoliciesResponse */ type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllIamPoliciesResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicy}. * @param error Error, if any * @param [response] AnalyzeIamPolicyResponse */ type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeIamPolicyResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicyLongrunning}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicyLongrunning}. * @param error Error, if any * @param [response] Operation */ type AnalyzeIamPolicyLongrunningCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeMove}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeMove}. * @param error Error, if any * @param [response] AnalyzeMoveResponse */ type AnalyzeMoveCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeMoveResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#queryAssets}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|queryAssets}. * @param error Error, if any * @param [response] QueryAssetsResponse */ type QueryAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.QueryAssetsResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|createSavedQuery}. * @param error Error, if any * @param [response] SavedQuery */ type CreateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|getSavedQuery}. * @param error Error, if any * @param [response] SavedQuery */ type GetSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listSavedQueries}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|listSavedQueries}. * @param error Error, if any * @param [response] ListSavedQueriesResponse */ type ListSavedQueriesCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListSavedQueriesResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateSavedQuery}. * @param error Error, if any * @param [response] SavedQuery */ type UpdateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteSavedQuery}. * @param error Error, if any * @param [response] Empty */ type DeleteSavedQueryCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetEffectiveIamPolicies}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetEffectiveIamPolicies}. * @param error Error, if any * @param [response] BatchGetEffectiveIamPoliciesResponse */ @@ -558,6 +558,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ExportAssetsRequest. */ @@ -678,6 +685,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ExportAssetsResponse. */ @@ -780,6 +794,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsRequest. */ @@ -906,6 +927,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssetsResponse. */ @@ -1008,6 +1036,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchGetAssetsHistoryRequest. */ @@ -1122,6 +1157,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetAssetsHistoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchGetAssetsHistoryResponse. */ @@ -1212,6 +1254,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetAssetsHistoryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateFeedRequest. */ @@ -1314,6 +1363,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetFeedRequest. */ @@ -1404,6 +1460,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFeedsRequest. */ @@ -1494,6 +1557,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFeedsResponse. */ @@ -1584,6 +1654,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateFeedRequest. */ @@ -1680,6 +1757,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteFeedRequest. */ @@ -1770,6 +1854,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OutputConfig. */ @@ -1869,6 +1960,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OutputResult. */ @@ -1962,6 +2060,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsOutputResult. */ @@ -2052,6 +2157,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsDestination. */ @@ -2151,6 +2263,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BigQueryDestination. */ @@ -2265,6 +2384,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a PartitionSpec. */ @@ -2355,6 +2481,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace PartitionSpec { @@ -2455,6 +2588,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FeedOutputConfig. */ @@ -2548,6 +2688,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeedOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Feed. */ @@ -2674,6 +2821,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Feed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllResourcesRequest. */ @@ -2800,6 +2954,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllResourcesResponse. */ @@ -2896,6 +3057,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllIamPoliciesRequest. */ @@ -3016,6 +3184,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllIamPoliciesResponse. */ @@ -3112,6 +3287,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IamPolicyAnalysisQuery. */ @@ -3232,6 +3414,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicyAnalysisQuery { @@ -3324,6 +3513,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IdentitySelector. */ @@ -3414,6 +3610,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentitySelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AccessSelector. */ @@ -3510,6 +3713,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Options. */ @@ -3630,6 +3840,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Options + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ConditionContext. */ @@ -3723,6 +3940,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -3826,6 +4050,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnalyzeIamPolicyResponse. */ @@ -3928,6 +4159,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnalyzeIamPolicyResponse { @@ -4038,6 +4276,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -4138,6 +4383,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicyAnalysisOutputConfig { @@ -4230,6 +4482,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BigQueryDestination. */ @@ -4338,6 +4597,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BigQueryDestination { @@ -4450,6 +4716,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnalyzeIamPolicyLongrunningResponse. */ @@ -4534,6 +4807,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SavedQuery. */ @@ -4666,6 +4946,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SavedQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace SavedQuery { @@ -4761,6 +5048,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -4864,6 +5158,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSavedQueryRequest. */ @@ -4954,6 +5255,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSavedQueriesRequest. */ @@ -5062,6 +5370,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSavedQueriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListSavedQueriesResponse. */ @@ -5158,6 +5473,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSavedQueriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateSavedQueryRequest. */ @@ -5254,6 +5576,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteSavedQueryRequest. */ @@ -5344,6 +5673,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnalyzeMoveRequest. */ @@ -5446,6 +5782,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeMoveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnalyzeMoveRequest { @@ -5546,6 +5889,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeMoveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MoveAnalysis. */ @@ -5651,6 +6001,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveAnalysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MoveAnalysisResult. */ @@ -5747,6 +6104,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MoveImpact. */ @@ -5837,6 +6201,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveImpact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a QueryAssetsOutputConfig. */ @@ -5927,6 +6298,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAssetsOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace QueryAssetsOutputConfig { @@ -6031,6 +6409,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6176,6 +6561,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a QueryAssetsResponse. */ @@ -6293,6 +6685,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a QueryResult. */ @@ -6401,6 +6800,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableSchema. */ @@ -6491,6 +6897,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableFieldSchema. */ @@ -6599,6 +7012,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableFieldSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchGetEffectiveIamPoliciesRequest. */ @@ -6695,6 +7115,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchGetEffectiveIamPoliciesResponse. */ @@ -6785,6 +7212,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BatchGetEffectiveIamPoliciesResponse { @@ -6883,6 +7317,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EffectiveIamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace EffectiveIamPolicy { @@ -6981,6 +7422,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -7108,6 +7556,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemporalAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace TemporalAsset { @@ -7216,6 +7671,13 @@ export namespace google { * @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 an Asset. */ @@ -7381,6 +7843,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Resource. */ @@ -7507,6 +7976,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelatedAssets. */ @@ -7603,6 +8079,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAssets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelationshipAttributes. */ @@ -7711,6 +8194,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelationshipAttributes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelatedAsset. */ @@ -7819,6 +8309,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ResourceSearchResult. */ @@ -8041,6 +8538,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a VersionedResource. */ @@ -8137,6 +8641,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AttachedResource. */ @@ -8233,6 +8744,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelatedResources. */ @@ -8323,6 +8841,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelatedResource. */ @@ -8419,6 +8944,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IamPolicySearchResult. */ @@ -8545,6 +9077,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicySearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicySearchResult { @@ -8637,6 +9176,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Explanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Explanation { @@ -8729,6 +9275,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Permissions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -8827,6 +9380,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ConditionEvaluation. */ @@ -8917,6 +9477,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionEvaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ConditionEvaluation { @@ -9042,6 +9609,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicyAnalysisResult { @@ -9140,6 +9714,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Access. */ @@ -9245,6 +9826,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Access + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Identity. */ @@ -9341,6 +9929,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Identity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Edge. */ @@ -9437,7 +10032,14 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; - } + + /** + * Gets the default type url for Edge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } /** Properties of an AccessControlList. */ interface IAccessControlList { @@ -9545,6 +10147,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessControlList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IdentityList. */ @@ -9641,6 +10250,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentityList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -9700,14 +10316,14 @@ export namespace google { namespace AssetService { /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllResources}. * @param error Error, if any * @param [response] SearchAllResourcesResponse */ type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllIamPolicies}. * @param error Error, if any * @param [response] SearchAllIamPoliciesResponse */ @@ -9832,6 +10448,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllResourcesResponse. */ @@ -9928,6 +10551,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllIamPoliciesRequest. */ @@ -10036,6 +10666,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllIamPoliciesResponse. */ @@ -10132,6 +10769,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StandardResourceMetadata. */ @@ -10270,6 +10914,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardResourceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IamPolicySearchResult. */ @@ -10378,6 +11029,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicySearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicySearchResult { @@ -10470,6 +11128,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Explanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10561,6 +11226,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Permissions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -10661,35 +11333,35 @@ export namespace google { namespace AssetService { /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|createFeed}. * @param error Error, if any * @param [response] Feed */ type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|getFeed}. * @param error Error, if any * @param [response] Feed */ type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|listFeeds}. * @param error Error, if any * @param [response] ListFeedsResponse */ type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|updateFeed}. * @param error Error, if any * @param [response] Feed */ type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|deleteFeed}. * @param error Error, if any * @param [response] Empty */ @@ -10796,6 +11468,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetFeedRequest. */ @@ -10886,6 +11565,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFeedsRequest. */ @@ -10976,6 +11662,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListFeedsResponse. */ @@ -11066,6 +11759,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateFeedRequest. */ @@ -11162,6 +11862,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteFeedRequest. */ @@ -11252,6 +11959,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OutputConfig. */ @@ -11345,6 +12059,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GcsDestination. */ @@ -11438,6 +12159,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a PubsubDestination. */ @@ -11528,6 +12256,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FeedOutputConfig. */ @@ -11621,6 +12356,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeedOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Feed. */ @@ -11735,6 +12477,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Feed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** ContentType enum. */ @@ -11844,6 +12593,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemporalAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TimeWindow. */ @@ -11940,6 +12696,13 @@ export namespace google { * @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 an Asset. */ @@ -12054,6 +12817,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Resource. */ @@ -12174,6 +12944,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -12232,14 +13009,14 @@ export namespace google { namespace AssetService { /** - * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#analyzeIamPolicy}. + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService|analyzeIamPolicy}. * @param error Error, if any * @param [response] AnalyzeIamPolicyResponse */ type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#exportIamPolicyAnalysis}. + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService|exportIamPolicyAnalysis}. * @param error Error, if any * @param [response] Operation */ @@ -12352,6 +13129,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicyAnalysisQuery { @@ -12444,6 +13228,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IdentitySelector. */ @@ -12534,6 +13325,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentitySelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AccessSelector. */ @@ -12630,6 +13428,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -12727,6 +13532,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnalyzeIamPolicyRequest { @@ -12855,6 +13667,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Options + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -12964,6 +13783,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnalyzeIamPolicyResponse { @@ -13068,6 +13894,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -13162,6 +13995,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicyAnalysisOutputConfig { @@ -13254,6 +14094,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -13357,6 +14204,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIamPolicyAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ExportIamPolicyAnalysisRequest { @@ -13479,6 +14333,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Options + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -13570,6 +14431,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportIamPolicyAnalysisResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IamPolicyAnalysisResult. */ @@ -13684,6 +14552,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace IamPolicyAnalysisResult { @@ -13782,6 +14657,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalysisState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Resource. */ @@ -13878,6 +14760,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Access. */ @@ -13983,6 +14872,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Access + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Edge. */ @@ -14079,6 +14975,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Edge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Identity. */ @@ -14175,6 +15078,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Identity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AccessControlList. */ @@ -14277,6 +15187,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessControlList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an IdentityList. */ @@ -14373,6 +15290,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentityList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -14418,7 +15342,7 @@ export namespace google { namespace AssetService { /** - * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService#listAssets}. + * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService|listAssets}. * @param error Error, if any * @param [response] ListAssetsResponse */ @@ -14543,6 +15467,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** ContentType enum. */ @@ -14654,6 +15585,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Asset. */ @@ -14795,6 +15733,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Resource. */ @@ -14915,6 +15860,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -15052,6 +16004,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Policy { @@ -15168,6 +16127,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ListPolicy { @@ -15268,6 +16234,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BooleanPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RestoreDefault. */ @@ -15352,6 +16325,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -15469,6 +16449,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Inventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Inventory { @@ -15603,6 +16590,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Item. */ @@ -15732,6 +16726,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Item { @@ -15889,6 +16890,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftwarePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a VersionedPackage. */ @@ -15991,6 +16999,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionedPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ZypperPatch. */ @@ -16099,6 +17114,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperPatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WindowsUpdatePackage. */ @@ -16237,6 +17259,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace WindowsUpdatePackage { @@ -16335,6 +17364,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -16444,6 +17480,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WindowsApplication. */ @@ -16558,6 +17601,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -16655,6 +17705,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInventoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListInventoriesRequest. */ @@ -16769,6 +17826,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListInventoriesResponse. */ @@ -16865,6 +17929,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** InventoryView enum. */ @@ -16974,6 +18045,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. */ @@ -17121,6 +18199,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. */ @@ -17217,6 +18302,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. */ @@ -17355,6 +18447,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 { @@ -17467,6 +18566,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; } } @@ -17561,6 +18667,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. */ @@ -17601,6 +18714,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -17648,6 +18764,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 @@ -17717,6 +18836,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. */ @@ -17861,6 +18987,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 { @@ -17965,6 +19098,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. */ @@ -18061,6 +19201,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; } } @@ -18152,6 +19299,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. */ @@ -18302,6 +19456,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 { @@ -18430,6 +19591,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. */ @@ -18544,6 +19712,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 { @@ -18642,6 +19817,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; } } @@ -18745,6 +19927,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. */ @@ -18847,7 +20036,14 @@ 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. */ interface IMethodDescriptorProto { @@ -18967,6 +20163,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. */ @@ -19180,6 +20383,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 { @@ -19307,6 +20517,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. */ @@ -19324,6 +20541,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -19361,6 +20581,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -19439,6 +20662,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 { @@ -19546,6 +20776,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. */ @@ -19648,6 +20885,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. */ @@ -19744,6 +20988,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. */ @@ -19846,6 +21097,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. */ @@ -19957,6 +21215,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 { @@ -20093,6 +21358,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 { @@ -20191,6 +21463,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; } } @@ -20282,6 +21561,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 { @@ -20398,6 +21684,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; } } @@ -20489,6 +21782,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 { @@ -20507,6 +21807,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. */ @@ -20530,6 +21833,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 @@ -20599,6 +21905,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 + } } } @@ -20684,6 +22007,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 Timestamp. */ @@ -20780,6 +22110,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Struct. */ @@ -20870,6 +22207,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Value. */ @@ -20993,6 +22337,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** NullValue enum. */ @@ -21088,6 +22439,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Any. */ @@ -21184,6 +22542,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. */ @@ -21280,6 +22645,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 a FieldMask. */ @@ -21370,6 +22742,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; } } @@ -21476,6 +22855,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Expr. */ @@ -21584,6 +22970,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -21602,6 +22995,9 @@ export namespace google { /** Policy bindings */ bindings?: (google.iam.v1.IBinding[]|null); + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + /** Policy etag */ etag?: (Uint8Array|string|null); } @@ -21621,6 +23017,9 @@ export namespace google { /** Policy bindings. */ public bindings: google.iam.v1.IBinding[]; + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + /** Policy etag. */ public etag: (Uint8Array|string); @@ -21693,6 +23092,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Binding. */ @@ -21795,6 +23201,230 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } } /** Properties of a PolicyDelta. */ @@ -21891,6 +23521,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BindingDelta. */ @@ -21999,6 +23636,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BindingDelta { @@ -22117,6 +23761,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AuditConfigDelta { @@ -22267,6 +23918,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BasicLevel. */ @@ -22363,6 +24021,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BasicLevel { @@ -22492,6 +24157,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CustomLevel. */ @@ -22582,6 +24254,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DevicePolicy. */ @@ -22702,6 +24381,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DevicePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OsConstraint. */ @@ -22804,6 +24490,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AccessPolicy. */ @@ -22924,6 +24617,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ServicePerimeter. */ @@ -23062,6 +24762,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ServicePerimeter { @@ -23179,6 +24886,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ServicePerimeterConfig { @@ -23277,6 +24991,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccessibleServices + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -23438,6 +25159,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; } } @@ -23538,35 +25266,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 */ @@ -23688,6 +25416,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. */ @@ -23778,6 +25513,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. */ @@ -23886,6 +25628,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. */ @@ -23982,6 +25731,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. */ @@ -24072,6 +25828,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. */ @@ -24162,6 +25925,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. */ @@ -24258,6 +26028,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. */ @@ -24354,6 +26131,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; } } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 9e10617b851..f307e50657c 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|exportAssets}. * @memberof google.cloud.asset.v1.AssetService * @typedef ExportAssetsCallback * @type {function} @@ -132,7 +132,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listAssets}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|listAssets}. * @memberof google.cloud.asset.v1.AssetService * @typedef ListAssetsCallback * @type {function} @@ -165,7 +165,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetAssetsHistory}. * @memberof google.cloud.asset.v1.AssetService * @typedef BatchGetAssetsHistoryCallback * @type {function} @@ -198,7 +198,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|createFeed}. * @memberof google.cloud.asset.v1.AssetService * @typedef CreateFeedCallback * @type {function} @@ -231,7 +231,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|getFeed}. * @memberof google.cloud.asset.v1.AssetService * @typedef GetFeedCallback * @type {function} @@ -264,7 +264,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|listFeeds}. * @memberof google.cloud.asset.v1.AssetService * @typedef ListFeedsCallback * @type {function} @@ -297,7 +297,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateFeed}. * @memberof google.cloud.asset.v1.AssetService * @typedef UpdateFeedCallback * @type {function} @@ -330,7 +330,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteFeed}. * @memberof google.cloud.asset.v1.AssetService * @typedef DeleteFeedCallback * @type {function} @@ -363,7 +363,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllResources}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllResources}. * @memberof google.cloud.asset.v1.AssetService * @typedef SearchAllResourcesCallback * @type {function} @@ -396,7 +396,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#searchAllIamPolicies}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllIamPolicies}. * @memberof google.cloud.asset.v1.AssetService * @typedef SearchAllIamPoliciesCallback * @type {function} @@ -429,7 +429,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicy}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicy}. * @memberof google.cloud.asset.v1.AssetService * @typedef AnalyzeIamPolicyCallback * @type {function} @@ -462,7 +462,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeIamPolicyLongrunning}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicyLongrunning}. * @memberof google.cloud.asset.v1.AssetService * @typedef AnalyzeIamPolicyLongrunningCallback * @type {function} @@ -495,7 +495,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#analyzeMove}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeMove}. * @memberof google.cloud.asset.v1.AssetService * @typedef AnalyzeMoveCallback * @type {function} @@ -528,7 +528,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#queryAssets}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|queryAssets}. * @memberof google.cloud.asset.v1.AssetService * @typedef QueryAssetsCallback * @type {function} @@ -561,7 +561,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|createSavedQuery}. * @memberof google.cloud.asset.v1.AssetService * @typedef CreateSavedQueryCallback * @type {function} @@ -594,7 +594,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|getSavedQuery}. * @memberof google.cloud.asset.v1.AssetService * @typedef GetSavedQueryCallback * @type {function} @@ -627,7 +627,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listSavedQueries}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|listSavedQueries}. * @memberof google.cloud.asset.v1.AssetService * @typedef ListSavedQueriesCallback * @type {function} @@ -660,7 +660,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateSavedQuery}. * @memberof google.cloud.asset.v1.AssetService * @typedef UpdateSavedQueryCallback * @type {function} @@ -693,7 +693,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteSavedQuery}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteSavedQuery}. * @memberof google.cloud.asset.v1.AssetService * @typedef DeleteSavedQueryCallback * @type {function} @@ -726,7 +726,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetEffectiveIamPolicies}. + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetEffectiveIamPolicies}. * @memberof google.cloud.asset.v1.AssetService * @typedef BatchGetEffectiveIamPoliciesCallback * @type {function} @@ -853,9 +853,10 @@ 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 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -950,6 +951,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningMetadata + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyLongrunningMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata"; + }; + return AnalyzeIamPolicyLongrunningMetadata; })(); @@ -1104,28 +1120,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.relationshipTypes && message.relationshipTypes.length)) - message.relationshipTypes = []; - message.relationshipTypes.push(reader.string()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -1330,6 +1352,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExportAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ExportAssetsRequest"; + }; + return ExportAssetsRequest; })(); @@ -1447,15 +1484,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); - break; - case 3: - message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); - break; + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1577,6 +1617,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExportAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ExportAssetsResponse"; + }; + return ExportAssetsResponse; })(); @@ -1742,31 +1797,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.pageSize = reader.int32(); - break; - case 6: - message.pageToken = reader.string(); - break; - case 7: - if (!(message.relationshipTypes && message.relationshipTypes.length)) - message.relationshipTypes = []; - message.relationshipTypes.push(reader.string()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -1974,6 +2036,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListAssetsRequest"; + }; + return ListAssetsRequest; })(); @@ -2093,17 +2170,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32())); - break; - case 3: - message.nextPageToken = reader.string(); - break; + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2233,6 +2313,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListAssetsResponse"; + }; + return ListAssetsResponse; })(); @@ -2376,25 +2471,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - message.contentType = reader.int32(); - break; - case 4: - message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.relationshipTypes && message.relationshipTypes.length)) - message.relationshipTypes = []; - message.relationshipTypes.push(reader.string()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + } + case 3: { + message.contentType = reader.int32(); + break; + } + case 4: { + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -2586,6 +2686,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchGetAssetsHistoryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetAssetsHistoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetAssetsHistoryRequest"; + }; + return BatchGetAssetsHistoryRequest; })(); @@ -2683,11 +2798,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1.TemporalAsset.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.TemporalAsset.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -2794,6 +2910,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchGetAssetsHistoryResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetAssetsHistoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetAssetsHistoryResponse"; + }; + return BatchGetAssetsHistoryResponse; })(); @@ -2911,15 +3042,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.feedId = reader.string(); - break; - case 3: - message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.feedId = reader.string(); + break; + } + case 3: { + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3031,6 +3165,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.CreateFeedRequest"; + }; + return CreateFeedRequest; })(); @@ -3126,9 +3275,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; @@ -3218,6 +3368,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GetFeedRequest"; + }; + return GetFeedRequest; })(); @@ -3313,9 +3478,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3405,6 +3571,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFeedsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListFeedsRequest"; + }; + return ListFeedsRequest; })(); @@ -3502,11 +3683,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -3613,6 +3795,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFeedsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListFeedsResponse"; + }; + return ListFeedsResponse; })(); @@ -3719,12 +3916,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3833,6 +4032,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.UpdateFeedRequest"; + }; + return UpdateFeedRequest; })(); @@ -3928,9 +4142,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; @@ -4020,6 +4235,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.DeleteFeedRequest"; + }; + return DeleteFeedRequest; })(); @@ -4140,12 +4370,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); - break; - case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4265,6 +4497,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.OutputConfig"; + }; + return OutputConfig; })(); @@ -4374,9 +4621,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4476,6 +4724,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OutputResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.OutputResult"; + }; + return OutputResult; })(); @@ -4573,11 +4836,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.uris && message.uris.length)) - message.uris = []; - message.uris.push(reader.string()); - break; + case 1: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -4679,6 +4943,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsOutputResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GcsOutputResult"; + }; + return GcsOutputResult; })(); @@ -4799,12 +5078,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - case 2: - message.uriPrefix = reader.string(); - break; + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.uriPrefix = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4912,6 +5193,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GcsDestination"; + }; + return GcsDestination; })(); @@ -5051,21 +5347,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.dataset = reader.string(); - break; - case 2: - message.table = reader.string(); - break; - case 3: - message.force = reader.bool(); - break; - case 4: - message.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.decode(reader, reader.uint32()); - break; - case 5: - message.separateTablesPerAssetType = reader.bool(); - break; + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.table = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.separateTablesPerAssetType = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -5193,6 +5494,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BigQueryDestination"; + }; + return BigQueryDestination; })(); @@ -5288,9 +5604,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.partitionKey = reader.int32(); - break; + case 1: { + message.partitionKey = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5398,6 +5715,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PartitionSpec + * @function getTypeUrl + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.PartitionSpec"; + }; + /** * PartitionKey enum. * @name google.cloud.asset.v1.PartitionSpec.PartitionKey @@ -5509,9 +5841,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.topic = reader.string(); - break; + case 1: { + message.topic = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5601,6 +5934,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PubsubDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.PubsubDestination"; + }; + return PubsubDestination; })(); @@ -5710,9 +6058,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5812,6 +6161,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FeedOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeedOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.FeedOutputConfig"; + }; + return FeedOutputConfig; })(); @@ -5979,33 +6343,40 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); - break; - case 6: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.relationshipTypes && message.relationshipTypes.length)) - message.relationshipTypes = []; - message.relationshipTypes.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -6230,6 +6601,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Feed + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Feed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Feed"; + }; + return Feed; })(); @@ -6393,29 +6779,36 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 5: - message.pageToken = reader.string(); - break; - case 6: - message.orderBy = reader.string(); - break; - case 8: - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + case 8: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6572,6 +6965,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllResourcesRequest"; + }; + return SearchAllResourcesRequest; })(); @@ -6680,14 +7088,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1.ResourceSearchResult.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1.ResourceSearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6803,6 +7213,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllResourcesResponse"; + }; + return SearchAllResourcesResponse; })(); @@ -6955,26 +7380,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; - case 5: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 7: - message.orderBy = reader.string(); - break; + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 7: { + message.orderBy = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7118,6 +7549,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllIamPoliciesRequest"; + }; + return SearchAllIamPoliciesRequest; })(); @@ -7226,14 +7672,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1.IamPolicySearchResult.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7349,6 +7797,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllIamPoliciesResponse"; + }; + return SearchAllIamPoliciesResponse; })(); @@ -7499,24 +7962,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); - break; - case 3: - message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); - break; - case 4: - message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); - break; - case 5: - message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); - break; - case 6: - message.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.decode(reader, reader.uint32()); - break; + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); + break; + } + case 4: { + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); + break; + } + case 5: { + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); + break; + } + case 6: { + message.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7672,6 +8141,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisQuery + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery"; + }; + IamPolicyAnalysisQuery.ResourceSelector = (function() { /** @@ -7764,9 +8248,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; + case 1: { + message.fullResourceName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7856,6 +8341,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceSelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector"; + }; + return ResourceSelector; })(); @@ -7951,9 +8451,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.identity = reader.string(); - break; + case 1: { + message.identity = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8043,6 +8544,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IdentitySelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentitySelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector"; + }; + return IdentitySelector; })(); @@ -8153,16 +8669,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.roles && message.roles.length)) - message.roles = []; - message.roles.push(reader.string()); - break; - case 2: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; + case 1: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -8285,6 +8803,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessSelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector"; + }; + return AccessSelector; })(); @@ -8435,24 +8968,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expandGroups = reader.bool(); - break; - case 2: - message.expandRoles = reader.bool(); - break; - case 3: - message.expandResources = reader.bool(); - break; - case 4: - message.outputResourceEdges = reader.bool(); - break; - case 5: - message.outputGroupEdges = reader.bool(); - break; - case 6: - message.analyzeServiceAccountImpersonation = reader.bool(); - break; + case 1: { + message.expandGroups = reader.bool(); + break; + } + case 2: { + message.expandRoles = reader.bool(); + break; + } + case 3: { + message.expandResources = reader.bool(); + break; + } + case 4: { + message.outputResourceEdges = reader.bool(); + break; + } + case 5: { + message.outputGroupEdges = reader.bool(); + break; + } + case 6: { + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -8583,6 +9122,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Options + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Options.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.Options"; + }; + return Options; })(); @@ -8692,9 +9246,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.accessTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.accessTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8794,6 +9349,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ConditionContext + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext"; + }; + return ConditionContext; })(); @@ -8914,15 +9484,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 3: - message.savedAnalysisQuery = reader.string(); - break; - case 2: - message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.savedAnalysisQuery = reader.string(); + break; + } + case 2: { + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9039,6 +9612,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyRequest"; + }; + return AnalyzeIamPolicyRequest; })(); @@ -9158,17 +9746,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) - message.serviceAccountImpersonationAnalysis = []; - message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); - break; - case 3: - message.fullyExplored = reader.bool(); - break; + case 1: { + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); + break; + } + case 3: { + message.fullyExplored = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -9298,6 +9889,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyResponse"; + }; + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { /** @@ -9427,22 +10033,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.analysisResults && message.analysisResults.length)) - message.analysisResults = []; - message.analysisResults.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); - break; - case 3: - message.fullyExplored = reader.bool(); - break; - case 5: - if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) - message.nonCriticalErrors = []; - message.nonCriticalErrors.push($root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32())); - break; + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.fullyExplored = reader.bool(); + break; + } + case 5: { + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -9598,6 +10208,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysis + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis"; + }; + return IamPolicyAnalysis; })(); @@ -9721,12 +10346,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); - break; - case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9846,6 +10473,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisOutputConfig"; + }; + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { /** @@ -9938,9 +10580,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; + case 1: { + message.uri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10030,6 +10673,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination"; + }; + return GcsDestination; })(); @@ -10158,18 +10816,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.dataset = reader.string(); - break; - case 2: - message.tablePrefix = reader.string(); - break; - case 3: - message.partitionKey = reader.int32(); - break; - case 4: - message.writeDisposition = reader.string(); - break; + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.tablePrefix = reader.string(); + break; + } + case 3: { + message.partitionKey = reader.int32(); + break; + } + case 4: { + message.writeDisposition = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10297,6 +10959,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination"; + }; + /** * PartitionKey enum. * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey @@ -10431,15 +11108,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 3: - message.savedAnalysisQuery = reader.string(); - break; - case 2: - message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.savedAnalysisQuery = reader.string(); + break; + } + case 2: { + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10556,6 +11236,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyLongrunningRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest"; + }; + return AnalyzeIamPolicyLongrunningRequest; })(); @@ -10716,6 +11411,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyLongrunningResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse"; + }; + return AnalyzeIamPolicyLongrunningResponse; })(); @@ -10890,49 +11600,57 @@ 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.creator = reader.string(); - break; - case 5: - message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.lastUpdater = reader.string(); - break; - case 7: - 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.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.creator = reader.string(); + break; + } + case 5: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastUpdater = reader.string(); + break; + } + case 7: { + 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 8: { + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 8: - message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -11109,6 +11827,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SavedQuery + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SavedQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SavedQuery"; + }; + SavedQuery.QueryContent = (function() { /** @@ -11215,9 +11948,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; + case 1: { + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11317,6 +12051,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for QueryContent + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SavedQuery.QueryContent"; + }; + return QueryContent; })(); @@ -11437,15 +12186,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); - break; - case 3: - message.savedQueryId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.savedQueryId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11557,6 +12309,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.CreateSavedQueryRequest"; + }; + return CreateSavedQueryRequest; })(); @@ -11652,9 +12419,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; @@ -11744,6 +12512,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GetSavedQueryRequest"; + }; + return GetSavedQueryRequest; })(); @@ -11872,18 +12655,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + 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; @@ -11998,6 +12785,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSavedQueriesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSavedQueriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListSavedQueriesRequest"; + }; + return ListSavedQueriesRequest; })(); @@ -12106,14 +12908,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.savedQueries && message.savedQueries.length)) - message.savedQueries = []; - message.savedQueries.push($root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.savedQueries && message.savedQueries.length)) + message.savedQueries = []; + message.savedQueries.push($root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12229,6 +13033,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListSavedQueriesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSavedQueriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListSavedQueriesResponse"; + }; + return ListSavedQueriesResponse; })(); @@ -12335,12 +13154,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12449,6 +13270,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.UpdateSavedQueryRequest"; + }; + return UpdateSavedQueryRequest; })(); @@ -12544,9 +13380,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; @@ -12636,6 +13473,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.DeleteSavedQueryRequest"; + }; + return DeleteSavedQueryRequest; })(); @@ -12753,15 +13605,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 2: - message.destinationParent = reader.string(); - break; - case 3: - message.view = reader.int32(); - break; + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.destinationParent = reader.string(); + break; + } + case 3: { + message.view = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -12886,6 +13741,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeMoveRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeMoveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeMoveRequest"; + }; + /** * AnalysisView enum. * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView @@ -12999,11 +13869,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.moveAnalysis && message.moveAnalysis.length)) - message.moveAnalysis = []; - message.moveAnalysis.push($root.google.cloud.asset.v1.MoveAnalysis.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.moveAnalysis && message.moveAnalysis.length)) + message.moveAnalysis = []; + message.moveAnalysis.push($root.google.cloud.asset.v1.MoveAnalysis.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13110,6 +13981,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeMoveResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeMoveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeMoveResponse"; + }; + return AnalyzeMoveResponse; })(); @@ -13241,15 +14127,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.displayName = reader.string(); - break; - case 2: - message.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.decode(reader, reader.uint32()); - break; - case 3: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -13378,6 +14267,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MoveAnalysis + * @function getTypeUrl + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.MoveAnalysis"; + }; + return MoveAnalysis; })(); @@ -13488,16 +14392,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.blockers && message.blockers.length)) - message.blockers = []; - message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13630,6 +14536,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MoveAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.MoveAnalysisResult"; + }; + return MoveAnalysisResult; })(); @@ -13725,9 +14646,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.detail = reader.string(); - break; + case 1: { + message.detail = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13817,6 +14739,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MoveImpact + * @function getTypeUrl + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveImpact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.MoveImpact"; + }; + return MoveImpact; })(); @@ -13912,9 +14849,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14009,6 +14947,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for QueryAssetsOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAssetsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsOutputConfig"; + }; + QueryAssetsOutputConfig.BigQueryDestination = (function() { /** @@ -14123,15 +15076,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.dataset = reader.string(); - break; - case 2: - message.table = reader.string(); - break; - case 3: - message.writeDisposition = reader.string(); - break; + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.table = reader.string(); + break; + } + case 3: { + message.writeDisposition = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14238,6 +15194,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination"; + }; + return BigQueryDestination; })(); @@ -14449,33 +15420,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.statement = reader.string(); - break; - case 3: - message.jobReference = reader.string(); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 5: - message.pageToken = reader.string(); - break; - case 6: - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); - break; - case 8: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.statement = reader.string(); + break; + } + case 3: { + message.jobReference = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 8: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14673,6 +15653,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for QueryAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsRequest"; + }; + return QueryAssetsRequest; })(); @@ -14826,21 +15821,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.jobReference = reader.string(); - break; - case 2: - message.done = reader.bool(); - break; - case 3: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 4: - message.queryResult = $root.google.cloud.asset.v1.QueryResult.decode(reader, reader.uint32()); - break; - case 5: - message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.jobReference = reader.string(); + break; + } + case 2: { + message.done = reader.bool(); + break; + } + case 3: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.queryResult = $root.google.cloud.asset.v1.QueryResult.decode(reader, reader.uint32()); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14998,6 +15998,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for QueryAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsResponse"; + }; + return QueryAssetsResponse; })(); @@ -15128,20 +16143,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); - break; - case 2: - message.schema = $root.google.cloud.asset.v1.TableSchema.decode(reader, reader.uint32()); - break; - case 3: - message.nextPageToken = reader.string(); - break; - case 4: - message.totalRows = reader.int64(); - break; + case 1: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; + } + case 2: { + message.schema = $root.google.cloud.asset.v1.TableSchema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalRows = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -15293,6 +16312,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for QueryResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryResult"; + }; + return QueryResult; })(); @@ -15390,11 +16424,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -15501,6 +16536,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableSchema + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TableSchema"; + }; + return TableSchema; })(); @@ -15631,20 +16681,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.field = reader.string(); - break; - case 2: - message.type = reader.string(); - break; - case 3: - message.mode = reader.string(); - break; - case 4: - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); - break; + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.mode = reader.string(); + break; + } + case 4: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -15777,6 +16831,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableFieldSchema + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableFieldSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TableFieldSchema"; + }; + return TableFieldSchema; })(); @@ -15885,14 +16954,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 3: - if (!(message.names && message.names.length)) - message.names = []; - message.names.push(reader.string()); - break; + case 1: { + message.scope = reader.string(); + break; + } + case 3: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -16003,6 +17074,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetEffectiveIamPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest"; + }; + return BatchGetEffectiveIamPoliciesRequest; })(); @@ -16100,11 +17186,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.policyResults && message.policyResults.length)) - message.policyResults = []; - message.policyResults.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.decode(reader, reader.uint32())); - break; + case 2: { + if (!(message.policyResults && message.policyResults.length)) + message.policyResults = []; + message.policyResults.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -16211,6 +17298,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetEffectiveIamPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse"; + }; + BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy = (function() { /** @@ -16316,14 +17418,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; - case 2: - if (!(message.policies && message.policies.length)) - message.policies = []; - message.policies.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.decode(reader, reader.uint32())); - break; + case 1: { + message.fullResourceName = reader.string(); + break; + } + case 2: { + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -16439,6 +17543,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EffectiveIamPolicy + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EffectiveIamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy"; + }; + EffectiveIamPolicy.PolicyInfo = (function() { /** @@ -16542,12 +17661,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.attachedResource = reader.string(); - break; - case 2: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; + case 1: { + message.attachedResource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -16651,6 +17772,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PolicyInfo + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo"; + }; + return PolicyInfo; })(); @@ -16820,21 +17956,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); - break; - case 4: - message.priorAssetState = reader.int32(); - break; - case 5: - message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); - break; + case 1: { + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deleted = reader.bool(); + break; + } + case 3: { + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + } + case 4: { + message.priorAssetState = reader.int32(); + break; + } + case 5: { + message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17000,6 +18141,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TemporalAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemporalAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TemporalAsset"; + }; + /** * PriorAssetState enum. * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState @@ -17126,12 +18282,14 @@ 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; + 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; @@ -17240,6 +18398,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.cloud.asset.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.asset.v1.TimeWindow"; + }; + return TimeWindow; })(); @@ -17485,49 +18658,62 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.orgPolicy && message.orgPolicy.length)) - message.orgPolicy = []; - message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); - break; - case 7: - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); - break; - case 8: - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); - break; - case 9: - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); - break; - case 12: - message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); - break; - case 13: - message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); - break; - case 15: - message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + } + case 7: { + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + } + case 9: { + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + } + case 12: { + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); + break; + } + case 13: { + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); + break; + } + case 15: { + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -17810,6 +18996,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Asset"; + }; + return Asset; })(); @@ -17971,27 +19172,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 8: - message.location = reader.string(); - break; + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 8: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18135,6 +19343,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Resource"; + }; + return Resource; })(); @@ -18243,14 +19466,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32())); - break; + case 1: { + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -18371,6 +19596,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedAssets + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAssets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedAssets"; + }; + return RelatedAssets; })(); @@ -18499,18 +19739,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.type = reader.string(); - break; - case 1: - message.sourceResourceType = reader.string(); - break; - case 2: - message.targetResourceType = reader.string(); - break; - case 3: - message.action = reader.string(); - break; + case 4: { + message.type = reader.string(); + break; + } + case 1: { + message.sourceResourceType = reader.string(); + break; + } + case 2: { + message.targetResourceType = reader.string(); + break; + } + case 3: { + message.action = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18625,6 +19869,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelationshipAttributes + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelationshipAttributes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelationshipAttributes"; + }; + return RelationshipAttributes; })(); @@ -18755,20 +20014,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.asset = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; - case 4: - message.relationshipType = reader.string(); - break; + case 1: { + message.asset = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + case 4: { + message.relationshipType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18896,6 +20159,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedAsset"; + }; + return RelatedAsset; })(); @@ -19253,127 +20531,150 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.project = reader.string(); - break; - case 17: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push(reader.string()); - break; - case 18: - message.organization = reader.string(); - break; - case 4: - message.displayName = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 6: - message.location = reader.string(); - break; - case 7: - 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.assetType = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 17: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 18: { + message.organization = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + 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; } - message.labels[key] = value; - break; - case 8: - if (!(message.networkTags && message.networkTags.length)) - message.networkTags = []; - message.networkTags.push(reader.string()); - break; - case 10: - message.kmsKey = reader.string(); - break; - case 11: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 13: - message.state = reader.string(); - break; - case 9: - message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 19: - message.parentFullResourceName = reader.string(); - break; - case 16: - if (!(message.versionedResources && message.versionedResources.length)) - message.versionedResources = []; - message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); - break; - case 20: - if (!(message.attachedResources && message.attachedResources.length)) - message.attachedResources = []; - message.attachedResources.push($root.google.cloud.asset.v1.AttachedResource.decode(reader, reader.uint32())); - break; - case 21: - if (message.relationships === $util.emptyObject) - message.relationships = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.asset.v1.RelatedResources.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 8: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + case 10: { + message.kmsKey = reader.string(); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.state = reader.string(); + break; + } + case 9: { + message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 19: { + message.parentFullResourceName = reader.string(); + break; + } + case 16: { + if (!(message.versionedResources && message.versionedResources.length)) + message.versionedResources = []; + message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.attachedResources && message.attachedResources.length)) + message.attachedResources = []; + message.attachedResources.push($root.google.cloud.asset.v1.AttachedResource.decode(reader, reader.uint32())); + break; + } + case 21: { + if (message.relationships === $util.emptyObject) + message.relationships = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.RelatedResources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.relationships[key] = value; + break; + } + case 23: { + if (!(message.tagKeys && message.tagKeys.length)) + message.tagKeys = []; + message.tagKeys.push(reader.string()); + break; + } + case 25: { + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push(reader.string()); + break; + } + case 26: { + if (!(message.tagValueIds && message.tagValueIds.length)) + message.tagValueIds = []; + message.tagValueIds.push(reader.string()); + break; + } + case 103: { + message.parentAssetType = reader.string(); + break; } - message.relationships[key] = value; - break; - case 23: - if (!(message.tagKeys && message.tagKeys.length)) - message.tagKeys = []; - message.tagKeys.push(reader.string()); - break; - case 25: - if (!(message.tagValues && message.tagValues.length)) - message.tagValues = []; - message.tagValues.push(reader.string()); - break; - case 26: - if (!(message.tagValueIds && message.tagValueIds.length)) - message.tagValueIds = []; - message.tagValueIds.push(reader.string()); - break; - case 103: - message.parentAssetType = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -19785,6 +21086,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceSearchResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ResourceSearchResult"; + }; + return ResourceSearchResult; })(); @@ -19891,12 +21207,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.resource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.resource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -20000,6 +21318,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for VersionedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.VersionedResource"; + }; + return VersionedResource; })(); @@ -20108,14 +21441,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.assetType = reader.string(); - break; - case 3: - if (!(message.versionedResources && message.versionedResources.length)) - message.versionedResources = []; - message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); - break; + case 1: { + message.assetType = reader.string(); + break; + } + case 3: { + if (!(message.versionedResources && message.versionedResources.length)) + message.versionedResources = []; + message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -20231,6 +21566,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AttachedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AttachedResource"; + }; + return AttachedResource; })(); @@ -20328,11 +21678,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.relatedResources && message.relatedResources.length)) - message.relatedResources = []; - message.relatedResources.push($root.google.cloud.asset.v1.RelatedResource.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.relatedResources && message.relatedResources.length)) + message.relatedResources = []; + message.relatedResources.push($root.google.cloud.asset.v1.RelatedResource.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -20439,6 +21790,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedResources + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedResources"; + }; + return RelatedResources; })(); @@ -20545,12 +21911,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.assetType = reader.string(); - break; - case 2: - message.fullResourceName = reader.string(); - break; + case 1: { + message.assetType = reader.string(); + break; + } + case 2: { + message.fullResourceName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -20649,6 +22017,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedResource"; + }; + return RelatedResource; })(); @@ -20812,29 +22195,36 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 5: - message.assetType = reader.string(); - break; - case 2: - message.project = reader.string(); - break; - case 6: - if (!(message.folders && message.folders.length)) - message.folders = []; - message.folders.push(reader.string()); - break; - case 7: - message.organization = reader.string(); - break; - case 3: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 4: - message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); - break; + case 1: { + message.resource = reader.string(); + break; + } + case 5: { + message.assetType = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 6: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 7: { + message.organization = reader.string(); + break; + } + case 3: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -20996,6 +22386,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicySearchResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicySearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicySearchResult"; + }; + IamPolicySearchResult.Explanation = (function() { /** @@ -21092,28 +22497,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.matchedPermissions === $util.emptyObject) - message.matchedPermissions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.matchedPermissions[key] = value; + break; } - message.matchedPermissions[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -21222,6 +22628,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Explanation + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Explanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicySearchResult.Explanation"; + }; + Explanation.Permissions = (function() { /** @@ -21316,11 +22737,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -21422,6 +22844,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Permissions + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Permissions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions"; + }; + return Permissions; })(); @@ -21534,12 +22971,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.cause = reader.string(); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.cause = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21726,6 +23165,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisState + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisState"; + }; + return IamPolicyAnalysisState; })(); @@ -21821,9 +23275,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.evaluationValue = reader.int32(); - break; + case 1: { + message.evaluationValue = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -21936,6 +23391,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ConditionEvaluation + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ConditionEvaluation"; + }; + /** * EvaluationValue enum. * @name google.cloud.asset.v1.ConditionEvaluation.EvaluationValue @@ -22095,23 +23565,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.attachedResourceFullName = reader.string(); - break; - case 2: - message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.accessControlLists && message.accessControlLists.length)) - message.accessControlLists = []; - message.accessControlLists.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); - break; - case 4: - message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); - break; - case 5: - message.fullyExplored = reader.bool(); - break; + case 1: { + message.attachedResourceFullName = reader.string(); + break; + } + case 2: { + message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.accessControlLists && message.accessControlLists.length)) + message.accessControlLists = []; + message.accessControlLists.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + } + case 4: { + message.identityList = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fullyExplored = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -22262,6 +23737,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult"; + }; + IamPolicyAnalysisResult.Resource = (function() { /** @@ -22365,12 +23855,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; - case 2: - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); - break; + case 1: { + message.fullResourceName = reader.string(); + break; + } + case 2: { + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22474,6 +23966,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Resource"; + }; + return Resource; })(); @@ -22605,15 +24112,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - message.permission = reader.string(); - break; - case 3: - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); - break; + case 1: { + message.role = reader.string(); + break; + } + case 2: { + message.permission = reader.string(); + break; + } + case 3: { + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22735,6 +24245,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Access.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Access"; + }; + return Access; })(); @@ -22841,12 +24366,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22950,6 +24477,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Identity + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Identity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Identity"; + }; + return Identity; })(); @@ -23056,12 +24598,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sourceNode = reader.string(); - break; - case 2: - message.targetNode = reader.string(); - break; + case 1: { + message.sourceNode = reader.string(); + break; + } + case 2: { + message.targetNode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23160,6 +24704,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Edge + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Edge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Edge"; + }; + return Edge; })(); @@ -23294,24 +24853,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.accesses && message.accesses.length)) - message.accesses = []; - message.accesses.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.resourceEdges && message.resourceEdges.length)) - message.resourceEdges = []; - message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); - break; - case 4: - message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.decode(reader, reader.uint32()); - break; + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + } + case 4: { + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -23483,6 +25046,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessControlList + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessControlList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList"; + }; + return AccessControlList; })(); @@ -23593,16 +25171,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.identities && message.identities.length)) - message.identities = []; - message.identities.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.groupEdges && message.groupEdges.length)) - message.groupEdges = []; - message.groupEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -23735,6 +25315,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IdentityList + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentityList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList"; + }; + return IdentityList; })(); @@ -23786,7 +25381,7 @@ }; /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllResources}. * @memberof google.cloud.asset.v1p1beta1.AssetService * @typedef SearchAllResourcesCallback * @type {function} @@ -23819,7 +25414,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllIamPolicies}. * @memberof google.cloud.asset.v1p1beta1.AssetService * @typedef SearchAllIamPoliciesCallback * @type {function} @@ -24003,26 +25598,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 5: - message.pageToken = reader.string(); - break; - case 10: - message.orderBy = reader.string(); - break; + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 10: { + message.orderBy = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24166,6 +25767,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllResourcesRequest"; + }; + return SearchAllResourcesRequest; })(); @@ -24274,14 +25890,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24397,6 +26015,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllResourcesResponse"; + }; + return SearchAllResourcesResponse; })(); @@ -24525,18 +26158,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24651,6 +26288,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest"; + }; + return SearchAllIamPoliciesRequest; })(); @@ -24759,14 +26411,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24882,6 +26536,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse"; + }; + return SearchAllIamPoliciesResponse; })(); @@ -25071,56 +26740,65 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.project = reader.string(); - break; - case 4: - message.displayName = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 10: - if (!(message.additionalAttributes && message.additionalAttributes.length)) - message.additionalAttributes = []; - message.additionalAttributes.push(reader.string()); - break; - case 11: - message.location = reader.string(); - break; - case 12: - 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.assetType = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 10: { + if (!(message.additionalAttributes && message.additionalAttributes.length)) + message.additionalAttributes = []; + message.additionalAttributes.push(reader.string()); + break; + } + case 11: { + message.location = reader.string(); + break; + } + case 12: { + 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: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; } - message.labels[key] = value; - break; - case 13: - if (!(message.networkTags && message.networkTags.length)) - message.networkTags = []; - message.networkTags.push(reader.string()); - break; default: reader.skipType(tag & 7); break; @@ -25316,6 +26994,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StandardResourceMetadata + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardResourceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.StandardResourceMetadata"; + }; + return StandardResourceMetadata; })(); @@ -25444,18 +27137,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; - case 3: - message.project = reader.string(); - break; - case 4: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 5: - message.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); - break; + case 1: { + message.resource = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 4: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25580,6 +27277,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicySearchResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicySearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.IamPolicySearchResult"; + }; + IamPolicySearchResult.Explanation = (function() { /** @@ -25676,28 +27388,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.matchedPermissions === $util.emptyObject) - message.matchedPermissions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.asset.v1p1beta1.Permissions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1p1beta1.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.matchedPermissions[key] = value; + break; } - message.matchedPermissions[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -25806,6 +27519,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Explanation + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Explanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation"; + }; + return Explanation; })(); @@ -25906,11 +27634,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -26012,6 +27741,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Permissions + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Permissions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.Permissions"; + }; + return Permissions; })(); @@ -26060,7 +27804,7 @@ }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|createFeed}. * @memberof google.cloud.asset.v1p2beta1.AssetService * @typedef CreateFeedCallback * @type {function} @@ -26093,7 +27837,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|getFeed}. * @memberof google.cloud.asset.v1p2beta1.AssetService * @typedef GetFeedCallback * @type {function} @@ -26126,7 +27870,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|listFeeds}. * @memberof google.cloud.asset.v1p2beta1.AssetService * @typedef ListFeedsCallback * @type {function} @@ -26159,7 +27903,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|updateFeed}. * @memberof google.cloud.asset.v1p2beta1.AssetService * @typedef UpdateFeedCallback * @type {function} @@ -26192,7 +27936,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|deleteFeed}. * @memberof google.cloud.asset.v1p2beta1.AssetService * @typedef DeleteFeedCallback * @type {function} @@ -26341,15 +28085,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.feedId = reader.string(); - break; - case 3: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.feedId = reader.string(); + break; + } + case 3: { + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26461,6 +28208,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.CreateFeedRequest"; + }; + return CreateFeedRequest; })(); @@ -26556,9 +28318,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; @@ -26648,6 +28411,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.GetFeedRequest"; + }; + return GetFeedRequest; })(); @@ -26743,9 +28521,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -26835,6 +28614,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFeedsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.ListFeedsRequest"; + }; + return ListFeedsRequest; })(); @@ -26932,11 +28726,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -27043,6 +28838,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListFeedsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.ListFeedsResponse"; + }; + return ListFeedsResponse; })(); @@ -27149,12 +28959,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27263,6 +29075,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.UpdateFeedRequest"; + }; + return UpdateFeedRequest; })(); @@ -27358,9 +29185,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; @@ -27450,6 +29278,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.DeleteFeedRequest"; + }; + return DeleteFeedRequest; })(); @@ -27559,9 +29402,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27661,6 +29505,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.OutputConfig"; + }; + return OutputConfig; })(); @@ -27770,9 +29629,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; + case 1: { + message.uri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27866,6 +29726,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.GcsDestination"; + }; + return GcsDestination; })(); @@ -27961,9 +29836,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.topic = reader.string(); - break; + case 1: { + message.topic = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -28053,6 +29929,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PubsubDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.PubsubDestination"; + }; + return PubsubDestination; })(); @@ -28162,9 +30053,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -28264,6 +30156,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FeedOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeedOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.FeedOutputConfig"; + }; + return FeedOutputConfig; })(); @@ -28407,25 +30314,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -28597,6 +30509,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Feed + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Feed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.Feed"; + }; + return Feed; })(); @@ -28730,15 +30657,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); - break; + case 1: { + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deleted = reader.bool(); + break; + } + case 3: { + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -28855,6 +30785,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TemporalAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemporalAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.TemporalAsset"; + }; + return TemporalAsset; })(); @@ -28961,12 +30906,14 @@ 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; + 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; @@ -29075,6 +31022,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.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.asset.v1p2beta1.TimeWindow"; + }; + return TimeWindow; })(); @@ -29216,23 +31178,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -29378,6 +31345,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.Asset"; + }; + return Asset; })(); @@ -29528,24 +31510,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29681,6 +31669,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.Resource"; + }; + return Resource; })(); @@ -29729,7 +31732,7 @@ }; /** - * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#analyzeIamPolicy}. + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService|analyzeIamPolicy}. * @memberof google.cloud.asset.v1p4beta1.AssetService * @typedef AnalyzeIamPolicyCallback * @type {function} @@ -29762,7 +31765,7 @@ */ /** - * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#exportIamPolicyAnalysis}. + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService|exportIamPolicyAnalysis}. * @memberof google.cloud.asset.v1p4beta1.AssetService * @typedef ExportIamPolicyAnalysisCallback * @type {function} @@ -29922,18 +31925,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); - break; - case 3: - message.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); - break; - case 4: - message.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); + break; + } + case 4: { + message.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -30063,6 +32070,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisQuery + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery"; + }; + IamPolicyAnalysisQuery.ResourceSelector = (function() { /** @@ -30155,9 +32177,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; + case 1: { + message.fullResourceName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -30247,6 +32270,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceSelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector"; + }; + return ResourceSelector; })(); @@ -30342,9 +32380,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.identity = reader.string(); - break; + case 1: { + message.identity = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -30434,6 +32473,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IdentitySelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentitySelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector"; + }; + return IdentitySelector; })(); @@ -30544,16 +32598,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.roles && message.roles.length)) - message.roles = []; - message.roles.push(reader.string()); - break; - case 2: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; + case 1: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -30676,6 +32732,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessSelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector"; + }; + return AccessSelector; })(); @@ -30785,12 +32856,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 2: - message.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.decode(reader, reader.uint32()); - break; + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + message.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -30899,6 +32972,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest"; + }; + AnalyzeIamPolicyRequest.Options = (function() { /** @@ -31057,27 +33145,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expandGroups = reader.bool(); - break; - case 2: - message.expandRoles = reader.bool(); - break; - case 3: - message.expandResources = reader.bool(); - break; - case 4: - message.outputResourceEdges = reader.bool(); - break; - case 5: - message.outputGroupEdges = reader.bool(); - break; - case 6: - message.analyzeServiceAccountImpersonation = reader.bool(); - break; - case 7: - message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.expandGroups = reader.bool(); + break; + } + case 2: { + message.expandRoles = reader.bool(); + break; + } + case 3: { + message.expandResources = reader.bool(); + break; + } + case 4: { + message.outputResourceEdges = reader.bool(); + break; + } + case 5: { + message.outputGroupEdges = reader.bool(); + break; + } + case 6: { + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + } + case 7: { + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -31221,6 +33316,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Options + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Options.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options"; + }; + return Options; })(); @@ -31356,22 +33466,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) - message.serviceAccountImpersonationAnalysis = []; - message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); - break; - case 3: - message.fullyExplored = reader.bool(); - break; - case 4: - if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) - message.nonCriticalErrors = []; - message.nonCriticalErrors.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32())); - break; + case 1: { + message.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); + break; + } + case 3: { + message.fullyExplored = reader.bool(); + break; + } + case 4: { + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -31527,6 +33641,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeIamPolicyResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse"; + }; + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { /** @@ -31643,17 +33772,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.analysisResults && message.analysisResults.length)) - message.analysisResults = []; - message.analysisResults.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); - break; - case 3: - message.fullyExplored = reader.bool(); - break; + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.fullyExplored = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -31783,6 +33915,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysis + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis"; + }; + return IamPolicyAnalysis; })(); @@ -31895,9 +34042,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); - break; + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -31997,6 +34145,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig"; + }; + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { /** @@ -32089,9 +34252,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; + case 1: { + message.uri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -32181,6 +34345,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination"; + }; + return GcsDestination; })(); @@ -32301,15 +34480,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); - break; - case 2: - message.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.decode(reader, reader.uint32()); - break; - case 3: - message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + message.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -32431,6 +34613,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExportIamPolicyAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIamPolicyAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest"; + }; + ExportIamPolicyAnalysisRequest.Options = (function() { /** @@ -32578,24 +34775,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expandGroups = reader.bool(); - break; - case 2: - message.expandRoles = reader.bool(); - break; - case 3: - message.expandResources = reader.bool(); - break; - case 4: - message.outputResourceEdges = reader.bool(); - break; - case 5: - message.outputGroupEdges = reader.bool(); - break; - case 6: - message.analyzeServiceAccountImpersonation = reader.bool(); - break; + case 1: { + message.expandGroups = reader.bool(); + break; + } + case 2: { + message.expandRoles = reader.bool(); + break; + } + case 3: { + message.expandResources = reader.bool(); + break; + } + case 4: { + message.outputResourceEdges = reader.bool(); + break; + } + case 5: { + message.outputGroupEdges = reader.bool(); + break; + } + case 6: { + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -32726,6 +34929,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Options + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Options.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options"; + }; + return Options; })(); @@ -32824,9 +35042,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); - break; + case 1: { + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -32921,6 +35140,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExportIamPolicyAnalysisResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportIamPolicyAnalysisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse"; + }; + return ExportIamPolicyAnalysisResponse; })(); @@ -33062,23 +35296,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.attachedResourceFullName = reader.string(); - break; - case 2: - message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.accessControlLists && message.accessControlLists.length)) - message.accessControlLists = []; - message.accessControlLists.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); - break; - case 4: - message.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); - break; - case 5: - message.fullyExplored = reader.bool(); - break; + case 1: { + message.attachedResourceFullName = reader.string(); + break; + } + case 2: { + message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.accessControlLists && message.accessControlLists.length)) + message.accessControlLists = []; + message.accessControlLists.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + } + case 4: { + message.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fullyExplored = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -33229,6 +35468,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IamPolicyAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult"; + }; + IamPolicyAnalysisResult.AnalysisState = (function() { /** @@ -33332,12 +35586,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.cause = reader.string(); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.cause = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -33524,6 +35780,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalysisState + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalysisState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState"; + }; + return AnalysisState; })(); @@ -33630,12 +35901,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.fullResourceName = reader.string(); - break; - case 2: - message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); - break; + case 1: { + message.fullResourceName = reader.string(); + break; + } + case 2: { + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -33739,6 +36012,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource"; + }; + return Resource; })(); @@ -33870,15 +36158,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - message.permission = reader.string(); - break; - case 3: - message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); - break; + case 1: { + message.role = reader.string(); + break; + } + case 2: { + message.permission = reader.string(); + break; + } + case 3: { + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -34000,6 +36291,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Access.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access"; + }; + return Access; })(); @@ -34106,12 +36412,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sourceNode = reader.string(); - break; - case 2: - message.targetNode = reader.string(); - break; + case 1: { + message.sourceNode = reader.string(); + break; + } + case 2: { + message.targetNode = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -34210,6 +36518,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Edge + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Edge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge"; + }; + return Edge; })(); @@ -34316,12 +36639,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -34425,6 +36750,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Identity + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Identity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity"; + }; + return Identity; })(); @@ -34548,21 +36888,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.accesses && message.accesses.length)) - message.accesses = []; - message.accesses.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.resourceEdges && message.resourceEdges.length)) - message.resourceEdges = []; - message.resourceEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -34720,6 +37063,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessControlList + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessControlList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList"; + }; + return AccessControlList; })(); @@ -34830,16 +37188,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.identities && message.identities.length)) - message.identities = []; - message.identities.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.groupEdges && message.groupEdges.length)) - message.groupEdges = []; - message.groupEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -34972,6 +37332,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IdentityList + * @function getTypeUrl + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentityList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList"; + }; + return IdentityList; })(); @@ -35023,7 +37398,7 @@ }; /** - * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService#listAssets}. + * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService|listAssets}. * @memberof google.cloud.asset.v1p5beta1.AssetService * @typedef ListAssetsCallback * @type {function} @@ -35207,26 +37582,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.pageSize = reader.int32(); - break; - case 6: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35403,6 +37784,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.ListAssetsRequest"; + }; + return ListAssetsRequest; })(); @@ -35542,17 +37938,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1p5beta1.Asset.decode(reader, reader.uint32())); - break; - case 3: - message.nextPageToken = reader.string(); - break; + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1p5beta1.Asset.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35682,6 +38081,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.ListAssetsResponse"; + }; + return ListAssetsResponse; })(); @@ -35883,37 +38297,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1p5beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.orgPolicy && message.orgPolicy.length)) - message.orgPolicy = []; - message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); - break; - case 7: - message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); - break; - case 8: - message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); - break; - case 9: - message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1p5beta1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + } + case 7: { + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + } + case 9: { + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -36144,6 +38567,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.Asset"; + }; + return Asset; })(); @@ -36294,24 +38732,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -36447,6 +38891,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.Resource"; + }; + return Resource; })(); @@ -36646,27 +39105,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.int32(); - break; - case 2: - message.constraint = reader.string(); - break; - case 3: - message.etag = reader.bytes(); - break; - case 4: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); - break; - case 6: - message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); - break; - case 7: - message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); - break; + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); + break; + } + case 7: { + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -36767,7 +39233,7 @@ if (object.etag != null) if (typeof object.etag === "string") $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) + else if (object.etag.length >= 0) message.etag = object.etag; if (object.updateTime != null) { if (typeof object.updateTime !== "object") @@ -36854,6 +39320,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy"; + }; + Policy.ListPolicy = (function() { /** @@ -36994,25 +39475,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); - break; - case 2: - if (!(message.deniedValues && message.deniedValues.length)) - message.deniedValues = []; - message.deniedValues.push(reader.string()); - break; - case 3: - message.allValues = reader.int32(); - break; - case 4: - message.suggestedValue = reader.string(); - break; - case 5: - message.inheritFromParent = reader.bool(); - break; + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + } + case 3: { + message.allValues = reader.int32(); + break; + } + case 4: { + message.suggestedValue = reader.string(); + break; + } + case 5: { + message.inheritFromParent = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -37179,6 +39665,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.ListPolicy"; + }; + /** * AllValues enum. * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues @@ -37290,9 +39791,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.enforced = reader.bool(); - break; + case 1: { + message.enforced = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -37382,6 +39884,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BooleanPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.BooleanPolicy"; + }; + return BooleanPolicy; })(); @@ -37542,6 +40059,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestoreDefault + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.RestoreDefault"; + }; + return RestoreDefault; })(); @@ -37701,37 +40233,41 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); - break; - case 1: - message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); - break; - case 2: - if (message.items === $util.emptyObject) - message.items = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.osconfig.v1.Inventory.Item.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.items === $util.emptyObject) + message.items = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.osconfig.v1.Inventory.Item.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.items[key] = value; + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; } - message.items[key] = value; - break; - case 4: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -37876,6 +40412,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Inventory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Inventory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory"; + }; + Inventory.OsInfo = (function() { /** @@ -38045,30 +40596,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 9: - message.hostname = reader.string(); - break; - case 2: - message.longName = reader.string(); - break; - case 3: - message.shortName = reader.string(); - break; - case 4: - message.version = reader.string(); - break; - case 5: - message.architecture = reader.string(); - break; - case 6: - message.kernelVersion = reader.string(); - break; - case 7: - message.kernelRelease = reader.string(); - break; - case 8: - message.osconfigAgentVersion = reader.string(); - break; + case 9: { + message.hostname = reader.string(); + break; + } + case 2: { + message.longName = reader.string(); + break; + } + case 3: { + message.shortName = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.architecture = reader.string(); + break; + } + case 6: { + message.kernelVersion = reader.string(); + break; + } + case 7: { + message.kernelRelease = reader.string(); + break; + } + case 8: { + message.osconfigAgentVersion = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -38215,6 +40774,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OsInfo + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.OsInfo"; + }; + return OsInfo; })(); @@ -38390,27 +40964,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.originType = reader.int32(); - break; - case 8: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); - break; - case 7: - message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); - break; + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.originType = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -38613,6 +41194,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.Item"; + }; + /** * OriginType enum. * @name google.cloud.osconfig.v1.Inventory.Item.OriginType @@ -38840,33 +41436,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); - break; - case 2: - message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); - break; - case 3: - message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); - break; - case 4: - message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); - break; - case 5: - message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.decode(reader, reader.uint32()); - break; - case 6: - message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); - break; - case 7: - message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); - break; - case 8: - message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); - break; - case 9: - message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.decode(reader, reader.uint32()); - break; + case 1: { + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 2: { + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 4: { + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 5: { + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 9: { + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -39126,6 +41731,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SoftwarePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwarePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.SoftwarePackage"; + }; + return SoftwarePackage; })(); @@ -39243,15 +41863,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.packageName = reader.string(); - break; - case 2: - message.architecture = reader.string(); - break; - case 3: - message.version = reader.string(); - break; + case 4: { + message.packageName = reader.string(); + break; + } + case 2: { + message.architecture = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -39358,6 +41981,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for VersionedPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionedPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.VersionedPackage"; + }; + return VersionedPackage; })(); @@ -39486,18 +42124,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.patchName = reader.string(); - break; - case 2: - message.category = reader.string(); - break; - case 3: - message.severity = reader.string(); - break; - case 4: - message.summary = reader.string(); - break; + case 5: { + message.patchName = reader.string(); + break; + } + case 2: { + message.category = reader.string(); + break; + } + case 3: { + message.severity = reader.string(); + break; + } + case 4: { + message.summary = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -39612,6 +42254,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ZypperPatch + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperPatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.ZypperPatch"; + }; + return ZypperPatch; })(); @@ -39801,39 +42458,48 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.kbArticleIds && message.kbArticleIds.length)) - message.kbArticleIds = []; - message.kbArticleIds.push(reader.string()); - break; - case 11: - message.supportUrl = reader.string(); - break; - case 5: - if (!(message.moreInfoUrls && message.moreInfoUrls.length)) - message.moreInfoUrls = []; - message.moreInfoUrls.push(reader.string()); - break; - case 6: - message.updateId = reader.string(); - break; - case 7: - message.revisionNumber = reader.int32(); - break; - case 10: - message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + } + case 11: { + message.supportUrl = reader.string(); + break; + } + case 5: { + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + } + case 6: { + message.updateId = reader.string(); + break; + } + case 7: { + message.revisionNumber = reader.int32(); + break; + } + case 10: { + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -40036,6 +42702,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WindowsUpdatePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdatePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage"; + }; + WindowsUpdatePackage.WindowsUpdateCategory = (function() { /** @@ -40139,12 +42820,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.name = reader.string(); - break; + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -40243,6 +42926,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WindowsUpdateCategory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdateCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory"; + }; + return WindowsUpdateCategory; })(); @@ -40374,18 +43072,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.caption = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.hotFixId = reader.string(); - break; - case 5: - message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.caption = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.hotFixId = reader.string(); + break; + } + case 5: { + message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -40505,6 +43207,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsQuickFixEngineeringPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage"; + }; + return WindowsQuickFixEngineeringPackage; })(); @@ -40644,21 +43361,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.displayName = reader.string(); - break; - case 2: - message.displayVersion = reader.string(); - break; - case 3: - message.publisher = reader.string(); - break; - case 4: - message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - case 5: - message.helpLink = reader.string(); - break; + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.displayVersion = reader.string(); + break; + } + case 3: { + message.publisher = reader.string(); + break; + } + case 4: { + message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 5: { + message.helpLink = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -40786,6 +43508,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WindowsApplication + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsApplication"; + }; + return WindowsApplication; })(); @@ -40895,12 +43632,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.view = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -41017,6 +43756,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetInventoryRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetInventoryRequest"; + }; + return GetInventoryRequest; })(); @@ -41156,21 +43910,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.view = reader.int32(); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; - case 5: - message.filter = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + 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; @@ -41311,6 +44070,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInventoriesRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListInventoriesRequest"; + }; + return ListInventoriesRequest; })(); @@ -41419,14 +44193,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.inventories && message.inventories.length)) - message.inventories = []; - message.inventories.push($root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -41542,6 +44318,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInventoriesResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListInventoriesResponse"; + }; + return ListInventoriesResponse; })(); @@ -41684,14 +44475,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; @@ -41807,6 +44600,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; })(); @@ -42017,38 +44825,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; @@ -42270,6 +45088,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; })(); @@ -42376,12 +45209,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; @@ -42480,6 +45315,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; })(); @@ -42674,36 +45524,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; @@ -42901,6 +45758,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 @@ -43037,12 +45909,14 @@ 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; + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -43141,6 +46015,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; })(); @@ -43250,11 +46139,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; @@ -43361,6 +46251,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; })(); @@ -43382,6 +46287,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 */ /** @@ -43502,6 +46408,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 @@ -43557,6 +46471,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; }; @@ -43591,66 +46507,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; @@ -43762,6 +46694,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; }; @@ -43854,6 +46789,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -43885,6 +46822,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -43931,6 +46869,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; }; @@ -43945,6 +46885,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; })(); @@ -44155,52 +47110,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; @@ -44501,6 +47466,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() { /** @@ -44615,15 +47595,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; @@ -44735,6 +47718,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; })(); @@ -44841,12 +47839,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; @@ -44945,6 +47945,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; })(); @@ -45045,11 +48060,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; @@ -45156,6 +48172,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; })(); @@ -45361,39 +48392,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; @@ -45680,6 +48722,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 @@ -45848,12 +48905,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; @@ -45957,6 +49016,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; })(); @@ -46102,27 +49176,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; @@ -46298,6 +49377,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() { /** @@ -46401,12 +49495,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; @@ -46505,6 +49601,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; })(); @@ -46625,15 +49736,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; @@ -46745,6 +49859,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; })(); @@ -46864,17 +49993,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; @@ -47004,6 +50136,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; })(); @@ -47154,24 +50301,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; @@ -47307,6 +50460,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; })(); @@ -47637,76 +50805,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; @@ -48019,6 +51209,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 @@ -48187,26 +51392,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; @@ -48360,6 +51571,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; })(); @@ -48373,6 +51599,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 @@ -48429,6 +51656,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -48505,6 +51740,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(); @@ -48550,42 +51787,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; @@ -48645,6 +51895,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"; @@ -48730,6 +51983,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) @@ -48817,6 +52072,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")) @@ -48831,6 +52087,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) @@ -48857,6 +52115,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 @@ -48986,11 +52259,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; @@ -49097,6 +52371,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; })(); @@ -49216,17 +52505,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; @@ -49351,6 +52643,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; })(); @@ -49459,14 +52766,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; @@ -49582,6 +52891,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; })(); @@ -49712,20 +53036,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; @@ -49858,6 +53186,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; })(); @@ -50012,28 +53355,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; @@ -50223,6 +53572,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 @@ -50402,29 +53766,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; @@ -50537,7 +53908,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); @@ -50618,6 +53989,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() { /** @@ -50719,12 +54105,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; @@ -50825,6 +54213,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; })(); @@ -50925,11 +54328,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; @@ -51036,6 +54440,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() { /** @@ -51184,37 +54603,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; @@ -51375,6 +54799,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; })(); @@ -51475,11 +54914,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; @@ -51586,6 +55026,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() { /** @@ -51596,6 +55051,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 */ /** @@ -51646,6 +55102,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 @@ -51682,6 +55146,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; }; @@ -51716,25 +55182,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -51786,6 +55260,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; }; @@ -51814,6 +55297,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; }; @@ -51836,6 +55333,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -51848,6 +55346,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; }; @@ -51862,6 +55362,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; })(); @@ -52025,6 +55556,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; })(); @@ -52131,12 +55677,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; @@ -52249,6 +55797,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; })(); @@ -52348,28 +55911,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.fields[key] = value; + break; } - message.fields[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -52478,6 +56042,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + return Struct; })(); @@ -52642,24 +56221,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.nullValue = reader.int32(); - break; - case 2: - message.numberValue = reader.double(); - break; - case 3: - message.stringValue = reader.string(); - break; - case 4: - message.boolValue = reader.bool(); - break; - case 5: - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 6: - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -52843,6 +56428,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + return Value; })(); @@ -52952,11 +56552,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -53063,6 +56664,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + return ListValue; })(); @@ -53169,12 +56785,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; @@ -53236,7 +56854,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; }; @@ -53282,6 +56900,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; })(); @@ -53388,12 +57021,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; @@ -53506,6 +57141,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; })(); @@ -53603,11 +57253,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; @@ -53709,6 +57360,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; })(); @@ -53838,15 +57504,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.year = reader.int32(); - break; - case 2: - message.month = reader.int32(); - break; - case 3: - message.day = reader.int32(); - break; + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -53953,6 +57622,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + return Date; })(); @@ -54081,18 +57765,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -54207,6 +57895,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + return Expr; })(); @@ -54239,6 +57942,7 @@ * @interface IPolicy * @property {number|null} [version] Policy version * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs * @property {Uint8Array|null} [etag] Policy etag */ @@ -54252,6 +57956,7 @@ */ function Policy(properties) { this.bindings = []; + this.auditConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54274,6 +57979,14 @@ */ Policy.prototype.bindings = $util.emptyArray; + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + /** * Policy etag. * @member {Uint8Array} etag @@ -54313,6 +58026,9 @@ if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -54347,17 +58063,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.int32(); - break; - case 4: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - case 3: - message.etag = reader.bytes(); - break; + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -54405,6 +58130,15 @@ return "bindings." + error; } } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } if (message.etag != null && message.hasOwnProperty("etag")) if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) return "etag: buffer expected"; @@ -54435,10 +58169,20 @@ message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); } } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } if (object.etag != null) if (typeof object.etag === "string") $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) + else if (object.etag.length >= 0) message.etag = object.etag; return message; }; @@ -54456,8 +58200,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.bindings = []; + object.auditConfigs = []; + } if (options.defaults) { object.version = 0; if (options.bytes === String) @@ -54477,6 +58223,11 @@ for (var j = 0; j < message.bindings.length; ++j) object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } return object; }; @@ -54491,6 +58242,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + return Policy; })(); @@ -54610,17 +58376,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - case 3: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -54745,9 +58514,556 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + return Binding; })(); + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + v1.PolicyDelta = (function() { /** @@ -54855,16 +59171,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -54997,6 +59315,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + return PolicyDelta; })(); @@ -55125,18 +59458,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - case 4: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -55274,6 +59611,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + /** * Action enum. * @name google.iam.v1.BindingDelta.Action @@ -55418,18 +59770,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.service = reader.string(); - break; - case 3: - message.exemptedMember = reader.string(); - break; - case 4: - message.logType = reader.string(); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -55562,6 +59918,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + /** * Action enum. * @name google.iam.v1.AuditConfigDelta.Action @@ -55786,27 +60157,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); - break; - case 5: - message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); - break; - case 6: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); + break; + } + case 5: { + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -55978,6 +60356,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessLevel"; + }; + return AccessLevel; })(); @@ -56086,14 +60479,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); - break; - case 2: - message.combiningFunction = reader.int32(); - break; + case 1: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.combiningFunction = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -56222,6 +60617,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BasicLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.BasicLevel"; + }; + /** * ConditionCombiningFunction enum. * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction @@ -56394,32 +60804,38 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.ipSubnetworks && message.ipSubnetworks.length)) - message.ipSubnetworks = []; - message.ipSubnetworks.push(reader.string()); - break; - case 2: - message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) - message.requiredAccessLevels = []; - message.requiredAccessLevels.push(reader.string()); - break; - case 5: - message.negate = reader.bool(); - break; - case 6: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - case 7: - if (!(message.regions && message.regions.length)) - message.regions = []; - message.regions.push(reader.string()); - break; + case 1: { + if (!(message.ipSubnetworks && message.ipSubnetworks.length)) + message.ipSubnetworks = []; + message.ipSubnetworks.push(reader.string()); + break; + } + case 2: { + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) + message.requiredAccessLevels = []; + message.requiredAccessLevels.push(reader.string()); + break; + } + case 5: { + message.negate = reader.bool(); + break; + } + case 6: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 7: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -56605,6 +61021,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.Condition"; + }; + return Condition; })(); @@ -56700,9 +61131,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -56797,6 +61229,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CustomLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.CustomLevel"; + }; + return CustomLevel; })(); @@ -56959,40 +61406,46 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.requireScreenlock = reader.bool(); - break; - case 2: - if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) - message.allowedEncryptionStatuses = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.requireScreenlock = reader.bool(); + break; + } + case 2: { + if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) + message.allowedEncryptionStatuses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedEncryptionStatuses.push(reader.int32()); + } else message.allowedEncryptionStatuses.push(reader.int32()); - } else - message.allowedEncryptionStatuses.push(reader.int32()); - break; - case 3: - if (!(message.osConstraints && message.osConstraints.length)) - message.osConstraints = []; - message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) - message.allowedDeviceManagementLevels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 3: { + if (!(message.osConstraints && message.osConstraints.length)) + message.osConstraints = []; + message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) + message.allowedDeviceManagementLevels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedDeviceManagementLevels.push(reader.int32()); + } else message.allowedDeviceManagementLevels.push(reader.int32()); - } else - message.allowedDeviceManagementLevels.push(reader.int32()); - break; - case 7: - message.requireAdminApproval = reader.bool(); - break; - case 8: - message.requireCorpOwned = reader.bool(); - break; + break; + } + case 7: { + message.requireAdminApproval = reader.bool(); + break; + } + case 8: { + message.requireCorpOwned = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -57216,6 +61669,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DevicePolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DevicePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.DevicePolicy"; + }; + return DevicePolicy; })(); @@ -57333,15 +61801,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.osType = reader.int32(); - break; - case 2: - message.minimumVersion = reader.string(); - break; - case 3: - message.requireVerifiedChromeOs = reader.bool(); - break; + case 1: { + message.osType = reader.int32(); + break; + } + case 2: { + message.minimumVersion = reader.string(); + break; + } + case 3: { + message.requireVerifiedChromeOs = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -57486,6 +61957,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OsConstraint + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.OsConstraint"; + }; + return OsConstraint; })(); @@ -57636,24 +62122,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.parent = reader.string(); - break; - case 3: - message.title = reader.string(); - break; - case 4: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.etag = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.title = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -57794,6 +62286,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccessPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessPolicy"; + }; + return AccessPolicy; })(); @@ -57977,33 +62484,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.perimeterType = reader.int32(); - break; - case 7: - message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); - break; - case 8: - message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); - break; - case 9: - message.useExplicitDryRunSpec = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.perimeterType = reader.int32(); + break; + } + case 7: { + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.useExplicitDryRunSpec = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -58191,6 +62707,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServicePerimeter + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeter"; + }; + /** * PerimeterType enum. * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType @@ -58339,24 +62870,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push(reader.string()); - break; - case 2: - if (!(message.accessLevels && message.accessLevels.length)) - message.accessLevels = []; - message.accessLevels.push(reader.string()); - break; - case 4: - if (!(message.restrictedServices && message.restrictedServices.length)) - message.restrictedServices = []; - message.restrictedServices.push(reader.string()); - break; - case 10: - message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); - break; + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.accessLevels && message.accessLevels.length)) + message.accessLevels = []; + message.accessLevels.push(reader.string()); + break; + } + case 4: { + if (!(message.restrictedServices && message.restrictedServices.length)) + message.restrictedServices = []; + message.restrictedServices.push(reader.string()); + break; + } + case 10: { + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -58513,6 +63048,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServicePerimeterConfig + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig"; + }; + ServicePerimeterConfig.VpcAccessibleServices = (function() { /** @@ -58618,14 +63168,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.enableRestriction = reader.bool(); - break; - case 2: - if (!(message.allowedServices && message.allowedServices.length)) - message.allowedServices = []; - message.allowedServices.push(reader.string()); - break; + case 1: { + message.enableRestriction = reader.bool(); + break; + } + case 2: { + if (!(message.allowedServices && message.allowedServices.length)) + message.allowedServices = []; + message.allowedServices.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -58736,6 +63288,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for VpcAccessibleServices + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccessibleServices.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices"; + }; + return VpcAccessibleServices; })(); @@ -58992,17 +63559,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; @@ -59127,6 +63697,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; })(); @@ -59175,7 +63760,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} @@ -59208,7 +63793,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} @@ -59241,7 +63826,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} @@ -59274,7 +63859,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} @@ -59307,7 +63892,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} @@ -59492,21 +64077,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; @@ -59657,6 +64247,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; })(); @@ -59752,9 +64357,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; @@ -59844,6 +64450,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; })(); @@ -59972,18 +64593,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; @@ -60098,6 +64723,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; })(); @@ -60206,14 +64846,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; @@ -60329,6 +64971,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; })(); @@ -60424,9 +65081,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; @@ -60516,6 +65174,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; })(); @@ -60611,9 +65284,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; @@ -60703,6 +65377,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; })(); @@ -60809,12 +65498,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; @@ -60918,6 +65609,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; })(); @@ -61024,12 +65730,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; @@ -61128,6 +65836,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; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 073cdd91fb8..dc5f02d8f90 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -4469,6 +4469,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -4997,6 +5001,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -5289,6 +5300,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } @@ -5479,6 +5503,11 @@ "type": "Binding", "id": 4 }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, "etag": { "type": "bytes", "id": 3 @@ -5502,6 +5531,42 @@ } } }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, "PolicyDelta": { "fields": { "bindingDeltas": { diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 8727a710f81..01b8a715834 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -162,7 +162,8 @@ describe('quickstart sample tests', () => { assert.include(stdout, assetName); }); - it('should search all resources successfully', async () => { + // https://github.com/googleapis/nodejs-asset/issues/650 + it.skip('should search all resources successfully', async () => { const query = `name:${instanceName}`; const stdout = execSync(`node searchAllResources '' ${query}`); assert.include(stdout, instanceName); From f8f21176f875304a0827997e9480cff1fc59275a 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 05:06:28 +0000 Subject: [PATCH 409/429] fix: do not import the whole google-gax from proto JS (#1553) (#655) 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-asset/package.json | 2 +- packages/google-cloud-asset/protos/protos.d.ts | 2 +- packages/google-cloud-asset/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c823631b627..625f226c6e7 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -44,7 +44,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index e808832e802..742a831847b 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index f307e50657c..b69ab6cff90 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/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 1932c193539f3cb66242c9ec028529e5bc8e25c9 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 21:02:15 +0000 Subject: [PATCH 410/429] fix: allow passing gax instance to client constructor (#656) - [ ] 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 --- .../src/v1/asset_service_client.ts | 101 ++++++++++-------- .../src/v1p1beta1/asset_service_client.ts | 39 ++++--- .../src/v1p2beta1/asset_service_client.ts | 41 +++++-- .../src/v1p5beta1/asset_service_client.ts | 33 ++++-- 4 files changed, 137 insertions(+), 77 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index f2d9dda721e..8cd562ef76f 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_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 './asset_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class AssetServiceClient { * 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 AssetServiceClient({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 AssetServiceClient; const servicePath = @@ -120,8 +128,13 @@ export class AssetServiceClient { 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); @@ -290,7 +303,7 @@ export class AssetServiceClient { 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; } /** @@ -560,7 +573,7 @@ export class AssetServiceClient { 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(); @@ -656,7 +669,7 @@ export class AssetServiceClient { 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(); @@ -742,7 +755,7 @@ export class AssetServiceClient { 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(); @@ -827,7 +840,7 @@ export class AssetServiceClient { 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(); @@ -918,7 +931,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'feed.name': request.feed!.name || '', }); this.initialize(); @@ -1004,7 +1017,7 @@ export class AssetServiceClient { 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(); @@ -1119,7 +1132,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'analysis_query.scope': request.analysisQuery!.scope || '', }); this.initialize(); @@ -1218,7 +1231,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -1368,7 +1381,7 @@ export class AssetServiceClient { 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(); @@ -1470,7 +1483,7 @@ export class AssetServiceClient { 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(); @@ -1557,7 +1570,7 @@ export class AssetServiceClient { 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(); @@ -1651,7 +1664,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'saved_query.name': request.savedQuery!.name || '', }); this.initialize(); @@ -1741,7 +1754,7 @@ export class AssetServiceClient { 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(); @@ -1854,7 +1867,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); this.initialize(); @@ -2022,7 +2035,7 @@ export class AssetServiceClient { 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(); @@ -2048,11 +2061,12 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest > > { - 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.exportAssets, this._gaxModule.createDefaultBackoffSettings() @@ -2188,7 +2202,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'analysis_query.scope': request.analysisQuery!.scope || '', }); this.initialize(); @@ -2218,11 +2232,12 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata > > { - 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.analyzeIamPolicyLongrunning, this._gaxModule.createDefaultBackoffSettings() @@ -2368,7 +2383,7 @@ export class AssetServiceClient { 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(); @@ -2457,7 +2472,7 @@ export class AssetServiceClient { 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['listAssets']; @@ -2555,7 +2570,7 @@ export class AssetServiceClient { 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['listAssets']; @@ -2799,7 +2814,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); this.initialize(); @@ -2974,7 +2989,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllResources']; @@ -3158,7 +3173,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllResources']; @@ -3355,7 +3370,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); this.initialize(); @@ -3483,7 +3498,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; @@ -3620,7 +3635,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; @@ -3735,7 +3750,7 @@ export class AssetServiceClient { 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(); @@ -3790,7 +3805,7 @@ export class AssetServiceClient { 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['listSavedQueries']; @@ -3854,7 +3869,7 @@ export class AssetServiceClient { 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['listSavedQueries']; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index cb630357e42..3501403cb0f 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_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, @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -36,7 +35,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './asset_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -95,8 +93,18 @@ export class AssetServiceClient { * 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 AssetServiceClient({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 AssetServiceClient; const servicePath = @@ -116,8 +124,13 @@ export class AssetServiceClient { 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); @@ -187,7 +200,7 @@ export class AssetServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -427,7 +440,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); this.initialize(); @@ -486,7 +499,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllResources']; @@ -554,7 +567,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllResources']; @@ -679,7 +692,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); this.initialize(); @@ -733,7 +746,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; @@ -796,7 +809,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ scope: request.scope || '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 5631758cf61..52428b963d1 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -17,8 +17,13 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './asset_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -88,8 +92,18 @@ export class AssetServiceClient { * 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 AssetServiceClient({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 AssetServiceClient; const servicePath = @@ -109,8 +123,13 @@ export class AssetServiceClient { 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); @@ -179,7 +198,7 @@ export class AssetServiceClient { 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; } /** @@ -396,7 +415,7 @@ export class AssetServiceClient { 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(); @@ -484,7 +503,7 @@ export class AssetServiceClient { 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(); @@ -571,7 +590,7 @@ export class AssetServiceClient { 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(); @@ -664,7 +683,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'feed.name': request.feed!.name || '', }); this.initialize(); @@ -752,7 +771,7 @@ export class AssetServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index c52aee52958..089553663eb 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_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, @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -36,7 +35,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './asset_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -96,8 +94,18 @@ export class AssetServiceClient { * 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 AssetServiceClient({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 AssetServiceClient; const servicePath = @@ -117,8 +125,13 @@ export class AssetServiceClient { 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); @@ -198,7 +211,7 @@ export class AssetServiceClient { 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; } /** @@ -431,7 +444,7 @@ export class AssetServiceClient { 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(); @@ -490,7 +503,7 @@ export class AssetServiceClient { 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['listAssets']; @@ -558,7 +571,7 @@ export class AssetServiceClient { 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['listAssets']; From dd647e560c1b4d013a0e6f7279461fa28e3c9dd7 Mon Sep 17 00:00:00 2001 From: aaronlichen-hp <75718017+aaronlichen-hp@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:23:31 -0700 Subject: [PATCH 411/429] feat: add batchGetEffectiveIamPolicies sample code. (#654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add batchGetEffectiveIamPolicies sample code. Add batchGetEffectiveIamPolicies sample code and also lint the protobuf imports. * chore: fix the Copyright year for getBatchEffectiveIamPolicies.js * chore: refactor logging and remove loop for checking results * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: modify the logging to print nested Object. Co-authored-by: Owl Bot --- packages/google-cloud-asset/README.md | 1 + packages/google-cloud-asset/samples/README.md | 20 +++++++++++++++++++ .../samples/test/sample.test.js | 6 ++++++ 3 files changed, 27 insertions(+) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index b3e43a0e333..e3b98f29d78 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -102,6 +102,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/tree/ | Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | | Export Assets To BigQuery | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssetsBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssetsBigquery.js,samples/README.md) | | Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | +| Batch Get Effective Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchEffectiveIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchEffectiveIamPolicies.js,samples/README.md) | | Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | | List Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) | | List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index 7d4134da420..17c1698f4e7 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -20,6 +20,7 @@ * [Export Assets](#export-assets) * [Export Assets To BigQuery](#export-assets-to-bigquery) * [Get Batch Asset History](#get-batch-asset-history) + * [Batch Get Effective Iam Policies](#batch-get-effective-iam-policies) * [Get Feed](#get-feed) * [List Assets](#list-assets) * [List Feeds](#list-feeds) @@ -195,6 +196,25 @@ __Usage:__ +### Batch Get Effective Iam Policies + +Batch get effective IAM policies that match a request. + +View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchEffectiveIamPolicies.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchEffectiveIamPolicies.js,samples/README.md) + +__Usage:__ + + +`node batchGetEffectiveIamPolicies` + + +----- + + + + ### Get Feed Get Feed. diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 01b8a715834..4689a5b1e87 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -186,6 +186,12 @@ describe('quickstart sample tests', () => { assert.include(stdout, 'relatedAsset'); }); + it('should get effective iam policies successfully', async () => { + const assetName = `//storage.googleapis.com/${bucketName}`; + const stdout = execSync(`node getBatchEffectiveIamPolicies ${assetName}`); + assert.include(stdout, assetName); + }); + it('should analyze iam policy successfully', async () => { const stdout = execSync('node analyzeIamPolicy'); assert.include(stdout, '//cloudresourcemanager.googleapis.com/projects'); From 7f3271143a7a4cb154bb4a992e6297d515e05c8d Mon Sep 17 00:00:00 2001 From: wutonggg <111254114+wutonggg@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:36:25 -0700 Subject: [PATCH 412/429] fix 641: remove vm after test (#644) Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../samples/test/sample.test.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index 4689a5b1e87..bbbea928228 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -63,7 +63,6 @@ describe('quickstart sample tests', () => { await bucket.create(); await bigquery.createDataset(datasetId, options); await bigquery.dataset(datasetId).exists(); - // [vm] = await zone.vm(vmName, {os: 'ubuntu'}); const [response] = await instancesClient.insert({ instanceResource: { @@ -107,6 +106,22 @@ describe('quickstart sample tests', () => { after(async () => { await bucket.delete(); await bigquery.dataset(datasetId).delete({force: true}).catch(console.warn); + const [response] = await instancesClient.delete({ + instance: instanceName, + project: projectId, + zone, + }); + let operation = response.latestResponse; + const operationsClient = new compute.ZoneOperationsClient(); + + // Wait for the delete operation to complete. + while (operation.status !== 'DONE') { + [operation] = await operationsClient.wait({ + operation: operation.name, + project: projectId, + zone: operation.zone.split('/').pop(), + }); + } }); it('should export assets to specified path', async () => { From 3ecbf732471bd3994f7e503799f803327fa0ef6d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 04:02:30 +0200 Subject: [PATCH 413/429] fix(deps): update dependency uuid to v9 (#657) --- packages/google-cloud-asset/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 67ab886b674..2f043b41e72 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -19,7 +19,7 @@ "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", - "uuid": "^8.0.0", + "uuid": "^9.0.0", "yargs": "^16.0.0" }, "devDependencies": { From df813382701b7d03c45ad4faa5f336c1cecacd32 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 12:47:17 -0700 Subject: [PATCH 414/429] chore(main): release 4.3.0 (#652) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 4.3.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-asset/CHANGELOG.md | 17 +++++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../snippet_metadata.google.cloud.asset.v1.json | 2 +- ...t_metadata.google.cloud.asset.v1p1beta1.json | 2 +- ...t_metadata.google.cloud.asset.v1p2beta1.json | 2 +- ...t_metadata.google.cloud.asset.v1p4beta1.json | 2 +- ...t_metadata.google.cloud.asset.v1p5beta1.json | 2 +- .../google-cloud-asset/samples/package.json | 2 +- 8 files changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 453e86bd57b..28b6a72136b 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,23 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [4.3.0](https://github.com/googleapis/nodejs-asset/compare/v4.2.0...v4.3.0) (2022-09-09) + + +### Features + +* Add batchGetEffectiveIamPolicies sample code. ([#654](https://github.com/googleapis/nodejs-asset/issues/654)) ([11160b0](https://github.com/googleapis/nodejs-asset/commit/11160b098aec0854fe21fb79144120b9cb29caf6)) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#656](https://github.com/googleapis/nodejs-asset/issues/656)) ([af56ac6](https://github.com/googleapis/nodejs-asset/commit/af56ac6e2213df8bc65e95fee860251569075130)) +* Change import long to require ([#648](https://github.com/googleapis/nodejs-asset/issues/648)) ([0af8467](https://github.com/googleapis/nodejs-asset/commit/0af8467d716cc4f5bfb69482d4264350ceea2ec1)) +* **deps:** Update dependency uuid to v9 ([#657](https://github.com/googleapis/nodejs-asset/issues/657)) ([fac4751](https://github.com/googleapis/nodejs-asset/commit/fac4751e36b3d6340c6323d476bd7fc7ec6a8a30)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-asset/issues/1553)) ([#655](https://github.com/googleapis/nodejs-asset/issues/655)) ([25a9d42](https://github.com/googleapis/nodejs-asset/commit/25a9d42aa57e8a331aa115d6dcb7aa8bf16c4909)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-asset/issues/1546)) ([#651](https://github.com/googleapis/nodejs-asset/issues/651)) ([4fc24d0](https://github.com/googleapis/nodejs-asset/commit/4fc24d0bd85fca6d7a3b3b0e84f1b520d12d368d)) +* use google-gax v3.3.0 ([25a9d42](https://github.com/googleapis/nodejs-asset/commit/25a9d42aa57e8a331aa115d6dcb7aa8bf16c4909)) + ## [4.2.0](https://github.com/googleapis/nodejs-asset/compare/v4.1.0...v4.2.0) (2022-08-23) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 625f226c6e7..6cd2d28b016 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "4.2.0", + "version": "4.3.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index 65ffdbc2ebe..fa0676e7db6 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 5edea90dda2..7623ff64ce8 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index c0fbf66a547..e71fbbd0030 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index 93e0593be4d..36c07894ae5 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index d31d46706f9..ad1aee6415d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 2f043b41e72..d94655f27ea 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^4.2.0", + "@google-cloud/asset": "^4.3.0", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", From b83382cbe027440a8b1e7feb52d240a72ec3c87f 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:30:27 +0000 Subject: [PATCH 415/429] fix: preserve default values in x-goog-request-params header (#658) - [ ] 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 --- .../src/v1/asset_service_client.ts | 56 +- .../src/v1p1beta1/asset_service_client.ts | 12 +- .../src/v1p2beta1/asset_service_client.ts | 10 +- .../src/v1p5beta1/asset_service_client.ts | 6 +- .../test/gapic_asset_service_v1.ts | 2079 +++++++++-------- .../test/gapic_asset_service_v1p1beta1.ts | 321 +-- .../test/gapic_asset_service_v1p2beta1.ts | 433 ++-- .../test/gapic_asset_service_v1p5beta1.ts | 168 +- 8 files changed, 1604 insertions(+), 1481 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 8cd562ef76f..e3d8dc39362 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -574,7 +574,7 @@ export class AssetServiceClient { 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.batchGetAssetsHistory(request, options, callback); @@ -670,7 +670,7 @@ export class AssetServiceClient { 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.createFeed(request, options, callback); @@ -756,7 +756,7 @@ export class AssetServiceClient { 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.getFeed(request, options, callback); @@ -841,7 +841,7 @@ export class AssetServiceClient { 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.listFeeds(request, options, callback); @@ -932,7 +932,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'feed.name': request.feed!.name || '', + 'feed.name': request.feed!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFeed(request, options, callback); @@ -1018,7 +1018,7 @@ export class AssetServiceClient { 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.deleteFeed(request, options, callback); @@ -1133,7 +1133,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'analysis_query.scope': request.analysisQuery!.scope || '', + 'analysis_query.scope': request.analysisQuery!.scope ?? '', }); this.initialize(); return this.innerApiCalls.analyzeIamPolicy(request, options, callback); @@ -1232,7 +1232,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.analyzeMove(request, options, callback); @@ -1382,7 +1382,7 @@ export class AssetServiceClient { 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.queryAssets(request, options, callback); @@ -1484,7 +1484,7 @@ export class AssetServiceClient { 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.createSavedQuery(request, options, callback); @@ -1571,7 +1571,7 @@ export class AssetServiceClient { 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.getSavedQuery(request, options, callback); @@ -1665,7 +1665,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'saved_query.name': request.savedQuery!.name || '', + 'saved_query.name': request.savedQuery!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSavedQuery(request, options, callback); @@ -1755,7 +1755,7 @@ export class AssetServiceClient { 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.deleteSavedQuery(request, options, callback); @@ -1868,7 +1868,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); this.initialize(); return this.innerApiCalls.batchGetEffectiveIamPolicies( @@ -2036,7 +2036,7 @@ export class AssetServiceClient { 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.exportAssets(request, options, callback); @@ -2203,7 +2203,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'analysis_query.scope': request.analysisQuery!.scope || '', + 'analysis_query.scope': request.analysisQuery!.scope ?? '', }); this.initialize(); return this.innerApiCalls.analyzeIamPolicyLongrunning( @@ -2384,7 +2384,7 @@ export class AssetServiceClient { 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.listAssets(request, options, callback); @@ -2473,7 +2473,7 @@ export class AssetServiceClient { 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['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -2571,7 +2571,7 @@ export class AssetServiceClient { 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['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -2815,7 +2815,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); this.initialize(); return this.innerApiCalls.searchAllResources(request, options, callback); @@ -2990,7 +2990,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); @@ -3174,7 +3174,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); @@ -3371,7 +3371,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); this.initialize(); return this.innerApiCalls.searchAllIamPolicies(request, options, callback); @@ -3499,7 +3499,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); @@ -3636,7 +3636,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); @@ -3751,7 +3751,7 @@ export class AssetServiceClient { 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.listSavedQueries(request, options, callback); @@ -3806,7 +3806,7 @@ export class AssetServiceClient { 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['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); @@ -3870,7 +3870,7 @@ export class AssetServiceClient { 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['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 3501403cb0f..0f6563d7437 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -441,7 +441,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); this.initialize(); return this.innerApiCalls.searchAllResources(request, options, callback); @@ -500,7 +500,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); @@ -568,7 +568,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); @@ -693,7 +693,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); this.initialize(); return this.innerApiCalls.searchAllIamPolicies(request, options, callback); @@ -747,7 +747,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); @@ -810,7 +810,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - scope: request.scope || '', + scope: request.scope ?? '', }); const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index 52428b963d1..d0f1f63268c 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -416,7 +416,7 @@ export class AssetServiceClient { 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.createFeed(request, options, callback); @@ -504,7 +504,7 @@ export class AssetServiceClient { 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.getFeed(request, options, callback); @@ -591,7 +591,7 @@ export class AssetServiceClient { 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.listFeeds(request, options, callback); @@ -684,7 +684,7 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'feed.name': request.feed!.name || '', + 'feed.name': request.feed!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFeed(request, options, callback); @@ -772,7 +772,7 @@ export class AssetServiceClient { 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.deleteFeed(request, options, callback); diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index 089553663eb..a5241a7e91d 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -445,7 +445,7 @@ export class AssetServiceClient { 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.listAssets(request, options, callback); @@ -504,7 +504,7 @@ export class AssetServiceClient { 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['listAssets']; const callSettings = defaultCallSettings.merge(options); @@ -572,7 +572,7 @@ export class AssetServiceClient { 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['listAssets']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 6901fd1cbdf..231975365ac 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_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 @@ -252,15 +267,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetAssetsHistoryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() ); @@ -268,11 +280,14 @@ describe('v1.AssetServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchGetAssetsHistory(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchGetAssetsHistory as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchGetAssetsHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchGetAssetsHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchGetAssetsHistory without error using callback', async () => { @@ -284,15 +299,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetAssetsHistoryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() ); @@ -315,11 +327,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchGetAssetsHistory as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchGetAssetsHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchGetAssetsHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchGetAssetsHistory with error', async () => { @@ -331,15 +346,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetAssetsHistoryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( undefined, @@ -349,11 +361,14 @@ describe('v1.AssetServiceClient', () => { client.batchGetAssetsHistory(request), expectedError ); - assert( - (client.innerApiCalls.batchGetAssetsHistory as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchGetAssetsHistory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchGetAssetsHistory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchGetAssetsHistory with closed client', async () => { @@ -365,7 +380,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetAssetsHistoryRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -385,26 +404,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); client.innerApiCalls.createFeed = stubSimpleCall(expectedResponse); const [response] = await client.createFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeed without error using callback', async () => { @@ -416,15 +434,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -447,11 +461,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeed with error', async () => { @@ -463,26 +480,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeed = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createFeed(request), expectedError); - assert( - (client.innerApiCalls.createFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeed with closed client', async () => { @@ -494,7 +510,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFeed(request), expectedError); @@ -511,26 +530,23 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); client.innerApiCalls.getFeed = stubSimpleCall(expectedResponse); const [response] = await client.getFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeed without error using callback', async () => { @@ -542,15 +558,9 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -573,11 +583,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeed with error', async () => { @@ -589,23 +602,20 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getFeed(request), expectedError); - assert( - (client.innerApiCalls.getFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeed with closed client', async () => { @@ -617,7 +627,8 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeed(request), expectedError); @@ -634,26 +645,23 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsResponse() ); client.innerApiCalls.listFeeds = stubSimpleCall(expectedResponse); const [response] = await client.listFeeds(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeeds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeeds without error using callback', async () => { @@ -665,15 +673,9 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsResponse() ); @@ -696,11 +698,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeeds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeeds with error', async () => { @@ -712,23 +717,20 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listFeeds(request), expectedError); - assert( - (client.innerApiCalls.listFeeds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeeds with closed client', async () => { @@ -740,7 +742,8 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.listFeeds(request), expectedError); @@ -757,27 +760,27 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); client.innerApiCalls.updateFeed = stubSimpleCall(expectedResponse); const [response] = await client.updateFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeed without error using callback', async () => { @@ -789,16 +792,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -821,11 +821,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeed with error', async () => { @@ -837,27 +840,27 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeed = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateFeed(request), expectedError); - assert( - (client.innerApiCalls.updateFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeed with closed client', async () => { @@ -869,8 +872,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFeed(request), expectedError); @@ -887,26 +894,23 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteFeed = stubSimpleCall(expectedResponse); const [response] = await client.deleteFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeed without error using callback', async () => { @@ -918,15 +922,9 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -949,11 +947,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeed with error', async () => { @@ -965,26 +966,23 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeed = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteFeed(request), expectedError); - assert( - (client.innerApiCalls.deleteFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeed with closed client', async () => { @@ -996,7 +994,8 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteFeed(request), expectedError); @@ -1013,27 +1012,27 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ + 'analysisQuery', + 'scope', + ]); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() ); client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.analyzeIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeIamPolicy without error using callback', async () => { @@ -1045,16 +1044,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ + 'analysisQuery', + 'scope', + ]); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() ); @@ -1077,11 +1073,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeIamPolicy with error', async () => { @@ -1093,27 +1092,27 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ + 'analysisQuery', + 'scope', + ]); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.analyzeIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.analyzeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeIamPolicy with closed client', async () => { @@ -1125,8 +1124,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ + 'analysisQuery', + 'scope', + ]); + request.analysisQuery.scope = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.analyzeIamPolicy(request), expectedError); @@ -1143,26 +1146,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveResponse() ); client.innerApiCalls.analyzeMove = stubSimpleCall(expectedResponse); const [response] = await client.analyzeMove(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeMove as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeMove as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeMove as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeMove without error using callback', async () => { @@ -1174,15 +1176,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveResponse() ); @@ -1205,11 +1203,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeMove as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.analyzeMove as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeMove as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeMove with error', async () => { @@ -1221,26 +1222,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeMove = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.analyzeMove(request), expectedError); - assert( - (client.innerApiCalls.analyzeMove as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeMove as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeMove as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeMove with closed client', async () => { @@ -1252,7 +1252,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.analyzeMove(request), expectedError); @@ -1269,26 +1272,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsResponse() ); client.innerApiCalls.queryAssets = stubSimpleCall(expectedResponse); const [response] = await client.queryAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryAssets without error using callback', async () => { @@ -1300,15 +1302,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsResponse() ); @@ -1331,11 +1329,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryAssets with error', async () => { @@ -1347,26 +1348,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.queryAssets(request), expectedError); - assert( - (client.innerApiCalls.queryAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryAssets with closed client', async () => { @@ -1378,7 +1378,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.queryAssets(request), expectedError); @@ -1395,26 +1398,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); client.innerApiCalls.createSavedQuery = stubSimpleCall(expectedResponse); const [response] = await client.createSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSavedQuery without error using callback', async () => { @@ -1426,15 +1428,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1457,11 +1455,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSavedQuery with error', async () => { @@ -1473,26 +1474,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createSavedQuery = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createSavedQuery(request), expectedError); - assert( - (client.innerApiCalls.createSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSavedQuery with closed client', async () => { @@ -1504,7 +1504,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createSavedQuery(request), expectedError); @@ -1521,26 +1524,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); client.innerApiCalls.getSavedQuery = stubSimpleCall(expectedResponse); const [response] = await client.getSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSavedQuery without error using callback', async () => { @@ -1552,15 +1554,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1583,11 +1581,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSavedQuery with error', async () => { @@ -1599,26 +1600,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSavedQuery = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getSavedQuery(request), expectedError); - assert( - (client.innerApiCalls.getSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSavedQuery with closed client', async () => { @@ -1630,7 +1630,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSavedQuery(request), expectedError); @@ -1647,27 +1650,27 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.savedQuery = {}; - request.savedQuery.name = ''; - const expectedHeaderRequestParams = 'saved_query.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.savedQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ + 'savedQuery', + 'name', + ]); + request.savedQuery.name = defaultValue1; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); client.innerApiCalls.updateSavedQuery = stubSimpleCall(expectedResponse); const [response] = await client.updateSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSavedQuery without error using callback', async () => { @@ -1679,16 +1682,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.savedQuery = {}; - request.savedQuery.name = ''; - const expectedHeaderRequestParams = 'saved_query.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.savedQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ + 'savedQuery', + 'name', + ]); + request.savedQuery.name = defaultValue1; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1711,11 +1711,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSavedQuery with error', async () => { @@ -1727,27 +1730,27 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.savedQuery = {}; - request.savedQuery.name = ''; - const expectedHeaderRequestParams = 'saved_query.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.savedQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ + 'savedQuery', + 'name', + ]); + request.savedQuery.name = defaultValue1; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSavedQuery = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateSavedQuery(request), expectedError); - assert( - (client.innerApiCalls.updateSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSavedQuery with closed client', async () => { @@ -1759,8 +1762,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.savedQuery = {}; - request.savedQuery.name = ''; + request.savedQuery ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ + 'savedQuery', + 'name', + ]); + request.savedQuery.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateSavedQuery(request), expectedError); @@ -1777,26 +1784,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteSavedQuery = stubSimpleCall(expectedResponse); const [response] = await client.deleteSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSavedQuery without error using callback', async () => { @@ -1808,15 +1814,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1839,11 +1841,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSavedQuery with error', async () => { @@ -1855,26 +1860,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSavedQuery = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteSavedQuery(request), expectedError); - assert( - (client.innerApiCalls.deleteSavedQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteSavedQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSavedQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSavedQuery with closed client', async () => { @@ -1886,7 +1890,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteSavedQuery(request), expectedError); @@ -1903,15 +1910,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetEffectiveIamPoliciesRequest', + ['scope'] + ); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() ); @@ -1919,11 +1923,14 @@ describe('v1.AssetServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchGetEffectiveIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchGetEffectiveIamPolicies without error using callback', async () => { @@ -1935,15 +1942,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetEffectiveIamPoliciesRequest', + ['scope'] + ); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() ); @@ -1966,11 +1970,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchGetEffectiveIamPolicies with error', async () => { @@ -1982,15 +1989,12 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetEffectiveIamPoliciesRequest', + ['scope'] + ); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCall( undefined, @@ -2000,11 +2004,14 @@ describe('v1.AssetServiceClient', () => { client.batchGetEffectiveIamPolicies(request), expectedError ); - assert( - (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchGetEffectiveIamPolicies with closed client', async () => { @@ -2016,7 +2023,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); - request.scope = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchGetEffectiveIamPoliciesRequest', + ['scope'] + ); + request.scope = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2036,15 +2047,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2052,11 +2059,14 @@ describe('v1.AssetServiceClient', () => { const [operation] = await client.exportAssets(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportAssets without error using callback', async () => { @@ -2068,15 +2078,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2106,11 +2112,14 @@ describe('v1.AssetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportAssets with call error', async () => { @@ -2122,26 +2131,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportAssets = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.exportAssets(request), expectedError); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportAssets with LRO error', async () => { @@ -2153,15 +2161,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportAssets = stubLongRunningCall( undefined, @@ -2170,11 +2174,14 @@ describe('v1.AssetServiceClient', () => { ); const [operation] = await client.exportAssets(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportAssetsProgress without error', async () => { @@ -2226,16 +2233,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'AnalyzeIamPolicyLongrunningRequest', + ['analysisQuery', 'scope'] + ); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2244,11 +2248,14 @@ describe('v1.AssetServiceClient', () => { const [operation] = await client.analyzeIamPolicyLongrunning(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { @@ -2260,16 +2267,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'AnalyzeIamPolicyLongrunningRequest', + ['analysisQuery', 'scope'] + ); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2299,11 +2303,14 @@ describe('v1.AssetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeIamPolicyLongrunning with call error', async () => { @@ -2315,16 +2322,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'AnalyzeIamPolicyLongrunningRequest', + ['analysisQuery', 'scope'] + ); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( undefined, @@ -2334,11 +2338,14 @@ describe('v1.AssetServiceClient', () => { client.analyzeIamPolicyLongrunning(request), expectedError ); - assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { @@ -2350,16 +2357,13 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.analysisQuery ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'AnalyzeIamPolicyLongrunningRequest', + ['analysisQuery', 'scope'] + ); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( undefined, @@ -2368,11 +2372,14 @@ describe('v1.AssetServiceClient', () => { ); const [operation] = await client.analyzeIamPolicyLongrunning(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { @@ -2428,15 +2435,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2445,11 +2448,14 @@ describe('v1.AssetServiceClient', () => { client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets without error using callback', async () => { @@ -2461,15 +2467,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2494,11 +2496,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets with error', async () => { @@ -2510,26 +2515,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAssets(request), expectedError); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssetsStream without error', async () => { @@ -2541,8 +2545,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2570,11 +2577,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2587,8 +2595,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -2613,11 +2624,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2630,8 +2642,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2651,11 +2666,12 @@ describe('v1.AssetServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2668,8 +2684,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -2688,11 +2707,12 @@ describe('v1.AssetServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2707,15 +2727,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -2731,11 +2747,14 @@ describe('v1.AssetServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchAllResources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllResources without error using callback', async () => { @@ -2747,15 +2766,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -2786,11 +2801,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllResources with error', async () => { @@ -2802,26 +2820,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllResources = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.searchAllResources(request), expectedError); - assert( - (client.innerApiCalls.searchAllResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllResourcesStream without error', async () => { @@ -2833,8 +2850,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -2872,11 +2892,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllResources, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2889,8 +2910,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2917,11 +2941,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllResources, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2934,8 +2959,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -2962,11 +2990,12 @@ describe('v1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2979,8 +3008,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2998,11 +3030,12 @@ describe('v1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3017,15 +3050,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3041,11 +3070,14 @@ describe('v1.AssetServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchAllIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllIamPolicies without error using callback', async () => { @@ -3057,15 +3089,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3098,11 +3126,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllIamPolicies with error', async () => { @@ -3114,26 +3145,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.searchAllIamPolicies(request), expectedError); - assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllIamPoliciesStream without error', async () => { @@ -3145,8 +3175,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3184,11 +3217,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3201,8 +3235,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3229,11 +3266,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3246,8 +3284,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3274,11 +3315,12 @@ describe('v1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3291,8 +3333,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3310,11 +3355,12 @@ describe('v1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3329,15 +3375,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3346,11 +3388,14 @@ describe('v1.AssetServiceClient', () => { client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); const [response] = await client.listSavedQueries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueries without error using callback', async () => { @@ -3362,15 +3407,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3395,11 +3436,14 @@ describe('v1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueries with error', async () => { @@ -3411,26 +3455,25 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listSavedQueries(request), expectedError); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueriesStream without error', async () => { @@ -3442,8 +3485,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3474,11 +3520,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSavedQueries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3491,8 +3538,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3518,11 +3568,12 @@ describe('v1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSavedQueries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3535,8 +3586,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3556,11 +3610,12 @@ describe('v1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3573,8 +3628,11 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3591,11 +3649,12 @@ describe('v1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index 55b72abcafd..98094f7ab53 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -222,15 +237,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -246,11 +257,14 @@ describe('v1p1beta1.AssetServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchAllResources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllResources without error using callback', async () => { @@ -262,15 +276,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -303,11 +313,14 @@ describe('v1p1beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllResources with error', async () => { @@ -319,26 +332,25 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllResources = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.searchAllResources(request), expectedError); - assert( - (client.innerApiCalls.searchAllResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllResourcesStream without error', async () => { @@ -350,8 +362,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -391,11 +406,12 @@ describe('v1p1beta1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllResources, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -408,8 +424,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -438,11 +457,12 @@ describe('v1p1beta1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllResources, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -455,8 +475,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -483,11 +506,12 @@ describe('v1p1beta1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -500,8 +524,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -519,11 +546,12 @@ describe('v1p1beta1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -538,15 +566,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -562,11 +586,14 @@ describe('v1p1beta1.AssetServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchAllIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllIamPolicies without error using callback', async () => { @@ -578,15 +605,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -619,11 +642,14 @@ describe('v1p1beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllIamPolicies with error', async () => { @@ -635,26 +661,25 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.searchAllIamPolicies(request), expectedError); - assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllIamPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllIamPoliciesStream without error', async () => { @@ -666,8 +691,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -707,11 +735,12 @@ describe('v1p1beta1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -724,8 +753,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -754,11 +786,12 @@ describe('v1p1beta1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -771,8 +804,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -799,11 +835,12 @@ describe('v1p1beta1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -816,8 +853,11 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ + 'scope', + ]); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -835,11 +875,12 @@ describe('v1p1beta1.AssetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index e6fa8b52180..fad2994ce69 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -25,6 +25,21 @@ import * as assetserviceModule from '../src'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -159,26 +174,25 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); client.innerApiCalls.createFeed = stubSimpleCall(expectedResponse); const [response] = await client.createFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeed without error using callback', async () => { @@ -190,15 +204,11 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -221,11 +231,14 @@ describe('v1p2beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeed with error', async () => { @@ -237,26 +250,25 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeed = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createFeed(request), expectedError); - assert( - (client.innerApiCalls.createFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeed with closed client', async () => { @@ -268,7 +280,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createFeed(request), expectedError); @@ -285,26 +300,23 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); client.innerApiCalls.getFeed = stubSimpleCall(expectedResponse); const [response] = await client.getFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeed without error using callback', async () => { @@ -316,15 +328,9 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -347,11 +353,14 @@ describe('v1p2beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeed with error', async () => { @@ -363,23 +372,20 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getFeed(request), expectedError); - assert( - (client.innerApiCalls.getFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeed with closed client', async () => { @@ -391,7 +397,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeed(request), expectedError); @@ -408,26 +415,23 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() ); client.innerApiCalls.listFeeds = stubSimpleCall(expectedResponse); const [response] = await client.listFeeds(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeeds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeeds without error using callback', async () => { @@ -439,15 +443,9 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() ); @@ -470,11 +468,14 @@ describe('v1p2beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeeds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeeds with error', async () => { @@ -486,23 +487,20 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listFeeds(request), expectedError); - assert( - (client.innerApiCalls.listFeeds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeeds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeeds with closed client', async () => { @@ -514,7 +512,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.listFeeds(request), expectedError); @@ -531,27 +530,27 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); client.innerApiCalls.updateFeed = stubSimpleCall(expectedResponse); const [response] = await client.updateFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeed without error using callback', async () => { @@ -563,16 +562,13 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -595,11 +591,14 @@ describe('v1p2beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeed with error', async () => { @@ -611,27 +610,27 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; - const expectedHeaderRequestParams = 'feed.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeed = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateFeed(request), expectedError); - assert( - (client.innerApiCalls.updateFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeed with closed client', async () => { @@ -643,8 +642,12 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); - request.feed = {}; - request.feed.name = ''; + request.feed ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ + 'feed', + 'name', + ]); + request.feed.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFeed(request), expectedError); @@ -661,26 +664,23 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteFeed = stubSimpleCall(expectedResponse); const [response] = await client.deleteFeed(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeed without error using callback', async () => { @@ -692,15 +692,9 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -723,11 +717,14 @@ describe('v1p2beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeed with error', async () => { @@ -739,26 +736,23 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeed = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteFeed(request), expectedError); - assert( - (client.innerApiCalls.deleteFeed as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeed as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeed with closed client', async () => { @@ -770,7 +764,8 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteFeed(request), expectedError); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 6d865b7fee1..695d018a436 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -222,15 +237,11 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -239,11 +250,14 @@ describe('v1p5beta1.AssetServiceClient', () => { client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); const [response] = await client.listAssets(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets without error using callback', async () => { @@ -255,15 +269,11 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -288,11 +298,14 @@ describe('v1p5beta1.AssetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssets with error', async () => { @@ -304,26 +317,25 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAssets(request), expectedError); - assert( - (client.innerApiCalls.listAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssetsStream without error', async () => { @@ -335,8 +347,11 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -367,11 +382,12 @@ describe('v1p5beta1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -384,8 +400,11 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -413,11 +432,12 @@ describe('v1p5beta1.AssetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssets, request) ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -430,8 +450,11 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -451,11 +474,12 @@ describe('v1p5beta1.AssetServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -468,8 +492,11 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -488,11 +515,12 @@ describe('v1p5beta1.AssetServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From f8600363734cc9483966170a014afb555f6b856c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 15:53:42 -0700 Subject: [PATCH 416/429] feat: Add client library support for AssetService v1 SavedQuery APIs (#662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add client library support for AssetService v1 SavedQuery APIs Committer: jeffreyai@ PiperOrigin-RevId: 475366952 Source-Link: https://github.com/googleapis/googleapis/commit/7428dad9f642a1b74fe4c4a23efe2d84234ac27f Source-Link: https://github.com/googleapis/googleapis-gen/commit/5629e2ab728443a1a6abb03f34f925d5cd4e0c47 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTYyOWUyYWI3Mjg0NDNhMWE2YWJiMDNmMzRmOTI1ZDVjZDRlMGM0NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1/asset_service_client_config.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index c74ddac1ee1..f98d630aad1 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -93,23 +93,28 @@ "retry_params_name": "default" }, "CreateSavedQuery": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetSavedQuery": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListSavedQueries": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateSavedQuery": { + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteSavedQuery": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "idempotent", "retry_params_name": "default" }, "BatchGetEffectiveIamPolicies": { From 2a29061e8524a791c110bf58a4424b54694cd901 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 11:31:45 -0700 Subject: [PATCH 417/429] build: use fully qualified request type name in tests (#663) 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 * 🦉 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_asset_service_v1.ts | 572 ++++++++++-------- .../test/gapic_asset_service_v1p1beta1.ts | 98 +-- .../test/gapic_asset_service_v1p2beta1.ts | 120 ++-- .../test/gapic_asset_service_v1p5beta1.ts | 49 +- 4 files changed, 496 insertions(+), 343 deletions(-) diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 231975365ac..76257153fca 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -268,7 +268,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetAssetsHistoryRequest', + '.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent'] ); request.parent = defaultValue1; @@ -300,7 +300,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetAssetsHistoryRequest', + '.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent'] ); request.parent = defaultValue1; @@ -347,7 +347,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetAssetsHistoryRequest', + '.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent'] ); request.parent = defaultValue1; @@ -381,7 +381,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetAssetsHistoryRequest', + '.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent'] ); request.parent = defaultValue1; @@ -404,9 +404,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -434,9 +435,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -480,9 +482,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -510,9 +513,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -530,7 +534,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -558,7 +565,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -602,7 +612,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -627,7 +640,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -645,7 +661,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -673,7 +692,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -717,7 +739,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -742,7 +767,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -761,10 +789,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -793,10 +821,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -841,10 +869,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -873,10 +901,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -894,7 +922,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -922,7 +953,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -966,7 +1000,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -994,7 +1031,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1013,10 +1053,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); request.analysisQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ - 'analysisQuery', - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeIamPolicyRequest', + ['analysisQuery', 'scope'] + ); request.analysisQuery.scope = defaultValue1; const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1045,10 +1085,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); request.analysisQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ - 'analysisQuery', - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeIamPolicyRequest', + ['analysisQuery', 'scope'] + ); request.analysisQuery.scope = defaultValue1; const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1093,10 +1133,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); request.analysisQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ - 'analysisQuery', - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeIamPolicyRequest', + ['analysisQuery', 'scope'] + ); request.analysisQuery.scope = defaultValue1; const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1125,10 +1165,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() ); request.analysisQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('AnalyzeIamPolicyRequest', [ - 'analysisQuery', - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeIamPolicyRequest', + ['analysisQuery', 'scope'] + ); request.analysisQuery.scope = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1146,9 +1186,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeMoveRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1176,9 +1217,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeMoveRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1222,9 +1264,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeMoveRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1252,9 +1295,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveRequest() ); - const defaultValue1 = getTypeDefaultValue('AnalyzeMoveRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.AnalyzeMoveRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1272,9 +1316,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.QueryAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1302,9 +1347,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.QueryAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1348,9 +1394,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.QueryAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1378,9 +1425,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('QueryAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.QueryAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1398,9 +1446,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateSavedQueryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1428,9 +1477,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateSavedQueryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1474,9 +1524,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateSavedQueryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1504,9 +1555,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateSavedQueryRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.CreateSavedQueryRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1524,9 +1576,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1554,9 +1607,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1600,9 +1654,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1630,9 +1685,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.GetSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1651,10 +1707,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); request.savedQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ - 'savedQuery', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateSavedQueryRequest', + ['savedQuery', 'name'] + ); request.savedQuery.name = defaultValue1; const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1683,10 +1739,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); request.savedQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ - 'savedQuery', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateSavedQueryRequest', + ['savedQuery', 'name'] + ); request.savedQuery.name = defaultValue1; const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1731,10 +1787,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); request.savedQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ - 'savedQuery', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateSavedQueryRequest', + ['savedQuery', 'name'] + ); request.savedQuery.name = defaultValue1; const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1763,10 +1819,10 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); request.savedQuery ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateSavedQueryRequest', [ - 'savedQuery', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.UpdateSavedQueryRequest', + ['savedQuery', 'name'] + ); request.savedQuery.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1784,9 +1840,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1814,9 +1871,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1860,9 +1918,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1890,9 +1949,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteSavedQueryRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.DeleteSavedQueryRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1911,7 +1971,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetEffectiveIamPoliciesRequest', + '.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope'] ); request.scope = defaultValue1; @@ -1943,7 +2003,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetEffectiveIamPoliciesRequest', + '.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope'] ); request.scope = defaultValue1; @@ -1990,7 +2050,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetEffectiveIamPoliciesRequest', + '.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope'] ); request.scope = defaultValue1; @@ -2024,7 +2084,7 @@ describe('v1.AssetServiceClient', () => { new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'BatchGetEffectiveIamPoliciesRequest', + '.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope'] ); request.scope = defaultValue1; @@ -2047,9 +2107,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ExportAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2078,9 +2139,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ExportAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2131,9 +2193,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ExportAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2161,9 +2224,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ExportAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ExportAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ExportAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2235,7 +2299,7 @@ describe('v1.AssetServiceClient', () => { ); request.analysisQuery ??= {}; const defaultValue1 = getTypeDefaultValue( - 'AnalyzeIamPolicyLongrunningRequest', + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; @@ -2269,7 +2333,7 @@ describe('v1.AssetServiceClient', () => { ); request.analysisQuery ??= {}; const defaultValue1 = getTypeDefaultValue( - 'AnalyzeIamPolicyLongrunningRequest', + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; @@ -2324,7 +2388,7 @@ describe('v1.AssetServiceClient', () => { ); request.analysisQuery ??= {}; const defaultValue1 = getTypeDefaultValue( - 'AnalyzeIamPolicyLongrunningRequest', + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; @@ -2359,7 +2423,7 @@ describe('v1.AssetServiceClient', () => { ); request.analysisQuery ??= {}; const defaultValue1 = getTypeDefaultValue( - 'AnalyzeIamPolicyLongrunningRequest', + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; @@ -2435,9 +2499,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2467,9 +2532,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2515,9 +2581,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2545,9 +2612,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2595,9 +2663,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2642,9 +2711,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2684,9 +2754,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2727,9 +2798,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -2766,9 +2838,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -2820,9 +2893,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2850,9 +2924,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -2910,9 +2985,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2959,9 +3035,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -3008,9 +3085,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3050,9 +3128,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -3089,9 +3168,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -3145,9 +3225,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3175,9 +3256,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -3235,9 +3317,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3284,9 +3367,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -3333,9 +3417,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3375,9 +3460,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3407,9 +3493,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3455,9 +3542,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3485,9 +3573,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3538,9 +3627,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3586,9 +3676,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3628,9 +3719,10 @@ describe('v1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1.ListSavedQueriesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index 98094f7ab53..3373cbe95a4 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -237,9 +237,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -276,9 +277,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -332,9 +334,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -362,9 +365,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -424,9 +428,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -475,9 +480,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -524,9 +530,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllResourcesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -566,9 +573,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -605,9 +613,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -661,9 +670,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -691,9 +701,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -753,9 +764,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); @@ -804,9 +816,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedResponse = [ @@ -853,9 +866,10 @@ describe('v1p1beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllIamPoliciesRequest', [ - 'scope', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', + ['scope'] + ); request.scope = defaultValue1; const expectedHeaderRequestParams = `scope=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index fad2994ce69..4fe6e2474a6 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -174,9 +174,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -204,9 +205,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -250,9 +252,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -280,9 +283,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateFeedRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.CreateFeedRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -300,7 +304,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -328,7 +335,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -372,7 +382,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -397,7 +410,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('GetFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.GetFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -415,7 +431,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -443,7 +462,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -487,7 +509,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -512,7 +537,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListFeedsRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.ListFeedsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -531,10 +559,10 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -563,10 +591,10 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -611,10 +639,10 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -643,10 +671,10 @@ describe('v1p2beta1.AssetServiceClient', () => { new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() ); request.feed ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateFeedRequest', [ - 'feed', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.UpdateFeedRequest', + ['feed', 'name'] + ); request.feed.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -664,7 +692,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -692,7 +723,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -736,7 +770,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -764,7 +801,10 @@ describe('v1p2beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteFeedRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p2beta1.DeleteFeedRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 695d018a436..333c7a01937 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -237,9 +237,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -269,9 +270,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -317,9 +319,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -347,9 +350,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -400,9 +404,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -450,9 +455,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -492,9 +498,10 @@ describe('v1p5beta1.AssetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssetsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.asset.v1p5beta1.ListAssetsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From e0e6f3a59bdd4a2be40fe3b3131c932e24e885fe Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 15:24:25 +0000 Subject: [PATCH 418/429] chore(main): release 4.4.0 (#659) :robot: I have created a release *beep* *boop* --- ## [4.4.0](https://github.com/googleapis/nodejs-asset/compare/v4.3.0...v4.4.0) (2022-09-22) ### Features * Add client library support for AssetService v1 SavedQuery APIs ([#662](https://github.com/googleapis/nodejs-asset/issues/662)) ([68c8ece](https://github.com/googleapis/nodejs-asset/commit/68c8eceb6b0ff0c646992439886892eb0528ec8d)) ### Bug Fixes * Preserve default values in x-goog-request-params header ([#658](https://github.com/googleapis/nodejs-asset/issues/658)) ([e351ed1](https://github.com/googleapis/nodejs-asset/commit/e351ed172211d240968beb82cd0f106222f2b632)) --- 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-asset/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../v1/snippet_metadata.google.cloud.asset.v1.json | 2 +- ...nippet_metadata.google.cloud.asset.v1p1beta1.json | 2 +- ...nippet_metadata.google.cloud.asset.v1p2beta1.json | 2 +- ...nippet_metadata.google.cloud.asset.v1p4beta1.json | 2 +- ...nippet_metadata.google.cloud.asset.v1p5beta1.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index 28b6a72136b..de459b992d0 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [4.4.0](https://github.com/googleapis/nodejs-asset/compare/v4.3.0...v4.4.0) (2022-09-22) + + +### Features + +* Add client library support for AssetService v1 SavedQuery APIs ([#662](https://github.com/googleapis/nodejs-asset/issues/662)) ([68c8ece](https://github.com/googleapis/nodejs-asset/commit/68c8eceb6b0ff0c646992439886892eb0528ec8d)) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#658](https://github.com/googleapis/nodejs-asset/issues/658)) ([e351ed1](https://github.com/googleapis/nodejs-asset/commit/e351ed172211d240968beb82cd0f106222f2b632)) + ## [4.3.0](https://github.com/googleapis/nodejs-asset/compare/v4.2.0...v4.3.0) (2022-09-09) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 6cd2d28b016..5a1a7b8acda 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "4.3.0", + "version": "4.4.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index fa0676e7db6..cb444ddbd0f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 7623ff64ce8..155b315f124 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index e71fbbd0030..292139bf41a 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index 36c07894ae5..7771162886a 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index ad1aee6415d..afda0367849 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.3.0", + "version": "4.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index d94655f27ea..d567b55bf7a 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^4.3.0", + "@google-cloud/asset": "^4.4.0", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", From 0b06be612afe9e452a583aae4275c1de8176667b Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:48:41 -0700 Subject: [PATCH 419/429] fix(deps): use google-gax v3.5.2 (#669) --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 5a1a7b8acda..71d8fbd656f 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -44,7 +44,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 2313c4ffc899ae3b2e9e5a69918b08369be09d66 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:26:27 +0100 Subject: [PATCH 420/429] chore(deps): update dependency jsdoc to v4 (#672) 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.3` -> `^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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 71d8fbd656f..92b9e61c50b 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -53,7 +53,7 @@ "c8": "^7.1.0", "codecov": "^3.6.5", "gts": "^3.1.0", - "jsdoc": "^3.6.3", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From eab76cabc007c2e70a2a9399dbd7d8de24e603da Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 11:06:27 +0100 Subject: [PATCH 421/429] chore(deps): update dependency @types/node to v18 (#667) 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-asset). --- packages/google-cloud-asset/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 92b9e61c50b..5d5a5262df7 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "codecov": "^3.6.5", From 1205d0b6f99c9332ed671666ad7bb75b900e2bb9 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:50:51 -0800 Subject: [PATCH 422/429] Update .repo-metadata.json --- packages/google-cloud-asset/.repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index 4c412267323..67703c8422e 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -1,5 +1,5 @@ { - "name": "asset", + "name": "cloudasset", "name_pretty": "Cloud Asset Inventory", "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/asset/latest", From 5d5fc57044767b7282ae02afe92bac5ce4c85c0f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:08:14 +0000 Subject: [PATCH 423/429] fix: regenerated protos JS and TS definitions (#673) 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 --- .../google-cloud-asset/protos/protos.d.ts | 2 +- packages/google-cloud-asset/protos/protos.js | 288 +++++++++++++++--- 2 files changed, 252 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 742a831847b..fe1eef20206 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/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-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index b69ab6cff90..a5368ae635c 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -1253,6 +1253,12 @@ message.assetTypes[i] = String(object.assetTypes[i]); } switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; case "CONTENT_TYPE_UNSPECIFIED": case 0: message.contentType = 0; @@ -1330,7 +1336,7 @@ object.assetTypes[j] = message.assetTypes[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); if (message.relationshipTypes && message.relationshipTypes.length) { @@ -1935,6 +1941,12 @@ message.assetTypes[i] = String(object.assetTypes[i]); } switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; case "CONTENT_TYPE_UNSPECIFIED": case 0: message.contentType = 0; @@ -2012,7 +2024,7 @@ object.assetTypes[j] = message.assetTypes[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -2590,6 +2602,12 @@ message.assetNames[i] = String(object.assetNames[i]); } switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; case "CONTENT_TYPE_UNSPECIFIED": case 0: message.contentType = 0; @@ -2664,7 +2682,7 @@ object.assetNames[j] = message.assetNames[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); if (message.relationshipTypes && message.relationshipTypes.length) { @@ -5668,6 +5686,12 @@ return object; var message = new $root.google.cloud.asset.v1.PartitionSpec(); switch (object.partitionKey) { + default: + if (typeof object.partitionKey === "number") { + message.partitionKey = object.partitionKey; + break; + } + break; case "PARTITION_KEY_UNSPECIFIED": case 0: message.partitionKey = 0; @@ -5700,7 +5724,7 @@ if (options.defaults) object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) - object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.PartitionSpec.PartitionKey[message.partitionKey] : message.partitionKey; + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.PartitionSpec.PartitionKey[message.partitionKey] === undefined ? message.partitionKey : $root.google.cloud.asset.v1.PartitionSpec.PartitionKey[message.partitionKey] : message.partitionKey; return object; }; @@ -6491,6 +6515,12 @@ message.assetTypes[i] = String(object.assetTypes[i]); } switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; case "CONTENT_TYPE_UNSPECIFIED": case 0: message.contentType = 0; @@ -6577,7 +6607,7 @@ object.assetTypes[j] = message.assetTypes[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); if (message.condition != null && message.hasOwnProperty("condition")) @@ -10904,6 +10934,12 @@ if (object.tablePrefix != null) message.tablePrefix = String(object.tablePrefix); switch (object.partitionKey) { + default: + if (typeof object.partitionKey === "number") { + message.partitionKey = object.partitionKey; + break; + } + break; case "PARTITION_KEY_UNSPECIFIED": case 0: message.partitionKey = 0; @@ -10942,7 +10978,7 @@ if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) object.tablePrefix = message.tablePrefix; if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) - object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] : message.partitionKey; + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] === undefined ? message.partitionKey : $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] : message.partitionKey; if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) object.writeDisposition = message.writeDisposition; return object; @@ -13687,6 +13723,12 @@ if (object.destinationParent != null) message.destinationParent = String(object.destinationParent); switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; case "ANALYSIS_VIEW_UNSPECIFIED": case 0: message.view = 0; @@ -13726,7 +13768,7 @@ if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) object.destinationParent = message.destinationParent; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] === undefined ? message.view : $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; return object; }; @@ -18068,6 +18110,12 @@ message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); } switch (object.priorAssetState) { + default: + if (typeof object.priorAssetState === "number") { + message.priorAssetState = object.priorAssetState; + break; + } + break; case "PRIOR_ASSET_STATE_UNSPECIFIED": case 0: message.priorAssetState = 0; @@ -18124,7 +18172,7 @@ if (message.asset != null && message.hasOwnProperty("asset")) object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) - object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; + object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] === undefined ? message.priorAssetState : $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); return object; @@ -23056,6 +23104,12 @@ return object; var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisState(); switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; case "OK": case 0: message.code = 0; @@ -23148,7 +23202,7 @@ object.cause = ""; } if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; + object.code = options.enums === String ? $root.google.rpc.Code[message.code] === undefined ? message.code : $root.google.rpc.Code[message.code] : message.code; if (message.cause != null && message.hasOwnProperty("cause")) object.cause = message.cause; return object; @@ -23340,6 +23394,12 @@ return object; var message = new $root.google.cloud.asset.v1.ConditionEvaluation(); switch (object.evaluationValue) { + default: + if (typeof object.evaluationValue === "number") { + message.evaluationValue = object.evaluationValue; + break; + } + break; case "EVALUATION_VALUE_UNSPECIFIED": case 0: message.evaluationValue = 0; @@ -23376,7 +23436,7 @@ if (options.defaults) object.evaluationValue = options.enums === String ? "EVALUATION_VALUE_UNSPECIFIED" : 0; if (message.evaluationValue != null && message.hasOwnProperty("evaluationValue")) - object.evaluationValue = options.enums === String ? $root.google.cloud.asset.v1.ConditionEvaluation.EvaluationValue[message.evaluationValue] : message.evaluationValue; + object.evaluationValue = options.enums === String ? $root.google.cloud.asset.v1.ConditionEvaluation.EvaluationValue[message.evaluationValue] === undefined ? message.evaluationValue : $root.google.cloud.asset.v1.ConditionEvaluation.EvaluationValue[message.evaluationValue] : message.evaluationValue; return object; }; @@ -30436,6 +30496,12 @@ message.assetTypes[i] = String(object.assetTypes[i]); } switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; case "CONTENT_TYPE_UNSPECIFIED": case 0: message.contentType = 0; @@ -30492,7 +30558,7 @@ object.assetTypes[j] = message.assetTypes[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; @@ -35671,6 +35737,12 @@ return object; var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState(); switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; case "OK": case 0: message.code = 0; @@ -35763,7 +35835,7 @@ object.cause = ""; } if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; + object.code = options.enums === String ? $root.google.rpc.Code[message.code] === undefined ? message.code : $root.google.rpc.Code[message.code] : message.code; if (message.cause != null && message.hasOwnProperty("cause")) object.cause = message.cause; return object; @@ -37705,6 +37777,12 @@ message.assetTypes[i] = String(object.assetTypes[i]); } switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; case "CONTENT_TYPE_UNSPECIFIED": case 0: message.contentType = 0; @@ -37765,7 +37843,7 @@ object.assetTypes[j] = message.assetTypes[j]; } if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p5beta1.ContentType[message.contentType] : message.contentType; + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p5beta1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1p5beta1.ContentType[message.contentType] : message.contentType; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -39593,6 +39671,12 @@ message.deniedValues[i] = String(object.deniedValues[i]); } switch (object.allValues) { + default: + if (typeof object.allValues === "number") { + message.allValues = object.allValues; + break; + } + break; case "ALL_VALUES_UNSPECIFIED": case 0: message.allValues = 0; @@ -39646,7 +39730,7 @@ object.deniedValues[j] = message.deniedValues[j]; } if (message.allValues != null && message.hasOwnProperty("allValues")) - object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; + object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] === undefined ? message.allValues : $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) object.suggestedValue = message.suggestedValue; if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) @@ -41094,6 +41178,12 @@ if (object.id != null) message.id = String(object.id); switch (object.originType) { + default: + if (typeof object.originType === "number") { + message.originType = object.originType; + break; + } + break; case "ORIGIN_TYPE_UNSPECIFIED": case 0: message.originType = 0; @@ -41114,6 +41204,12 @@ message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -41163,9 +41259,9 @@ if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; if (message.originType != null && message.hasOwnProperty("originType")) - object.originType = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] : message.originType; + object.originType = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] === undefined ? message.originType : $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] : message.originType; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] : message.type; if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { object.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.installedPackage, options); if (options.oneofs) @@ -43705,6 +43801,12 @@ if (object.name != null) message.name = String(object.name); switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; case "INVENTORY_VIEW_UNSPECIFIED": case 0: message.view = 0; @@ -43741,7 +43843,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; return object; }; @@ -44004,6 +44106,12 @@ if (object.parent != null) message.parent = String(object.parent); switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; case "INVENTORY_VIEW_UNSPECIFIED": case 0: message.view = 0; @@ -44049,7 +44157,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -45663,6 +45771,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; @@ -45687,6 +45801,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; @@ -45734,7 +45852,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")) @@ -45742,7 +45860,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; }; @@ -48553,6 +48671,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; @@ -48567,6 +48691,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; @@ -48693,9 +48823,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")) @@ -51042,6 +51172,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; @@ -51150,7 +51286,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")) @@ -51952,6 +52088,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; @@ -51968,6 +52110,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; @@ -52006,6 +52154,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; @@ -52076,7 +52228,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")) @@ -52084,7 +52236,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")) @@ -52097,7 +52249,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); @@ -53474,6 +53626,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; @@ -53543,7 +53701,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) @@ -55298,6 +55456,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; @@ -55347,7 +55511,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; }; @@ -56347,6 +56511,12 @@ return object; var message = new $root.google.protobuf.Value(); switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; case "NULL_VALUE": case 0: message.nullValue = 0; @@ -56385,7 +56555,7 @@ options = {}; var object = {}; if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.kind = "nullValue"; } @@ -58963,6 +59133,12 @@ return object; var message = new $root.google.iam.v1.AuditLogConfig(); switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; case "LOG_TYPE_UNSPECIFIED": case 0: message.logType = 0; @@ -59008,7 +59184,7 @@ if (options.defaults) object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; if (message.exemptedMembers && message.exemptedMembers.length) { object.exemptedMembers = []; for (var j = 0; j < message.exemptedMembers.length; ++j) @@ -59545,6 +59721,12 @@ return object; var message = new $root.google.iam.v1.BindingDelta(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -59590,7 +59772,7 @@ object.condition = null; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; if (message.member != null && message.hasOwnProperty("member")) @@ -59855,6 +60037,12 @@ return object; var message = new $root.google.iam.v1.AuditConfigDelta(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -59897,7 +60085,7 @@ object.logType = ""; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) @@ -60567,6 +60755,12 @@ } } switch (object.combiningFunction) { + default: + if (typeof object.combiningFunction === "number") { + message.combiningFunction = object.combiningFunction; + break; + } + break; case "AND": case 0: message.combiningFunction = 0; @@ -60602,7 +60796,7 @@ object.conditions[j] = $root.google.identity.accesscontextmanager.v1.Condition.toObject(message.conditions[j], options); } if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) - object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; + object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] === undefined ? message.combiningFunction : $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; return object; }; @@ -61551,6 +61745,10 @@ for (var i = 0; i < object.allowedEncryptionStatuses.length; ++i) switch (object.allowedEncryptionStatuses[i]) { default: + if (typeof object.allowedEncryptionStatuses[i] === "number") { + message.allowedEncryptionStatuses[i] = object.allowedEncryptionStatuses[i]; + break; + } case "ENCRYPTION_UNSPECIFIED": case 0: message.allowedEncryptionStatuses[i] = 0; @@ -61586,6 +61784,10 @@ for (var i = 0; i < object.allowedDeviceManagementLevels.length; ++i) switch (object.allowedDeviceManagementLevels[i]) { default: + if (typeof object.allowedDeviceManagementLevels[i] === "number") { + message.allowedDeviceManagementLevels[i] = object.allowedDeviceManagementLevels[i]; + break; + } case "MANAGEMENT_UNSPECIFIED": case 0: message.allowedDeviceManagementLevels[i] = 0; @@ -61639,7 +61841,7 @@ if (message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length) { object.allowedEncryptionStatuses = []; for (var j = 0; j < message.allowedEncryptionStatuses.length; ++j) - object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; + object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] === undefined ? message.allowedEncryptionStatuses[j] : $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; } if (message.osConstraints && message.osConstraints.length) { object.osConstraints = []; @@ -61649,7 +61851,7 @@ if (message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length) { object.allowedDeviceManagementLevels = []; for (var j = 0; j < message.allowedDeviceManagementLevels.length; ++j) - object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; + object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] === undefined ? message.allowedDeviceManagementLevels[j] : $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; } if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) object.requireAdminApproval = message.requireAdminApproval; @@ -61883,6 +62085,12 @@ return object; var message = new $root.google.identity.accesscontextmanager.v1.OsConstraint(); switch (object.osType) { + default: + if (typeof object.osType === "number") { + message.osType = object.osType; + break; + } + break; case "OS_UNSPECIFIED": case 0: message.osType = 0; @@ -61938,7 +62146,7 @@ object.requireVerifiedChromeOs = false; } if (message.osType != null && message.hasOwnProperty("osType")) - object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; + object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] === undefined ? message.osType : $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) object.minimumVersion = message.minimumVersion; if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) @@ -62627,6 +62835,12 @@ message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } switch (object.perimeterType) { + default: + if (typeof object.perimeterType === "number") { + message.perimeterType = object.perimeterType; + break; + } + break; case "PERIMETER_TYPE_REGULAR": case 0: message.perimeterType = 0; @@ -62686,7 +62900,7 @@ if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) - object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; + object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] === undefined ? message.perimeterType : $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; if (message.status != null && message.hasOwnProperty("status")) object.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.status, options); if (message.spec != null && message.hasOwnProperty("spec")) From b214228dc3b8ce4b08980b6ef8ecd18e00cf8874 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:36:17 +0000 Subject: [PATCH 424/429] feat: add a new searchable field kmsKeys (#665) - [ ] Regenerate this pull request now. fix: deprecate searchable field kmsKey PiperOrigin-RevId: 479103182 Source-Link: https://togithub.com/googleapis/googleapis/commit/7b5a467b978ff2dde6cd34717ebad5728d05f2bb Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/417aefa0fb633d0f171a607779e9f0e19c8b8b7f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDE3YWVmYTBmYjYzM2QwZjE3MWE2MDc3NzllOWYwZTE5YzhiOGI3ZiJ9 --- .../google/cloud/asset/v1/asset_service.proto | 496 ++++++++---------- .../protos/google/cloud/asset/v1/assets.proto | 152 +++--- .../google-cloud-asset/protos/protos.d.ts | 6 + packages/google-cloud-asset/protos/protos.js | 39 ++ .../google-cloud-asset/protos/protos.json | 10 +- .../v1/asset_service.analyze_iam_policy.js | 3 +- ..._service.analyze_iam_policy_longrunning.js | 3 +- .../generated/v1/asset_service.create_feed.js | 5 +- .../v1/asset_service.create_saved_query.js | 20 +- .../v1/asset_service.delete_saved_query.js | 3 +- .../v1/asset_service.export_assets.js | 3 +- .../generated/v1/asset_service.list_assets.js | 10 +- .../v1/asset_service.list_saved_queries.js | 9 +- .../v1/asset_service.query_assets.js | 26 +- .../asset_service.search_all_iam_policies.js | 34 +- .../v1/asset_service.search_all_resources.js | 57 +- .../generated/v1/asset_service.update_feed.js | 4 +- ...nippet_metadata.google.cloud.asset.v1.json | 18 +- .../src/v1/asset_service_client.ts | 423 ++++++++------- 19 files changed, 656 insertions(+), 665 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 1c34327291d..9e13d0662d7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -41,20 +41,18 @@ option php_namespace = "Google\\Cloud\\Asset\\V1"; // Asset service definition. service AssetService { option (google.api.default_host) = "cloudasset.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"; // Exports assets with time and resource types to a given Cloud Storage // location/BigQuery table. For Cloud Storage location destinations, the // output format is newline-delimited JSON. Each line represents a - // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON - // format; for BigQuery table destinations, the output table stores the fields - // in asset Protobuf as columns. This API implements the - // [google.longrunning.Operation][google.longrunning.Operation] API, which - // allows you to keep track of the export. We recommend intervals of at least - // 2 seconds with exponential retry to poll the export operation result. For - // regular-size resource parent, the export operation usually finishes within - // 5 minutes. + // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table + // destinations, the output table stores the fields in asset Protobuf as + // columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, + // which allows you to keep track of the export. We recommend intervals of at + // least 2 seconds with exponential retry to poll the export operation result. + // For regular-size resource parent, the export operation usually finishes + // within 5 minutes. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}:exportAssets" @@ -82,8 +80,7 @@ service AssetService { // deleted status. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT // error. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) - returns (BatchGetAssetsHistoryResponse) { + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}:batchGetAssetsHistory" }; @@ -136,8 +133,7 @@ service AssetService { // folder, or organization. The caller must be granted the // `cloudasset.assets.searchAllResources` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllResources(SearchAllResourcesRequest) - returns (SearchAllResourcesResponse) { + rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllResources" }; @@ -148,8 +144,7 @@ service AssetService { // folder, or organization. The caller must be granted the // `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) - returns (SearchAllIamPoliciesResponse) { + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllIamPolicies" }; @@ -158,8 +153,7 @@ service AssetService { // Analyzes IAM policies to answer which identities have what accesses on // which resources. - rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) - returns (AnalyzeIamPolicyResponse) { + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) { option (google.api.http) = { get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" }; @@ -169,14 +163,12 @@ service AssetService { // accesses on which resources, and writes the analysis results to a Google // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the // output format is the JSON format that represents a - // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. - // This method implements the - // [google.longrunning.Operation][google.longrunning.Operation], which allows - // you to track the operation status. We recommend intervals of at least 2 - // seconds with exponential backoff retry to poll the operation result. The - // metadata contains the metadata for the long-running operation. - rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) - returns (google.longrunning.Operation) { + // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the + // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation + // status. We recommend intervals of at least 2 seconds with exponential + // backoff retry to poll the operation result. The metadata contains the + // metadata for the long-running operation. + rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning" body: "*" @@ -237,8 +229,7 @@ service AssetService { } // Lists all saved queries in a parent project/folder/organization. - rpc ListSavedQueries(ListSavedQueriesRequest) - returns (ListSavedQueriesResponse) { + rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}/savedQueries" }; @@ -255,8 +246,7 @@ service AssetService { } // Deletes a saved query. - rpc DeleteSavedQuery(DeleteSavedQueryRequest) - returns (google.protobuf.Empty) { + rpc DeleteSavedQuery(DeleteSavedQueryRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=*/*/savedQueries/*}" }; @@ -264,8 +254,7 @@ service AssetService { } // Gets effective IAM policies for a batch of resources. - rpc BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest) - returns (BatchGetEffectiveIamPoliciesResponse) { + rpc BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest) returns (BatchGetEffectiveIamPoliciesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" }; @@ -276,8 +265,7 @@ service AssetService { // AnalyzeIamPolicyLongrunning rpc. message AnalyzeIamPolicyLongrunningMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Export asset request. @@ -324,8 +312,7 @@ message ExportAssetsRequest { // returned. ContentType content_type = 4; - // Required. Output configuration indicating where the results will be output - // to. + // Required. Output configuration indicating where the results will be output to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; // A list of relationship types to export, for example: @@ -347,10 +334,8 @@ message ExportAssetsRequest { } // The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] -// method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] -// field. +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. message ExportAssetsResponse { // Time the snapshot was taken. google.protobuf.Timestamp read_time = 1; @@ -368,11 +353,11 @@ message ExportAssetsResponse { // ListAssets request. message ListAssetsRequest { - // Required. Name of the organization, folder, or project the assets belong - // to. Format: "organizations/[organization-number]" (such as - // "organizations/123"), "projects/[project-id]" (such as - // "projects/my-project-id"), "projects/[project-number]" (such as - // "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + // Required. Name of the organization, folder, or project the assets belong to. Format: + // "organizations/[organization-number]" (such as "organizations/123"), + // "projects/[project-id]" (such as "projects/my-project-id"), + // "projects/[project-number]" (such as "projects/12345"), or + // "folders/[folder-number]" (such as "folders/12345"). string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -501,8 +486,7 @@ message BatchGetAssetsHistoryRequest { // See [Introduction to Cloud Asset // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all // supported asset types and relationship types. - repeated string relationship_types = 5 - [(google.api.field_behavior) = OPTIONAL]; + repeated string relationship_types = 5 [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -524,8 +508,9 @@ message CreateFeedRequest { // be unique under a specific parent project/folder/organization. string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The feed details. The field `name` must be empty and it will be - // generated in the format of: projects/project_number/feeds/feed_id + // Required. The feed details. The field `name` must be empty and it will be generated + // in the format of: + // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; @@ -539,7 +524,9 @@ message GetFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } ]; } @@ -558,8 +545,8 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // Required. The new values of feed details. It must match an existing feed - // and the field `name` must be in the format of: + // Required. The new values of feed details. It must match an existing feed and the + // field `name` must be in the format of: // projects/project_number/feeds/feed_id or // folders/folder_number/feeds/feed_id or // organizations/organization_number/feeds/feed_id. @@ -568,8 +555,7 @@ message UpdateFeedRequest { // Required. Only updates the `feed` fields indicated by this mask. // The field mask must not be empty, and it must not contain fields that // are immutable or only set by the server. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } message DeleteFeedRequest { @@ -579,7 +565,9 @@ message DeleteFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } ]; } @@ -804,8 +792,7 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5 - [(google.api.field_behavior) = REQUIRED]; + FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; // A condition which determines whether an asset update should be published. // If specified, an asset will be returned only when the expression evaluates @@ -842,9 +829,8 @@ message Feed { // Search all resources request. message SearchAllResourcesRequest { - // Required. A scope can be a project, a folder, or an organization. The - // search is limited to the resources within the `scope`. The caller must be - // granted the + // Required. A scope can be a project, a folder, or an organization. The search is + // limited to the resources within the `scope`. The caller must be granted the // [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // @@ -877,7 +863,11 @@ message SearchAllResourcesRequest { // and its value is "prod". // * `labels.env:*` to find Cloud resources that have a label "env". // * `kmsKey:key` to find Cloud resources encrypted with a customer-managed - // encryption key whose name contains the word "key". + // encryption key whose name contains "key" as a word. This field is + // deprecated. Please use the `kmsKeys` field to retrieve KMS key + // information. + // * `kmsKeys:key` to find Cloud resources encrypted with customer-managed + // encryption keys whose name contains the word "key". // * `relationships:instance-group-1` to find Cloud resources that have // relationships with "instance-group-1" in the related resource name. // * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that @@ -906,8 +896,8 @@ message SearchAllResourcesRequest { // location. string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of asset types that this request searches for. If empty, - // it will search all the [searchable asset + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). // // Regular expressions are also supported. For example: @@ -922,22 +912,21 @@ message SearchAllResourcesRequest { // supported asset type, an INVALID_ARGUMENT error will be returned. repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped - // at 500 even if a larger value is given. If set to zero, server will pick an - // appropriate default. Returned results may be fewer than requested. When - // this happens, there could be more results as long as `next_page_token` is - // returned. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If present, then retrieve the next batch of results from the - // preceding call to this method. `page_token` must be the value of - // `next_page_token` from the previous response. The values of all other - // method parameters, must be identical to those in the previous call. + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `page_token` must be the value of `next_page_token` from + // the previous response. The values of all other method parameters, must be + // identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying the sorting order of - // the results. The default order is ascending. Add " DESC" after the field - // name to indicate descending order. Redundant space characters are ignored. + // Optional. A comma-separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " DESC" after the field name + // to indicate descending order. Redundant space characters are ignored. // Example: "location DESC, name". // Only singular primitive fields in the response are sortable: // @@ -947,22 +936,21 @@ message SearchAllResourcesRequest { // * displayName // * description // * location - // * kmsKey // * createTime // * updateTime // * state // * parentFullResourceName // * parentAssetType // - // All the other fields such as repeated fields (e.g., `networkTags`), map - // fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) - // are not supported. + // All the other fields such as repeated fields (e.g., `networkTags`, + // `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g., + // `additionalAttributes`) are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying which fields to be - // returned in ResourceSearchResult. Only '*' or combination of top level - // fields can be specified. Field names of both snake_case and camelCase are - // supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + // Optional. A comma-separated list of fields specifying which fields to be returned in + // ResourceSearchResult. Only '*' or combination of top level fields can be + // specified. Field names of both snake_case and camelCase are supported. + // Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. // // The read_mask paths must be valid field paths listed but not limited to // (both snake_case and camelCase are supported): @@ -978,7 +966,9 @@ message SearchAllResourcesRequest { // * tagValueIds // * labels // * networkTags - // * kmsKey + // * kmsKey (This field is deprecated. Please use the `kmsKeys` field to + // retrieve KMS key information.) + // * kmsKeys // * createTime // * updateTime // * state @@ -990,8 +980,7 @@ message SearchAllResourcesRequest { // If only '*' is specified, all fields including versionedResources will be // returned. // Any invalid field path will trigger INVALID_ARGUMENT error. - google.protobuf.FieldMask read_mask = 8 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask read_mask = 8 [(google.api.field_behavior) = OPTIONAL]; } // Search all resources response. @@ -1008,9 +997,9 @@ message SearchAllResourcesResponse { // Search all IAM policies request. message SearchAllIamPoliciesRequest { - // Required. A scope can be a project, a folder, or an organization. The - // search is limited to the IAM policies within the `scope`. The caller must - // be granted the + // Required. A scope can be a project, a folder, or an organization. The search is + // limited to the IAM policies within the `scope`. The caller must be granted + // the // [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // @@ -1066,22 +1055,20 @@ message SearchAllIamPoliciesRequest { // principal type "user". string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped - // at 500 even if a larger value is given. If set to zero, server will pick an - // appropriate default. Returned results may be fewer than requested. When - // this happens, there could be more results as long as `next_page_token` is - // returned. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If present, retrieve the next batch of results from the preceding - // call to this method. `page_token` must be the value of `next_page_token` - // from the previous response. The values of all other method parameters must - // be identical to those in the previous call. + // Optional. If present, retrieve the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of all other method parameters must be + // identical to those in the previous call. string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of asset types that the IAM policies are attached to. If - // empty, it will search the IAM policies that are attached to all the - // [searchable asset + // Optional. A list of asset types that the IAM policies are attached to. If empty, it + // will search the IAM policies that are attached to all the [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). // // Regular expressions are also supported. For example: @@ -1098,9 +1085,9 @@ message SearchAllIamPoliciesRequest { // supported asset type, an INVALID_ARGUMENT error will be returned. repeated string asset_types = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying the sorting order of - // the results. The default order is ascending. Add " DESC" after the field - // name to indicate descending order. Redundant space characters are ignored. + // Optional. A comma-separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " DESC" after the field name + // to indicate descending order. Redundant space characters are ignored. // Example: "assetType DESC, resource". // Only singular primitive fields in the response are sortable: // * resource @@ -1173,10 +1160,9 @@ message IamPolicyAnalysisQuery { // Optional. If true, the identities section of the result will expand any // Google groups appearing in an IAM policy binding. // - // If - // [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] - // is specified, the identity in the result will be determined by the - // selector, and this flag is not allowed to set. + // If [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] is specified, the + // identity in the result will be determined by the selector, and this flag + // is not allowed to set. // // If true, the default max expansion per group is 1000 for // AssetService.AnalyzeIamPolicy][]. @@ -1187,31 +1173,28 @@ message IamPolicyAnalysisQuery { // Optional. If true, the access section of result will expand any roles // appearing in IAM policy bindings to include their permissions. // - // If - // [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] - // is specified, the access section of the result will be determined by the - // selector, and this flag is not allowed to set. + // If [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] is specified, the access + // section of the result will be determined by the selector, and this flag + // is not allowed to set. // // Default is false. bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true and - // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] - // is not specified, the resource section of the result will expand any - // resource attached to an IAM policy to include resources lower in the - // resource hierarchy. + // Optional. If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is not + // specified, the resource section of the result will expand any resource + // attached to an IAM policy to include resources lower in the resource + // hierarchy. // // For example, if the request analyzes for which resources user A has // permission P, and the results include an IAM policy with P on a GCP // folder, the results will also include resources in that folder with // permission P. // - // If true and - // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] - // is specified, the resource section of the result will expand the - // specified resource to include resources lower in the resource hierarchy. - // Only project or lower resources are supported. Folder and organization - // resource cannot be used together with this option. + // If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is specified, + // the resource section of the result will expand the specified resource to + // include resources lower in the resource hierarchy. Only project or + // lower resources are supported. Folder and organization resource cannot be + // used together with this option. // // For example, if the request analyzes for which users have permission P on // a GCP project with this option enabled, the results will include all @@ -1224,21 +1207,21 @@ message IamPolicyAnalysisQuery { // Default is false. bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the result will output the relevant parent/child - // relationships between resources. Default is false. + // Optional. If true, the result will output the relevant parent/child relationships + // between resources. + // Default is false. bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the result will output the relevant membership - // relationships between groups and other groups, and between groups and - // principals. Default is false. + // Optional. If true, the result will output the relevant membership relationships + // between groups and other groups, and between groups and principals. + // Default is false. bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the response will include access analysis from - // identities to resources via service account impersonation. This is a very - // expensive operation, because many derived queries will be executed. We - // highly recommend you use - // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] - // rpc instead. + // Optional. If true, the response will include access analysis from identities to + // resources via service account impersonation. This is a very expensive + // operation, because many derived queries will be executed. We highly + // recommend you use [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc + // instead. // // For example, if the request analyzes for which resources user A has // permission P, and there's an IAM policy states user A has @@ -1266,8 +1249,7 @@ message IamPolicyAnalysisQuery { // * `iam.serviceAccounts.implicitDelegation` // // Default is false. - bool analyze_service_account_impersonation = 6 - [(google.api.field_behavior) = OPTIONAL]; + bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; } // The IAM conditions context. @@ -1281,8 +1263,8 @@ message IamPolicyAnalysisQuery { } } - // Required. The relative name of the root asset. Only resources and IAM - // policies within the scope will be analyzed. + // Required. The relative name of the root asset. Only resources and IAM policies within + // the scope will be analyzed. // // This can only be an organization number (such as "organizations/123"), a // folder number (such as "folders/123"), a project ID (such as @@ -1296,12 +1278,10 @@ message IamPolicyAnalysisQuery { string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Specifies a resource for analysis. - ResourceSelector resource_selector = 2 - [(google.api.field_behavior) = OPTIONAL]; + ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Specifies an identity for analysis. - IdentitySelector identity_selector = 3 - [(google.api.field_behavior) = OPTIONAL]; + IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Specifies roles or permissions for analysis. This is optional. AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -1310,16 +1290,13 @@ message IamPolicyAnalysisQuery { Options options = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. The hypothetical context for IAM conditions evaluation. - ConditionContext condition_context = 6 - [(google.api.field_behavior) = OPTIONAL]; + ConditionContext condition_context = 6 [(google.api.field_behavior) = OPTIONAL]; } -// A request message for -// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +// A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. message AnalyzeIamPolicyRequest { // Required. The request query. - IamPolicyAnalysisQuery analysis_query = 1 - [(google.api.field_behavior) = REQUIRED]; + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The name of a saved query, which must be in the format of: // @@ -1339,8 +1316,7 @@ message AnalyzeIamPolicyRequest { // presence yet. string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Amount of time executable has to complete. See JSON - // representation of + // Optional. Amount of time executable has to complete. See JSON representation of // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). // // If this field is set with a value less than the RPC deadline, and the @@ -1350,26 +1326,22 @@ message AnalyzeIamPolicyRequest { // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. // // Default is empty. - google.protobuf.Duration execution_timeout = 2 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Duration execution_timeout = 2 [(google.api.field_behavior) = OPTIONAL]; } -// A response message for -// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +// A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. message AnalyzeIamPolicyResponse { // An analysis message to group the query and results. message IamPolicyAnalysis { // The analysis query. IamPolicyAnalysisQuery analysis_query = 1; - // A list of - // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] - // that matches the analysis query, or empty if no result is found. + // A list of [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] that matches the analysis query, or + // empty if no result is found. repeated IamPolicyAnalysisResult analysis_results = 2; - // Represents whether all entries in the - // [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] - // have been fully explored to answer the query. + // Represents whether all entries in the [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been + // fully explored to answer the query. bool fully_explored = 3; // A list of non-critical errors happened during the query handling. @@ -1384,11 +1356,9 @@ message AnalyzeIamPolicyResponse { // enabled. repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; - // Represents whether all entries in the - // [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] - // and - // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] - // have been fully explored to answer the query in the request. + // Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and + // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to + // answer the query in the request. bool fully_explored = 3; } @@ -1396,8 +1366,8 @@ message AnalyzeIamPolicyResponse { message IamPolicyAnalysisOutputConfig { // A Cloud Storage location. message GcsDestination { - // Required. The uri of the Cloud Storage object. It's the same uri that is - // used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Required. The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and // Editing Object // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. @@ -1425,15 +1395,13 @@ message IamPolicyAnalysisOutputConfig { REQUEST_TIME = 1; } - // Required. The BigQuery dataset in format - // "projects/projectId/datasets/datasetId", to which the analysis results - // should be exported. If this dataset does not exist, the export call will - // return an INVALID_ARGUMENT error. + // Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", + // to which the analysis results should be exported. If this dataset does + // not exist, the export call will return an INVALID_ARGUMENT error. string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The prefix of the BigQuery tables to which the analysis results - // will be written. Tables will be created based on this table_prefix if not - // exist: + // Required. The prefix of the BigQuery tables to which the analysis results will be + // written. Tables will be created based on this table_prefix if not exist: // * _analysis table will contain export operation's metadata. // * _analysis_result will contain all the // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. @@ -1444,8 +1412,8 @@ message IamPolicyAnalysisOutputConfig { // The partition key for BigQuery partitioned table. PartitionKey partition_key = 3; - // Optional. Specifies the action that occurs if the destination table or - // partition already exists. The following values are supported: + // Optional. Specifies the action that occurs if the destination table or partition + // already exists. The following values are supported: // // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery // overwrites the entire table or all the partitions data. @@ -1470,12 +1438,10 @@ message IamPolicyAnalysisOutputConfig { } } -// A request message for -// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +// A request message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. message AnalyzeIamPolicyLongrunningRequest { // Required. The request query. - IamPolicyAnalysisQuery analysis_query = 1 - [(google.api.field_behavior) = REQUIRED]; + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The name of a saved query, which must be in the format of: // @@ -1495,15 +1461,14 @@ message AnalyzeIamPolicyLongrunningRequest { // presence yet. string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; - // Required. Output configuration indicating where the results will be output - // to. - IamPolicyAnalysisOutputConfig output_config = 2 - [(google.api.field_behavior) = REQUIRED]; + // Required. Output configuration indicating where the results will be output to. + IamPolicyAnalysisOutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; } -// A response message for -// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. -message AnalyzeIamPolicyLongrunningResponse {} +// A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningResponse { + +} // A saved query which can be shared with others or used later. message SavedQuery { @@ -1518,11 +1483,8 @@ message SavedQuery { message QueryContent { oneof query_content { // An IAM Policy Analysis query, which could be used in - // the - // [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] - // rpc or the - // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] - // rpc. + // the [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] rpc or + // the [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc. IamPolicyAnalysisQuery iam_policy_analysis_query = 1; } } @@ -1539,18 +1501,15 @@ message SavedQuery { string description = 2; // Output only. The create time of this saved query. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The account's email address who has created this saved query. string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update time of this saved query. - google.protobuf.Timestamp last_update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp last_update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The account's email address who has updated this saved query - // most recently. + // Output only. The account's email address who has updated this saved query most recently. string last_updater = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Labels applied on the resource. @@ -1564,11 +1523,11 @@ message SavedQuery { // Request to create a saved query. message CreateSavedQueryRequest { - // Required. The name of the project/folder/organization where this - // saved_query should be created in. It can only be an organization number - // (such as "organizations/123"), a folder number (such as "folders/123"), a - // project ID (such as "projects/my-project-id")", or a project number (such - // as "projects/12345"). + // Required. The name of the project/folder/organization where this saved_query + // should be created in. It can only be an organization number (such as + // "organizations/123"), a folder number (such as "folders/123"), a project ID + // (such as "projects/my-project-id")", or a project number (such as + // "projects/12345"). string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1576,13 +1535,13 @@ message CreateSavedQueryRequest { } ]; - // Required. The saved_query details. The `name` field must be empty as it - // will be generated based on the parent and saved_query_id. + // Required. The saved_query details. The `name` field must be empty as it will be + // generated based on the parent and saved_query_id. SavedQuery saved_query = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The ID to use for the saved query, which must be unique in the - // specified parent. It will become the final component of the saved query's - // resource name. + // Required. The ID to use for the saved query, which must be unique in the specified + // parent. It will become the final component of the saved query's resource + // name. // // This value should be 4-63 characters, and valid characters // are /[a-z][0-9]-/. @@ -1609,8 +1568,8 @@ message GetSavedQueryRequest { // Request to list saved queries. message ListSavedQueriesRequest { - // Required. The parent project/folder/organization whose savedQueries are to - // be listed. It can only be using project/folder/organization number (such as + // Required. The parent project/folder/organization whose savedQueries are to be + // listed. It can only be using project/folder/organization number (such as // "folders/12345")", or a project ID (such as "projects/my-project-id"). string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1628,9 +1587,8 @@ message ListSavedQueriesRequest { // See https://google.aip.dev/160 for more information on the grammar. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of saved queries to return per page. The - // service may return fewer than this value. If unspecified, at most 50 will - // be returned. + // Optional. The maximum number of saved queries to return per page. The service may + // return fewer than this value. If unspecified, at most 50 will be returned. // The maximum value is 1000; values above 1000 will be coerced to 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -1665,14 +1623,12 @@ message UpdateSavedQueryRequest { SavedQuery saved_query = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } // Request to delete a saved query. message DeleteSavedQueryRequest { - // Required. The name of the saved query to delete. It must be in the format - // of: + // Required. The name of the saved query to delete. It must be in the format of: // // * projects/project_number/savedQueries/saved_query_id // * folders/folder_number/savedQueries/saved_query_id @@ -1764,13 +1720,12 @@ message MoveImpact { message QueryAssetsOutputConfig { // BigQuery destination. message BigQueryDestination { - // Required. The BigQuery dataset where the query results will be saved. It - // has the format of "projects/{projectId}/datasets/{datasetId}". + // Required. The BigQuery dataset where the query results will be saved. It has the + // format of "projects/{projectId}/datasets/{datasetId}". string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The BigQuery table where the query results will be saved. If - // this table does not exist, a new table with the given name will be - // created. + // Required. The BigQuery table where the query results will be saved. If this table + // does not exist, a new table with the given name will be created. string table = 2 [(google.api.field_behavior) = REQUIRED]; // Specifies the action that occurs if the destination table or partition @@ -1780,8 +1735,10 @@ message QueryAssetsOutputConfig { // overwrites the entire table or all the partitions data. // * WRITE_APPEND: If the table or partition already exists, BigQuery // appends the data to the table or the latest partition. - // * WRITE_EMPTY: If the table already exists and contains data, an error is - // returned. + // * WRITE_EMPTY: If the table already exists and contains data, a + // 'duplicate' error is returned in the job result. + // + // The default value is WRITE_EMPTY. string write_disposition = 3; } @@ -1809,13 +1766,13 @@ message QueryAssetsRequest { // SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). string statement = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Reference to the query job, which is from the - // `QueryAssetsResponse` of previous `QueryAssets` call. + // Optional. Reference to the query job, which is from the `QueryAssetsResponse` of + // previous `QueryAssets` call. string job_reference = 3 [(google.api.field_behavior) = OPTIONAL]; } - // Optional. The maximum number of rows to return in the results. Responses - // are limited to 10 MB and 1000 rows. + // Optional. The maximum number of rows to return in the results. Responses are limited + // to 10 MB and 1000 rows. // // By default, the maximum row count is 1000. When the byte or row count limit // is reached, the rest of the query results will be paginated. @@ -1828,11 +1785,10 @@ message QueryAssetsRequest { // The field will be ignored when [output_config] is specified. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Specifies the maximum amount of time that the client is willing - // to wait for the query to complete. By default, this limit is 5 min for the - // first query, and 1 minute for the following queries. If the query is - // complete, the `done` field in the `QueryAssetsResponse` is true, otherwise - // false. + // Optional. Specifies the maximum amount of time that the client is willing to wait + // for the query to complete. By default, this limit is 5 min for the first + // query, and 1 minute for the following queries. If the query is complete, + // the `done` field in the `QueryAssetsResponse` is true, otherwise false. // // Like BigQuery [jobs.query // API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) @@ -1851,15 +1807,13 @@ message QueryAssetsRequest { // If data for the timestamp/date range selected does not exist, // it will simply return a valid response with no rows. oneof time { - // Optional. [start_time] is required. [start_time] must be less than - // [end_time] Defaults [end_time] to now if [start_time] is set and - // [end_time] isn't. Maximum permitted time range is 7 days. + // Optional. [start_time] is required. [start_time] must be less than [end_time] + // Defaults [end_time] to now if [start_time] is set and [end_time] isn't. + // Maximum permitted time range is 7 days. TimeWindow read_time_window = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Queries cloud assets as they appeared at the specified point in - // time. - google.protobuf.Timestamp read_time = 8 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Queries cloud assets as they appeared at the specified point in time. + google.protobuf.Timestamp read_time = 8 [(google.api.field_behavior) = OPTIONAL]; } // Optional. Destination where the query results will be saved. @@ -1871,8 +1825,7 @@ message QueryAssetsRequest { // Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used // to check the status of the query job when passed to a following // [QueryAssets] API call. - QueryAssetsOutputConfig output_config = 9 - [(google.api.field_behavior) = OPTIONAL]; + QueryAssetsOutputConfig output_config = 9 [(google.api.field_behavior) = OPTIONAL]; } // QueryAssets response. @@ -1959,8 +1912,7 @@ message TableFieldSchema { repeated TableFieldSchema fields = 4; } -// A request message for -// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +// A request message for [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. message BatchGetEffectiveIamPoliciesRequest { // Required. Only IAM policies on or below the scope will be returned. // @@ -1975,7 +1927,9 @@ message BatchGetEffectiveIamPoliciesRequest { // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). string scope = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "*" } + (google.api.resource_reference) = { + child_type: "*" + } ]; // Required. The names refer to the [full_resource_names] @@ -1985,65 +1939,53 @@ message BatchGetEffectiveIamPoliciesRequest { // A maximum of 20 resources' effective policies can be retrieved in a batch. repeated string names = 3 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "*" } + (google.api.resource_reference) = { + type: "*" + } ]; } -// A response message for -// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +// A response message for [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. message BatchGetEffectiveIamPoliciesResponse { // The effective IAM policies on one resource. message EffectiveIamPolicy { // The IAM policy and its attached resource. message PolicyInfo { - // The full resource name the - // [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] - // is directly attached to. + // The full resource name the [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] is directly attached to. string attached_resource = 1; - // The IAM policy that's directly attached to the - // [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + // The IAM policy that's directly attached to the [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. google.iam.v1.Policy policy = 2; } // The [full_resource_name] // (https://cloud.google.com/asset-inventory/docs/resource-name-format) - // for which the - // [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] - // are computed. This is one of the - // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] - // the caller provides in the request. + // for which the [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] are computed. This is one of the + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] the caller provides in the + // request. string full_resource_name = 1; - // The effective policies for the - // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // The effective policies for the [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. // - // These policies include the policy set on the - // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] - // and those set on its parents and ancestors up to the - // [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. - // Note that these policies are not filtered according to the resource type - // of the + // These policies include the policy set on the [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] and + // those set on its parents and ancestors up to the + // [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. Note that these policies + // are not filtered according to the resource type of the // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. // // These policies are hierarchically ordered by - // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] - // starting from - // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] starting from [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] // itself to its parents and ancestors, such that policies[i]'s - // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] - // is the child of policies[i+1]'s - // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], - // if policies[i+1] exists. + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] is the child of policies[i+1]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], if policies[i+1] exists. repeated PolicyInfo policies = 2; } // The effective policies for a batch of resources. Note that the results // order is the same as the order of - // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. - // When a resource does not have any effective IAM policies, its corresponding - // policy_result will contain empty - // [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. When a resource does not + // have any effective IAM policies, its corresponding policy_result will + // contain empty [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. repeated EffectiveIamPolicy policy_results = 2; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 83a23693ae8..8f22b5031f4 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.asset.v1; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/cloud/osconfig/v1/inventory.proto"; @@ -150,8 +151,7 @@ message Asset { // Please also refer to the [service perimeter user // guide](https://cloud.google.com/vpc-service-controls/docs/overview). - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = - 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } // A representation of runtime OS Inventory information. See [this @@ -282,8 +282,8 @@ message RelatedAsset { // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. string asset = 1 [(google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Asset" - }]; + type: "cloudasset.googleapis.com/Asset" + }]; // The type of the asset. Example: `compute.googleapis.com/Disk` // @@ -306,7 +306,7 @@ message RelatedAsset { } // A result of Resource Search, containing information of a cloud resource. -// Next ID: 29 +// Next ID: 31 message ResourceSearchResult { // The full resource name of this resource. Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. @@ -316,15 +316,15 @@ message ResourceSearchResult { // // To search against the `name`: // - // * use a field query. Example: `name:instance1` - // * use a free text query. Example: `instance1` + // * Use a field query. Example: `name:instance1` + // * Use a free text query. Example: `instance1` string name = 1; // The type of this resource. Example: `compute.googleapis.com/Disk`. // // To search against the `asset_type`: // - // * specify the `asset_type` field in your search request. + // * Specify the `asset_type` field in your search request. string asset_type = 2; // The project that this resource belongs to, in the form of @@ -333,9 +333,9 @@ message ResourceSearchResult { // // To search against `project`: // - // * use a field query. Example: `project:12345` - // * use a free text query. Example: `12345` - // * specify the `scope` field as this project in your search request. + // * Use a field query. Example: `project:12345` + // * Use a free text query. Example: `12345` + // * Specify the `scope` field as this project in your search request. string project = 3; // The folder(s) that this resource belongs to, in the form of @@ -344,9 +344,9 @@ message ResourceSearchResult { // // To search against `folders`: // - // * use a field query. Example: `folders:(123 OR 456)` - // * use a free text query. Example: `123` - // * specify the `scope` field as this folder in your search request. + // * Use a field query. Example: `folders:(123 OR 456)` + // * Use a free text query. Example: `123` + // * Specify the `scope` field as this folder in your search request. repeated string folders = 17; // The organization that this resource belongs to, in the form of @@ -355,9 +355,9 @@ message ResourceSearchResult { // // To search against `organization`: // - // * use a field query. Example: `organization:123` - // * use a free text query. Example: `123` - // * specify the `scope` field as this organization in your search request. + // * Use a field query. Example: `organization:123` + // * Use a free text query. Example: `123` + // * Specify the `scope` field as this organization in your search request. string organization = 18; // The display name of this resource. This field is available only when the @@ -365,8 +365,8 @@ message ResourceSearchResult { // // To search against the `display_name`: // - // * use a field query. Example: `displayName:"My Instance"` - // * use a free text query. Example: `"My Instance"` + // * Use a field query. Example: `displayName:"My Instance"` + // * Use a free text query. Example: `"My Instance"` string display_name = 4; // One or more paragraphs of text description of this resource. Maximum length @@ -375,8 +375,8 @@ message ResourceSearchResult { // // To search against the `description`: // - // * use a field query. Example: `description:"important instance"` - // * use a free text query. Example: `"important instance"` + // * Use a field query. Example: `description:"important instance"` + // * Use a free text query. Example: `"important instance"` string description = 5; // Location can be `global`, regional like `us-east1`, or zonal like @@ -385,8 +385,8 @@ message ResourceSearchResult { // // To search against the `location`: // - // * use a field query. Example: `location:us-west*` - // * use a free text query. Example: `us-west*` + // * Use a field query. Example: `location:us-west*` + // * Use a free text query. Example: `us-west*` string location = 6; // Labels associated with this resource. See [Labelling and grouping GCP @@ -396,11 +396,11 @@ message ResourceSearchResult { // // To search against the `labels`: // - // * use a field query: + // * Use a field query: // - query on any label's key or value. Example: `labels:prod` // - query by a given label. Example: `labels.env:prod` // - query by a given label's existence. Example: `labels.env:*` - // * use a free text query. Example: `prod` + // * Use a free text query. Example: `prod` map labels = 7; // Network tags associated with this resource. Like labels, network tags are a @@ -411,22 +411,41 @@ message ResourceSearchResult { // // To search against the `network_tags`: // - // * use a field query. Example: `networkTags:internal` - // * use a free text query. Example: `internal` + // * Use a field query. Example: `networkTags:internal` + // * Use a free text query. Example: `internal` repeated string network_tags = 8; // The Cloud KMS // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) // name or // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) - // name. This field is available only when the resource's Protobuf contains - // it. + // name. + // + // This field only presents for the purpose of backward compatibility. Please + // use the `kms_keys` field to retrieve KMS key information. This field is + // available only when the resource's Protobuf contains it and will only be + // populated for [these resource + // types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) + // for backward compatible purposes. // // To search against the `kms_key`: // - // * use a field query. Example: `kmsKey:key` - // * use a free text query. Example: `key` - string kms_key = 10; + // * Use a field query. Example: `kmsKey:key` + // * Use a free text query. Example: `key` + string kms_key = 10 [deprecated = true]; + + // The Cloud KMS + // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + // names or + // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + // names. This field is available only when the resource's Protobuf contains + // it. + // + // To search against the `kms_keys`: + // + // * Use a field query. Example: `kmsKeys:key` + // * Use a free text query. Example: `key` + repeated string kms_keys = 28; // The create timestamp of this resource, at which the resource was created. // The granularity is in seconds. Timestamp.nanos will always be 0. This field @@ -434,7 +453,7 @@ message ResourceSearchResult { // // To search against `create_time`: // - // * use a field query. + // * Use a field query. // - value in seconds since unix epoch. Example: `createTime > 1609459200` // - value in date string. Example: `createTime > 2021-01-01` // - value in date-time string (must be quoted). Example: `createTime > @@ -448,7 +467,7 @@ message ResourceSearchResult { // // To search against `update_time`: // - // * use a field query. + // * Use a field query. // - value in seconds since unix epoch. Example: `updateTime < 1609459200` // - value in date string. Example: `updateTime < 2021-01-01` // - value in date-time string (must be quoted). Example: `updateTime < @@ -473,8 +492,8 @@ message ResourceSearchResult { // // To search against the `state`: // - // * use a field query. Example: `state:RUNNING` - // * use a free text query. Example: `RUNNING` + // * Use a field query. Example: `state:RUNNING` + // * Use a free text query. Example: `RUNNING` string state = 13; // The additional searchable attributes of this resource. The attributes may @@ -493,7 +512,7 @@ message ResourceSearchResult { // // To search against the `additional_attributes`: // - // * use a free text query to match the attributes values. Example: to search + // * Use a free text query to match the attributes values. Example: to search // `additional_attributes = { dnsName: "foobar" }`, you can issue a query // `foobar`. google.protobuf.Struct additional_attributes = 9; @@ -501,9 +520,9 @@ message ResourceSearchResult { // The full resource name of this resource's parent, if it has one. // To search against the `parent_full_resource_name`: // - // * use a field query. Example: + // * Use a field query. Example: // `parentFullResourceName:"project-name"` - // * use a free text query. Example: + // * Use a free text query. Example: // `project-name` string parent_full_resource_name = 19; @@ -536,12 +555,12 @@ message ResourceSearchResult { // TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. // To search against the `tagKeys`: // - // * use a field query. Example: + // * Use a field query. Example: // - `tagKeys:"123456789/env*"` // - `tagKeys="123456789/env"` // - `tagKeys:"env"` // - // * use a free text query. Example: + // * Use a free text query. Example: // - `env` repeated string tag_keys = 23; @@ -549,24 +568,24 @@ message ResourceSearchResult { // {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. // To search against the `tagValues`: // - // * use a field query. Example: + // * Use a field query. Example: // - `tagValues:"env"` // - `tagValues:"env/prod"` // - `tagValues:"123456789/env/prod*"` // - `tagValues="123456789/env/prod"` // - // * use a free text query. Example: + // * Use a free text query. Example: // - `prod` repeated string tag_values = 25; // TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. // To search against the `tagValueIds`: // - // * use a field query. Example: + // * Use a field query. Example: // - `tagValueIds:"456"` // - `tagValueIds="tagValues/456"` // - // * use a free text query. Example: + // * Use a free text query. Example: // - `456` repeated string tag_value_ids = 26; @@ -574,9 +593,9 @@ message ResourceSearchResult { // // To search against the `parent_asset_type`: // - // * use a field query. Example: + // * Use a field query. Example: // `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` - // * use a free text query. Example: + // * Use a free text query. Example: // `cloudresourcemanager.googleapis.com/Project` string parent_asset_type = 103; } @@ -857,10 +876,8 @@ message IamPolicyAnalysisResult { repeated Access accesses = 2; // Resource edges of the graph starting from the policy attached - // resource to any descendant resources. The - // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] - // contains the full resource name of a parent resource and - // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // resource to any descendant resources. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] contains + // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] // contains the full resource name of a child resource. This field is // present only if the output_resource_edges option is enabled in request. repeated Edge resource_edges = 3; @@ -879,41 +896,32 @@ message IamPolicyAnalysisResult { repeated Identity identities = 1; // Group identity edges of the graph starting from the binding's - // group members to any node of the - // [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. - // The - // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // group members to any node of the [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] // contains a group, such as `group:parent@google.com`. The - // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] - // contains a member of the group, such as `group:child@google.com` or - // `user:foo@google.com`. This field is present only if the - // output_group_edges option is enabled in request. + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] contains a member of the group, + // such as `group:child@google.com` or `user:foo@google.com`. + // This field is present only if the output_group_edges option is enabled in + // request. repeated Edge group_edges = 2; } // The [full resource // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) - // of the resource to which the - // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] - // policy attaches. + // of the resource to which the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] policy attaches. string attached_resource_full_name = 1; // The Cloud IAM policy binding under analysis. google.iam.v1.Binding iam_binding = 2; - // The access control lists derived from the - // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] - // that match or potentially match resource and access selectors specified in - // the request. + // The access control lists derived from the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match resource and access selectors specified in the request. repeated AccessControlList access_control_lists = 3; - // The identity list derived from members of the - // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] - // that match or potentially match identity selector specified in the request. + // The identity list derived from members of the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match identity selector specified in the request. IdentityList identity_list = 4; - // Represents whether all analyses on the - // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] - // have successfully finished. + // Represents whether all analyses on the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] have successfully + // finished. bool fully_explored = 5; } diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index fe1eef20206..027b447e80c 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -8354,6 +8354,9 @@ export namespace google { /** ResourceSearchResult kmsKey */ kmsKey?: (string|null); + /** ResourceSearchResult kmsKeys */ + kmsKeys?: (string[]|null); + /** ResourceSearchResult createTime */ createTime?: (google.protobuf.ITimestamp|null); @@ -8433,6 +8436,9 @@ export namespace google { /** ResourceSearchResult kmsKey. */ public kmsKey: string; + /** ResourceSearchResult kmsKeys. */ + public kmsKeys: string[]; + /** ResourceSearchResult createTime. */ public createTime?: (google.protobuf.ITimestamp|null); diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index a5368ae635c..ad66b767fd7 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -20242,6 +20242,7 @@ * @property {Object.|null} [labels] ResourceSearchResult labels * @property {Array.|null} [networkTags] ResourceSearchResult networkTags * @property {string|null} [kmsKey] ResourceSearchResult kmsKey + * @property {Array.|null} [kmsKeys] ResourceSearchResult kmsKeys * @property {google.protobuf.ITimestamp|null} [createTime] ResourceSearchResult createTime * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceSearchResult updateTime * @property {string|null} [state] ResourceSearchResult state @@ -20268,6 +20269,7 @@ this.folders = []; this.labels = {}; this.networkTags = []; + this.kmsKeys = []; this.versionedResources = []; this.attachedResources = []; this.relationships = {}; @@ -20368,6 +20370,14 @@ */ ResourceSearchResult.prototype.kmsKey = ""; + /** + * ResourceSearchResult kmsKeys. + * @member {Array.} kmsKeys + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.kmsKeys = $util.emptyArray; + /** * ResourceSearchResult createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime @@ -20543,6 +20553,9 @@ if (message.tagValueIds != null && message.tagValueIds.length) for (var i = 0; i < message.tagValueIds.length; ++i) writer.uint32(/* id 26, wireType 2 =*/210).string(message.tagValueIds[i]); + if (message.kmsKeys != null && message.kmsKeys.length) + for (var i = 0; i < message.kmsKeys.length; ++i) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.kmsKeys[i]); if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); return writer; @@ -20646,6 +20659,12 @@ message.kmsKey = reader.string(); break; } + case 28: { + if (!(message.kmsKeys && message.kmsKeys.length)) + message.kmsKeys = []; + message.kmsKeys.push(reader.string()); + break; + } case 11: { message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; @@ -20804,6 +20823,13 @@ if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) if (!$util.isString(message.kmsKey)) return "kmsKey: string expected"; + if (message.kmsKeys != null && message.hasOwnProperty("kmsKeys")) { + if (!Array.isArray(message.kmsKeys)) + return "kmsKeys: array expected"; + for (var i = 0; i < message.kmsKeys.length; ++i) + if (!$util.isString(message.kmsKeys[i])) + return "kmsKeys: string[] expected"; + } if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) @@ -20929,6 +20955,13 @@ } if (object.kmsKey != null) message.kmsKey = String(object.kmsKey); + if (object.kmsKeys) { + if (!Array.isArray(object.kmsKeys)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.kmsKeys: array expected"); + message.kmsKeys = []; + for (var i = 0; i < object.kmsKeys.length; ++i) + message.kmsKeys[i] = String(object.kmsKeys[i]); + } if (object.createTime != null) { if (typeof object.createTime !== "object") throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.createTime: object expected"); @@ -21025,6 +21058,7 @@ object.tagKeys = []; object.tagValues = []; object.tagValueIds = []; + object.kmsKeys = []; } if (options.objects || options.defaults) { object.labels = {}; @@ -21118,6 +21152,11 @@ for (var j = 0; j < message.tagValueIds.length; ++j) object.tagValueIds[j] = message.tagValueIds[j]; } + if (message.kmsKeys && message.kmsKeys.length) { + object.kmsKeys = []; + for (var j = 0; j < message.kmsKeys.length; ++j) + object.kmsKeys[j] = message.kmsKeys[j]; + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) object.parentAssetType = message.parentAssetType; return object; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index dc5f02d8f90..863edfe71c7 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -2064,7 +2064,15 @@ }, "kmsKey": { "type": "string", - "id": 10 + "id": 10, + "options": { + "deprecated": true + } + }, + "kmsKeys": { + "rule": "repeated", + "type": "string", + "id": 28 }, "createTime": { "type": "google.protobuf.Timestamp", diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index fb13179b665..1d2aad7b255 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -49,8 +49,7 @@ function main(analysisQuery) { */ // const savedAnalysisQuery = 'abc123' /** - * Optional. Amount of time executable has to complete. See JSON - * representation of + * Optional. Amount of time executable has to complete. See JSON representation of * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json). * If this field is set with a value less than the RPC deadline, and the * execution of your query hasn't finished in the specified diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index 703f46b47a7..08d1db5c8c4 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -49,8 +49,7 @@ function main(analysisQuery, outputConfig) { */ // const savedAnalysisQuery = 'abc123' /** - * Required. Output configuration indicating where the results will be output - * to. + * Required. Output configuration indicating where the results will be output to. */ // const outputConfig = {} diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index deeabb513b5..1dcc6d715cb 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -42,8 +42,9 @@ function main(parent, feedId, feed) { */ // const feedId = 'abc123' /** - * Required. The feed details. The field `name` must be empty and it will be - * generated in the format of: projects/project_number/feeds/feed_id + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id */ diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js index 8870f9608ec..dec851edabe 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js @@ -29,22 +29,22 @@ function main(parent, savedQuery, savedQueryId) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project/folder/organization where this - * saved_query should be created in. It can only be an organization number - * (such as "organizations/123"), a folder number (such as "folders/123"), a - * project ID (such as "projects/my-project-id")", or a project number (such - * as "projects/12345"). + * Required. The name of the project/folder/organization where this saved_query + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). */ // const parent = 'abc123' /** - * Required. The saved_query details. The `name` field must be empty as it - * will be generated based on the parent and saved_query_id. + * Required. The saved_query details. The `name` field must be empty as it will be + * generated based on the parent and saved_query_id. */ // const savedQuery = {} /** - * Required. The ID to use for the saved query, which must be unique in the - * specified parent. It will become the final component of the saved query's - * resource name. + * Required. The ID to use for the saved query, which must be unique in the specified + * parent. It will become the final component of the saved query's resource + * name. * This value should be 4-63 characters, and valid characters * are /[a-z][0-9]-/. * Notice that this field is required in the saved query creation, and the diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js index 7ec550b0bd6..11731ab0ad6 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js @@ -29,8 +29,7 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the saved query to delete. It must be in the format - * of: + * Required. The name of the saved query to delete. It must be in the format of: * * projects/project_number/savedQueries/saved_query_id * * folders/folder_number/savedQueries/saved_query_id * * organizations/organization_number/savedQueries/saved_query_id diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index 59b7182a88b..4114d491766 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -66,8 +66,7 @@ function main(parent, outputConfig) { */ // const contentType = {} /** - * Required. Output configuration indicating where the results will be output - * to. + * Required. Output configuration indicating where the results will be output to. */ // const outputConfig = {} /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index 29b82e4a3cd..1f62227b1fe 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -29,11 +29,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization, folder, or project the assets belong - * to. Format: "organizations/[organization-number]" (such as - * "organizations/123"), "projects/[project-id]" (such as - * "projects/my-project-id"), "projects/[project-number]" (such as - * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * Required. Name of the organization, folder, or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), + * "projects/[project-number]" (such as "projects/12345"), or + * "folders/[folder-number]" (such as "folders/12345"). */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js index e1f9a66db53..91341dc6586 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent project/folder/organization whose savedQueries are to - * be listed. It can only be using project/folder/organization number (such as + * Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). */ // const parent = 'abc123' @@ -44,9 +44,8 @@ function main(parent) { */ // const filter = 'abc123' /** - * Optional. The maximum number of saved queries to return per page. The - * service may return fewer than this value. If unspecified, at most 50 will - * be returned. + * Optional. The maximum number of saved queries to return per page. The service may + * return fewer than this value. If unspecified, at most 50 will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. */ // const pageSize = 1234 diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js index 09128ea3738..71700a00b52 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js @@ -42,13 +42,13 @@ function main(parent) { */ // const statement = 'abc123' /** - * Optional. Reference to the query job, which is from the - * `QueryAssetsResponse` of previous `QueryAssets` call. + * Optional. Reference to the query job, which is from the `QueryAssetsResponse` of + * previous `QueryAssets` call. */ // const jobReference = 'abc123' /** - * Optional. The maximum number of rows to return in the results. Responses - * are limited to 10 MB and 1000 rows. + * Optional. The maximum number of rows to return in the results. Responses are limited + * to 10 MB and 1000 rows. * By default, the maximum row count is 1000. When the byte or row count limit * is reached, the rest of the query results will be paginated. * The field will be ignored when output_config is specified. @@ -60,11 +60,10 @@ function main(parent) { */ // const pageToken = 'abc123' /** - * Optional. Specifies the maximum amount of time that the client is willing - * to wait for the query to complete. By default, this limit is 5 min for the - * first query, and 1 minute for the following queries. If the query is - * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise - * false. + * Optional. Specifies the maximum amount of time that the client is willing to wait + * for the query to complete. By default, this limit is 5 min for the first + * query, and 1 minute for the following queries. If the query is complete, + * the `done` field in the `QueryAssetsResponse` is true, otherwise false. * Like BigQuery jobs.query * API (https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) * The call is not guaranteed to wait for the specified timeout; it typically @@ -74,14 +73,13 @@ function main(parent) { */ // const timeout = {} /** - * Optional. start_time is required. start_time must be less than - * end_time Defaults end_time to now if start_time is set and - * end_time isn't. Maximum permitted time range is 7 days. + * Optional. start_time is required. start_time must be less than end_time + * Defaults end_time to now if start_time is set and end_time isn't. + * Maximum permitted time range is 7 days. */ // const readTimeWindow = {} /** - * Optional. Queries cloud assets as they appeared at the specified point in - * time. + * Optional. Queries cloud assets as they appeared at the specified point in time. */ // const readTime = {} /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index 5c3b05e67aa..e8385294e71 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -29,9 +29,9 @@ function main(scope) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the IAM policies within the `scope`. The caller must - * be granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the * `cloudasset.assets.searchAllIamPolicies` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: @@ -85,24 +85,22 @@ function main(scope) { */ // const query = 'abc123' /** - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. */ // const pageSize = 1234 /** - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. */ // const pageToken = 'abc123' /** - * Optional. A list of asset types that the IAM policies are attached to. If - * empty, it will search the IAM policies that are attached to all the - * searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the searchable asset * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type @@ -117,9 +115,9 @@ function main(scope) { */ // const assetTypes = 'abc123' /** - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index 401168ae69b..1cb0d9f9090 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -29,9 +29,8 @@ function main(scope) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the resources within the `scope`. The caller must be - * granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the * `cloudasset.assets.searchAllResources` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: @@ -61,7 +60,11 @@ function main(scope) { * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed - * encryption key whose name contains the word "key". + * encryption key whose name contains "key" as a word. This field is + * deprecated. Please use the `kmsKeys` field to retrieve KMS key + * information. + * * `kmsKeys:key` to find Cloud resources encrypted with customer-managed + * encryption keys whose name contains the word "key". * * `relationships:instance-group-1` to find Cloud resources that have * relationships with "instance-group-1" in the related resource name. * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that @@ -91,8 +94,8 @@ function main(scope) { */ // const query = 'abc123' /** - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the searchable asset * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots resources whose asset type starts @@ -105,24 +108,23 @@ function main(scope) { */ // const assetTypes = 'abc123' /** - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. */ // const pageSize = 1234 /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. */ // const pageToken = 'abc123' /** - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * * name @@ -131,22 +133,21 @@ function main(scope) { * * displayName * * description * * location - * * kmsKey * * createTime * * updateTime * * state * * parentFullResourceName * * parentAssetType - * All the other fields such as repeated fields (e.g., `networkTags`), map - * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) - * are not supported. + * All the other fields such as repeated fields (e.g., `networkTags`, + * `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g., + * `additionalAttributes`) are not supported. */ // const orderBy = 'abc123' /** - * Optional. A comma-separated list of fields specifying which fields to be - * returned in ResourceSearchResult. Only '*' or combination of top level - * fields can be specified. Field names of both snake_case and camelCase are - * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): * * name @@ -160,7 +161,9 @@ function main(scope) { * * tagValueIds * * labels * * networkTags - * * kmsKey + * * kmsKey (This field is deprecated. Please use the `kmsKeys` field to + * retrieve KMS key information.) + * * kmsKeys * * createTime * * updateTime * * state diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index 6e28a96bdfc..18afe314032 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -29,8 +29,8 @@ function main(feed, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The new values of feed details. It must match an existing feed - * and the field `name` must be in the format of: + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index cb444ddbd0f..b4a70597a8c 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 111, + "end": 110, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 72, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 196, + "end": 199, "type": "FULL" } ], @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 152, + "end": 150, "type": "FULL" } ], @@ -538,7 +538,7 @@ "segments": [ { "start": 25, - "end": 81, + "end": 80, "type": "FULL" } ], @@ -586,7 +586,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 75, "type": "FULL" } ], @@ -682,7 +682,7 @@ "segments": [ { "start": 25, - "end": 115, + "end": 113, "type": "FULL" } ], @@ -842,7 +842,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 79, "type": "FULL" } ], @@ -938,7 +938,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 56, "type": "FULL" } ], diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index e3d8dc39362..b7dfda186bf 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -595,8 +595,9 @@ export class AssetServiceClient { * Required. This is the client-assigned asset feed identifier and it needs to * be unique under a specific parent project/folder/organization. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The feed details. The field `name` must be empty and it will be - * generated in the format of: projects/project_number/feeds/feed_id + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id * folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id * @param {object} [options] @@ -852,8 +853,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.Feed} request.feed - * Required. The new values of feed details. It must match an existing feed - * and the field `name` must be in the format of: + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: * projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or * organizations/organization_number/feeds/feed_id. @@ -1049,8 +1050,7 @@ export class AssetServiceClient { * 0 or empty string, etc., because we use proto3, which doesn't support field * presence yet. * @param {google.protobuf.Duration} [request.executionTimeout] - * Optional. Amount of time executable has to complete. See JSON - * representation of + * Optional. Amount of time executable has to complete. See JSON representation of * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). * * If this field is set with a value less than the RPC deadline, and the @@ -1266,11 +1266,11 @@ export class AssetServiceClient { * Optional. A SQL statement that's compatible with [BigQuery Standard * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). * @param {string} [request.jobReference] - * Optional. Reference to the query job, which is from the - * `QueryAssetsResponse` of previous `QueryAssets` call. + * Optional. Reference to the query job, which is from the `QueryAssetsResponse` of + * previous `QueryAssets` call. * @param {number} [request.pageSize] - * Optional. The maximum number of rows to return in the results. Responses - * are limited to 10 MB and 1000 rows. + * Optional. The maximum number of rows to return in the results. Responses are limited + * to 10 MB and 1000 rows. * * By default, the maximum row count is 1000. When the byte or row count limit * is reached, the rest of the query results will be paginated. @@ -1281,11 +1281,10 @@ export class AssetServiceClient { * * The field will be ignored when [output_config] is specified. * @param {google.protobuf.Duration} [request.timeout] - * Optional. Specifies the maximum amount of time that the client is willing - * to wait for the query to complete. By default, this limit is 5 min for the - * first query, and 1 minute for the following queries. If the query is - * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise - * false. + * Optional. Specifies the maximum amount of time that the client is willing to wait + * for the query to complete. By default, this limit is 5 min for the first + * query, and 1 minute for the following queries. If the query is complete, + * the `done` field in the `QueryAssetsResponse` is true, otherwise false. * * Like BigQuery [jobs.query * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) @@ -1295,12 +1294,11 @@ export class AssetServiceClient { * * The field will be ignored when [output_config] is specified. * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] - * Optional. [start_time] is required. [start_time] must be less than - * [end_time] Defaults [end_time] to now if [start_time] is set and - * [end_time] isn't. Maximum permitted time range is 7 days. + * Optional. [start_time] is required. [start_time] must be less than [end_time] + * Defaults [end_time] to now if [start_time] is set and [end_time] isn't. + * Maximum permitted time range is 7 days. * @param {google.protobuf.Timestamp} [request.readTime] - * Optional. Queries cloud assets as they appeared at the specified point in - * time. + * Optional. Queries cloud assets as they appeared at the specified point in time. * @param {google.cloud.asset.v1.QueryAssetsOutputConfig} [request.outputConfig] * Optional. Destination where the query results will be saved. * @@ -1393,18 +1391,18 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project/folder/organization where this - * saved_query should be created in. It can only be an organization number - * (such as "organizations/123"), a folder number (such as "folders/123"), a - * project ID (such as "projects/my-project-id")", or a project number (such - * as "projects/12345"). + * Required. The name of the project/folder/organization where this saved_query + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery - * Required. The saved_query details. The `name` field must be empty as it - * will be generated based on the parent and saved_query_id. + * Required. The saved_query details. The `name` field must be empty as it will be + * generated based on the parent and saved_query_id. * @param {string} request.savedQueryId - * Required. The ID to use for the saved query, which must be unique in the - * specified parent. It will become the final component of the saved query's - * resource name. + * Required. The ID to use for the saved query, which must be unique in the specified + * parent. It will become the final component of the saved query's resource + * name. * * This value should be 4-63 characters, and valid characters * are /{@link 0-9|a-z}-/. @@ -1676,8 +1674,7 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the saved query to delete. It must be in the format - * of: + * Required. The name of the saved query to delete. It must be in the format of: * * * projects/project_number/savedQueries/saved_query_id * * folders/folder_number/savedQueries/saved_query_id @@ -1882,14 +1879,13 @@ export class AssetServiceClient { * Exports assets with time and resource types to a given Cloud Storage * location/BigQuery table. For Cloud Storage location destinations, the * output format is newline-delimited JSON. Each line represents a - * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON - * format; for BigQuery table destinations, the output table stores the fields - * in asset Protobuf as columns. This API implements the - * {@link google.longrunning.Operation|google.longrunning.Operation} API, which - * allows you to keep track of the export. We recommend intervals of at least - * 2 seconds with exponential retry to poll the export operation result. For - * regular-size resource parent, the export operation usually finishes within - * 5 minutes. + * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON format; for BigQuery table + * destinations, the output table stores the fields in asset Protobuf as + * columns. This API implements the {@link google.longrunning.Operation|google.longrunning.Operation} API, + * which allows you to keep track of the export. We recommend intervals of at + * least 2 seconds with exponential retry to poll the export operation result. + * For regular-size resource parent, the export operation usually finishes + * within 5 minutes. * * @param {Object} request * The request object that will be sent. @@ -1927,8 +1923,7 @@ export class AssetServiceClient { * Asset content type. If not specified, no content but the asset name will be * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. + * Required. Output configuration indicating where the results will be output to. * @param {string[]} request.relationshipTypes * A list of relationship types to export, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if @@ -2081,12 +2076,11 @@ export class AssetServiceClient { * accesses on which resources, and writes the analysis results to a Google * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the * output format is the JSON format that represents a - * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. - * This method implements the - * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows - * you to track the operation status. We recommend intervals of at least 2 - * seconds with exponential backoff retry to poll the operation result. The - * metadata contains the metadata for the long-running operation. + * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. This method implements the + * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation + * status. We recommend intervals of at least 2 seconds with exponential + * backoff retry to poll the operation result. The metadata contains the + * metadata for the long-running operation. * * @param {Object} request * The request object that will be sent. @@ -2110,8 +2104,7 @@ export class AssetServiceClient { * 0 or empty string, etc., because we use proto3, which doesn't support field * presence yet. * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. + * Required. Output configuration indicating where the results will be output to. * @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. @@ -2254,11 +2247,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization, folder, or project the assets belong - * to. Format: "organizations/[organization-number]" (such as - * "organizations/123"), "projects/[project-id]" (such as - * "projects/my-project-id"), "projects/[project-number]" (such as - * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * Required. Name of the organization, folder, or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), + * "projects/[project-number]" (such as "projects/12345"), or + * "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -2395,11 +2388,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization, folder, or project the assets belong - * to. Format: "organizations/[organization-number]" (such as - * "organizations/123"), "projects/[project-id]" (such as - * "projects/my-project-id"), "projects/[project-number]" (such as - * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * Required. Name of the organization, folder, or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), + * "projects/[project-number]" (such as "projects/12345"), or + * "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -2492,11 +2485,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization, folder, or project the assets belong - * to. Format: "organizations/[organization-number]" (such as - * "organizations/123"), "projects/[project-id]" (such as - * "projects/my-project-id"), "projects/[project-number]" (such as - * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * Required. Name of the organization, folder, or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), + * "projects/[project-number]" (such as "projects/12345"), or + * "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -2591,9 +2584,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the resources within the `scope`. The caller must be - * granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2625,7 +2617,11 @@ export class AssetServiceClient { * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed - * encryption key whose name contains the word "key". + * encryption key whose name contains "key" as a word. This field is + * deprecated. Please use the `kmsKeys` field to retrieve KMS key + * information. + * * `kmsKeys:key` to find Cloud resources encrypted with customer-managed + * encryption keys whose name contains the word "key". * * `relationships:instance-group-1` to find Cloud resources that have * relationships with "instance-group-1" in the related resource name. * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that @@ -2653,8 +2649,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2668,20 +2664,19 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * @@ -2691,21 +2686,20 @@ export class AssetServiceClient { * * displayName * * description * * location - * * kmsKey * * createTime * * updateTime * * state * * parentFullResourceName * * parentAssetType * - * All the other fields such as repeated fields (e.g., `networkTags`), map - * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) - * are not supported. + * All the other fields such as repeated fields (e.g., `networkTags`, + * `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g., + * `additionalAttributes`) are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be - * returned in ResourceSearchResult. Only '*' or combination of top level - * fields can be specified. Field names of both snake_case and camelCase are - * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -2721,7 +2715,9 @@ export class AssetServiceClient { * * tagValueIds * * labels * * networkTags - * * kmsKey + * * kmsKey (This field is deprecated. Please use the `kmsKeys` field to + * retrieve KMS key information.) + * * kmsKeys * * createTime * * updateTime * * state @@ -2826,9 +2822,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the resources within the `scope`. The caller must be - * granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2860,7 +2855,11 @@ export class AssetServiceClient { * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed - * encryption key whose name contains the word "key". + * encryption key whose name contains "key" as a word. This field is + * deprecated. Please use the `kmsKeys` field to retrieve KMS key + * information. + * * `kmsKeys:key` to find Cloud resources encrypted with customer-managed + * encryption keys whose name contains the word "key". * * `relationships:instance-group-1` to find Cloud resources that have * relationships with "instance-group-1" in the related resource name. * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that @@ -2888,8 +2887,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2903,20 +2902,19 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * @@ -2926,21 +2924,20 @@ export class AssetServiceClient { * * displayName * * description * * location - * * kmsKey * * createTime * * updateTime * * state * * parentFullResourceName * * parentAssetType * - * All the other fields such as repeated fields (e.g., `networkTags`), map - * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) - * are not supported. + * All the other fields such as repeated fields (e.g., `networkTags`, + * `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g., + * `additionalAttributes`) are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be - * returned in ResourceSearchResult. Only '*' or combination of top level - * fields can be specified. Field names of both snake_case and camelCase are - * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -2956,7 +2953,9 @@ export class AssetServiceClient { * * tagValueIds * * labels * * networkTags - * * kmsKey + * * kmsKey (This field is deprecated. Please use the `kmsKeys` field to + * retrieve KMS key information.) + * * kmsKeys * * createTime * * updateTime * * state @@ -3009,9 +3008,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the resources within the `scope`. The caller must be - * granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -3043,7 +3041,11 @@ export class AssetServiceClient { * and its value is "prod". * * `labels.env:*` to find Cloud resources that have a label "env". * * `kmsKey:key` to find Cloud resources encrypted with a customer-managed - * encryption key whose name contains the word "key". + * encryption key whose name contains "key" as a word. This field is + * deprecated. Please use the `kmsKeys` field to retrieve KMS key + * information. + * * `kmsKeys:key` to find Cloud resources encrypted with customer-managed + * encryption keys whose name contains the word "key". * * `relationships:instance-group-1` to find Cloud resources that have * relationships with "instance-group-1" in the related resource name. * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that @@ -3071,8 +3073,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -3086,20 +3088,19 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of all other - * method parameters, must be identical to those in the previous call. + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "location DESC, name". * Only singular primitive fields in the response are sortable: * @@ -3109,21 +3110,20 @@ export class AssetServiceClient { * * displayName * * description * * location - * * kmsKey * * createTime * * updateTime * * state * * parentFullResourceName * * parentAssetType * - * All the other fields such as repeated fields (e.g., `networkTags`), map - * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) - * are not supported. + * All the other fields such as repeated fields (e.g., `networkTags`, + * `kmsKeys`), map fields (e.g., `labels`) and struct fields (e.g., + * `additionalAttributes`) are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be - * returned in ResourceSearchResult. Only '*' or combination of top level - * fields can be specified. Field names of both snake_case and camelCase are - * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be returned in + * ResourceSearchResult. Only '*' or combination of top level fields can be + * specified. Field names of both snake_case and camelCase are supported. + * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -3139,7 +3139,9 @@ export class AssetServiceClient { * * tagValueIds * * labels * * networkTags - * * kmsKey + * * kmsKey (This field is deprecated. Please use the `kmsKeys` field to + * retrieve KMS key information.) + * * kmsKeys * * createTime * * updateTime * * state @@ -3194,9 +3196,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the IAM policies within the `scope`. The caller must - * be granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -3250,20 +3252,18 @@ export class AssetServiceClient { * * `memberTypes:user` to find IAM policy bindings that contain the * principal type "user". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If - * empty, it will search the IAM policies that are attached to all the - * [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -3279,9 +3279,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -3382,9 +3382,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the IAM policies within the `scope`. The caller must - * be granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -3438,20 +3438,18 @@ export class AssetServiceClient { * * `memberTypes:user` to find IAM policy bindings that contain the * principal type "user". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If - * empty, it will search the IAM policies that are attached to all the - * [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -3467,9 +3465,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -3518,9 +3516,9 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder, or an organization. The - * search is limited to the IAM policies within the `scope`. The caller must - * be granted the + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -3574,20 +3572,18 @@ export class AssetServiceClient { * * `memberTypes:user` to find IAM policy bindings that contain the * principal type "user". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding - * call to this method. `page_token` must be the value of `next_page_token` - * from the previous response. The values of all other method parameters must - * be identical to those in the previous call. + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If - * empty, it will search the IAM policies that are attached to all the - * [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If empty, it + * will search the IAM policies that are attached to all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -3603,9 +3599,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. + * Optional. A comma-separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. * Example: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -3653,8 +3649,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent project/folder/organization whose savedQueries are to - * be listed. It can only be using project/folder/organization number (such as + * Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). * @param {string} [request.filter] * Optional. The expression to filter resources. @@ -3665,9 +3661,8 @@ export class AssetServiceClient { * * See https://google.aip.dev/160 for more information on the grammar. * @param {number} [request.pageSize] - * Optional. The maximum number of saved queries to return per page. The - * service may return fewer than this value. If unspecified, at most 50 will - * be returned. + * Optional. The maximum number of saved queries to return per page. The service may + * return fewer than this value. If unspecified, at most 50 will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous `ListSavedQueries` call. @@ -3762,8 +3757,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent project/folder/organization whose savedQueries are to - * be listed. It can only be using project/folder/organization number (such as + * Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). * @param {string} [request.filter] * Optional. The expression to filter resources. @@ -3774,9 +3769,8 @@ export class AssetServiceClient { * * See https://google.aip.dev/160 for more information on the grammar. * @param {number} [request.pageSize] - * Optional. The maximum number of saved queries to return per page. The - * service may return fewer than this value. If unspecified, at most 50 will - * be returned. + * Optional. The maximum number of saved queries to return per page. The service may + * return fewer than this value. If unspecified, at most 50 will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous `ListSavedQueries` call. @@ -3825,8 +3819,8 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent project/folder/organization whose savedQueries are to - * be listed. It can only be using project/folder/organization number (such as + * Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as * "folders/12345")", or a project ID (such as "projects/my-project-id"). * @param {string} [request.filter] * Optional. The expression to filter resources. @@ -3837,9 +3831,8 @@ export class AssetServiceClient { * * See https://google.aip.dev/160 for more information on the grammar. * @param {number} [request.pageSize] - * Optional. The maximum number of saved queries to return per page. The - * service may return fewer than this value. If unspecified, at most 50 will - * be returned. + * Optional. The maximum number of saved queries to return per page. The service may + * return fewer than this value. If unspecified, at most 50 will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous `ListSavedQueries` call. From 1a75eb321c2be57872f5452bcfb4e1c5abe3dd74 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:52:39 -0800 Subject: [PATCH 425/429] chore(main): release 4.5.0 (#671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 4.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 --- packages/google-cloud-asset/CHANGELOG.md | 14 ++++++++++++++ packages/google-cloud-asset/package.json | 2 +- .../v1/snippet_metadata.google.cloud.asset.v1.json | 2 +- ...ppet_metadata.google.cloud.asset.v1p1beta1.json | 2 +- ...ppet_metadata.google.cloud.asset.v1p2beta1.json | 2 +- ...ppet_metadata.google.cloud.asset.v1p4beta1.json | 2 +- ...ppet_metadata.google.cloud.asset.v1p5beta1.json | 2 +- packages/google-cloud-asset/samples/package.json | 2 +- 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index de459b992d0..c267ea8f9cf 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,20 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [4.5.0](https://github.com/googleapis/nodejs-asset/compare/v4.4.0...v4.5.0) (2022-11-11) + + +### Features + +* Add a new searchable field kmsKeys ([#665](https://github.com/googleapis/nodejs-asset/issues/665)) ([567ccbd](https://github.com/googleapis/nodejs-asset/commit/567ccbd70f35f5fce8125b2569d9b0492a9da5cb)) + + +### Bug Fixes + +* deprecate searchable field kmsKey ([567ccbd](https://github.com/googleapis/nodejs-asset/commit/567ccbd70f35f5fce8125b2569d9b0492a9da5cb)) +* **deps:** Use google-gax v3.5.2 ([#669](https://github.com/googleapis/nodejs-asset/issues/669)) ([a6ede56](https://github.com/googleapis/nodejs-asset/commit/a6ede563b7cfd10e6646a3255b64a9aa74b07169)) +* Regenerated protos JS and TS definitions ([#673](https://github.com/googleapis/nodejs-asset/issues/673)) ([35bb44c](https://github.com/googleapis/nodejs-asset/commit/35bb44c04408a5319a34e816e63e26d1877e4cd5)) + ## [4.4.0](https://github.com/googleapis/nodejs-asset/compare/v4.3.0...v4.4.0) (2022-09-22) diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 5d5a5262df7..cc3b6706eb8 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "4.4.0", + "version": "4.5.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index b4a70597a8c..dbf03c1a65b 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 155b315f124..d1258fd6911 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index 292139bf41a..cae55b1fa21 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index 7771162886a..0e8ecd2058a 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index afda0367849..33e4d41e9c8 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index d567b55bf7a..30b356b93b8 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^4.4.0", + "@google-cloud/asset": "^4.5.0", "@google-cloud/bigquery": "^6.0.0", "@google-cloud/compute": "^3.0.0", "@google-cloud/storage": "^6.0.0", From eefbd1061e6e4bd76f42a3aa58d66940abf7de05 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 02:00:44 -0800 Subject: [PATCH 426/429] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../{.github => }/.OwlBot.yaml | 6 +- packages/google-cloud-asset/.mocharc.js | 2 +- packages/google-cloud-asset/.prettierrc.js | 2 +- .../google-cloud-asset/.repo-metadata.json | 2 +- packages/google-cloud-asset/README.md | 60 ++- packages/google-cloud-asset/package.json | 13 +- packages/google-cloud-asset/samples/README.md | 454 ++++++++++++++---- packages/google-cloud-asset/src/index.ts | 2 +- release-please-config.json | 3 +- 10 files changed, 412 insertions(+), 133 deletions(-) rename packages/google-cloud-asset/{.github => }/.OwlBot.yaml (81%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c38b0a70276..41b3a4d90e1 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-asset": "4.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-asset/.github/.OwlBot.yaml b/packages/google-cloud-asset/.OwlBot.yaml similarity index 81% rename from packages/google-cloud-asset/.github/.OwlBot.yaml rename to packages/google-cloud-asset/.OwlBot.yaml index 5d77fab0c9d..cc3f6b8d6a9 100644 --- a/packages/google-cloud-asset/.github/.OwlBot.yaml +++ b/packages/google-cloud-asset/.OwlBot.yaml @@ -11,8 +11,6 @@ # 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 @@ -21,5 +19,5 @@ deep-preserve-regex: - /owl-bot-staging/v1p7beta1 deep-copy-regex: - - source: /google/cloud/asset/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 \ No newline at end of file + - source: /google/cloud/asset/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-asset/$1 \ No newline at end of file diff --git a/packages/google-cloud-asset/.mocharc.js b/packages/google-cloud-asset/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-asset/.mocharc.js +++ b/packages/google-cloud-asset/.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-asset/.prettierrc.js b/packages/google-cloud-asset/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-asset/.prettierrc.js +++ b/packages/google-cloud-asset/.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-asset/.repo-metadata.json b/packages/google-cloud-asset/.repo-metadata.json index 67703c8422e..15f51f6e3a0 100644 --- a/packages/google-cloud-asset/.repo-metadata.json +++ b/packages/google-cloud-asset/.repo-metadata.json @@ -6,7 +6,7 @@ "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", "release_level": "stable", "language": "nodejs", - "repo": "googleapis/nodejs-asset", + "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/asset", "api_id": "cloudasset.googleapis.com", "requires_billing": true, diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index e3b98f29d78..7bd7bbe1df6 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Asset Inventory: Node.js Client](https://github.com/googleapis/nodejs-asset) +# [Cloud Asset Inventory: 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/asset.svg)](https://www.npmjs.org/package/@google-cloud/asset) @@ -14,11 +14,11 @@ Cloud Asset API client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-asset/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset/CHANGELOG.md). * [Cloud Asset Inventory Node.js Client API Reference][client-docs] * [Cloud Asset Inventory Documentation][product-docs] -* [github.com/googleapis/nodejs-asset](https://github.com/googleapis/nodejs-asset) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-asset](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -90,26 +90,42 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-asset/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 | | --------------------------- | --------------------------------- | ------ | -| Analyze Iam Policy | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) | -| Analyze Iam Policy Longrunning and write results to Bigquery | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) | -| Analyze Iam Policy Longrunning and write results to GCS | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningGcs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) | -| Create Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/createFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) | -| Delete Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/deleteFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) | -| Export Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) | -| Export Assets To BigQuery | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssetsBigquery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssetsBigquery.js,samples/README.md) | -| Get Batch Asset History | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchAssetHistory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) | -| Batch Get Effective Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchEffectiveIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchEffectiveIamPolicies.js,samples/README.md) | -| Get Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) | -| List Assets | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listAssets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) | -| List Feeds | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listFeeds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) | -| Asset History Quickstart | [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Search All Iam Policies | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllIamPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) | -| Search All Resources | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllResources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) | -| Update Feed | [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/updateFeed.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.js,samples/README.md) | +| Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy.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/asset_service.analyze_iam_policy.js,samples/README.md) | +| Asset_service.analyze_iam_policy_longrunning | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.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/asset_service.analyze_iam_policy_longrunning.js,samples/README.md) | +| Asset_service.analyze_move | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_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/v1/asset_service.analyze_move.js,samples/README.md) | +| Asset_service.batch_get_assets_history | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_assets_history.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/asset_service.batch_get_assets_history.js,samples/README.md) | +| Asset_service.batch_get_effective_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_effective_iam_policies.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/asset_service.batch_get_effective_iam_policies.js,samples/README.md) | +| Asset_service.create_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_feed.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/asset_service.create_feed.js,samples/README.md) | +| Asset_service.create_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_saved_query.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/asset_service.create_saved_query.js,samples/README.md) | +| Asset_service.delete_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_feed.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/asset_service.delete_feed.js,samples/README.md) | +| Asset_service.delete_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_saved_query.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/asset_service.delete_saved_query.js,samples/README.md) | +| Asset_service.export_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.export_assets.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/asset_service.export_assets.js,samples/README.md) | +| Asset_service.get_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_feed.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/asset_service.get_feed.js,samples/README.md) | +| Asset_service.get_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_saved_query.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/asset_service.get_saved_query.js,samples/README.md) | +| Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_assets.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/asset_service.list_assets.js,samples/README.md) | +| Asset_service.list_feeds | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_feeds.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/asset_service.list_feeds.js,samples/README.md) | +| Asset_service.list_saved_queries | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_saved_queries.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/asset_service.list_saved_queries.js,samples/README.md) | +| Asset_service.query_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.query_assets.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/asset_service.query_assets.js,samples/README.md) | +| Asset_service.search_all_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_iam_policies.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/asset_service.search_all_iam_policies.js,samples/README.md) | +| Asset_service.search_all_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_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/asset_service.search_all_resources.js,samples/README.md) | +| Asset_service.update_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_feed.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/asset_service.update_feed.js,samples/README.md) | +| Asset_service.update_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_saved_query.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/asset_service.update_saved_query.js,samples/README.md) | +| Asset_service.search_all_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.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/v1p1beta1/asset_service.search_all_iam_policies.js,samples/README.md) | +| Asset_service.search_all_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_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/v1p1beta1/asset_service.search_all_resources.js,samples/README.md) | +| Asset_service.create_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.create_feed.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/v1p2beta1/asset_service.create_feed.js,samples/README.md) | +| Asset_service.delete_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.delete_feed.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/v1p2beta1/asset_service.delete_feed.js,samples/README.md) | +| Asset_service.get_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.get_feed.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/v1p2beta1/asset_service.get_feed.js,samples/README.md) | +| Asset_service.list_feeds | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.list_feeds.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/v1p2beta1/asset_service.list_feeds.js,samples/README.md) | +| Asset_service.update_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.update_feed.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/v1p2beta1/asset_service.update_feed.js,samples/README.md) | +| Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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/v1p4beta1/asset_service.analyze_iam_policy.js,samples/README.md) | +| Asset_service.export_iam_policy_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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/v1p4beta1/asset_service.export_iam_policy_analysis.js,samples/README.md) | +| Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p5beta1/asset_service.list_assets.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/v1p5beta1/asset_service.list_assets.js,samples/README.md) | +| Asset History 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) | +| Sample.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/sample.test.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/sample.test.js,samples/README.md) | @@ -159,7 +175,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-asset/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`) @@ -171,7 +187,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-asset/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/asset/latest [product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index cc3b6706eb8..14ce3b58915 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -7,7 +7,11 @@ "engines": { "node": ">=12.0.0" }, - "repository": "googleapis/nodejs-asset", + "repository": { + "type": "git", + "directory": "packages/google-cloud-asset", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "main": "build/src/index.js", "files": [ "build/src", @@ -27,7 +31,7 @@ "Cloud Asset API" ], "scripts": { - "samples-test": "c8 npm run samples-test-suite", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", "samples-test-suite": "cd samples/ && npm link ../ && npm test && cd ../", "clean": "gts clean", "compile": "tsc -p . && cp -r protos build/", @@ -38,7 +42,7 @@ "lint": "gts check", "predocs-test": "npm run docs", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", + "system-test": "npm run compile && c8 mocha build/system-test", "test": "c8 mocha build/test", "prelint": "cd samples; npm link ../; npm install", "precompile": "gts clean" @@ -65,5 +69,6 @@ "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset" } diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index 17c1698f4e7..c069cc22181 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Asset Inventory: Node.js Samples](https://github.com/googleapis/nodejs-asset) +# [Cloud Asset Inventory: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,27 +12,43 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) - * [Analyze Iam Policy](#analyze-iam-policy) - * [Analyze Iam Policy Longrunning and write results to Bigquery](#analyze-iam-policy-longrunning-and-write-results-to-bigquery) - * [Analyze Iam Policy Longrunning and write results to GCS](#analyze-iam-policy-longrunning-and-write-results-to-gcs) - * [Create Feed](#create-feed) - * [Delete Feed](#delete-feed) - * [Export Assets](#export-assets) - * [Export Assets To BigQuery](#export-assets-to-bigquery) - * [Get Batch Asset History](#get-batch-asset-history) - * [Batch Get Effective Iam Policies](#batch-get-effective-iam-policies) - * [Get Feed](#get-feed) - * [List Assets](#list-assets) - * [List Feeds](#list-feeds) + * [Asset_service.analyze_iam_policy](#asset_service.analyze_iam_policy) + * [Asset_service.analyze_iam_policy_longrunning](#asset_service.analyze_iam_policy_longrunning) + * [Asset_service.analyze_move](#asset_service.analyze_move) + * [Asset_service.batch_get_assets_history](#asset_service.batch_get_assets_history) + * [Asset_service.batch_get_effective_iam_policies](#asset_service.batch_get_effective_iam_policies) + * [Asset_service.create_feed](#asset_service.create_feed) + * [Asset_service.create_saved_query](#asset_service.create_saved_query) + * [Asset_service.delete_feed](#asset_service.delete_feed) + * [Asset_service.delete_saved_query](#asset_service.delete_saved_query) + * [Asset_service.export_assets](#asset_service.export_assets) + * [Asset_service.get_feed](#asset_service.get_feed) + * [Asset_service.get_saved_query](#asset_service.get_saved_query) + * [Asset_service.list_assets](#asset_service.list_assets) + * [Asset_service.list_feeds](#asset_service.list_feeds) + * [Asset_service.list_saved_queries](#asset_service.list_saved_queries) + * [Asset_service.query_assets](#asset_service.query_assets) + * [Asset_service.search_all_iam_policies](#asset_service.search_all_iam_policies) + * [Asset_service.search_all_resources](#asset_service.search_all_resources) + * [Asset_service.update_feed](#asset_service.update_feed) + * [Asset_service.update_saved_query](#asset_service.update_saved_query) + * [Asset_service.search_all_iam_policies](#asset_service.search_all_iam_policies) + * [Asset_service.search_all_resources](#asset_service.search_all_resources) + * [Asset_service.create_feed](#asset_service.create_feed) + * [Asset_service.delete_feed](#asset_service.delete_feed) + * [Asset_service.get_feed](#asset_service.get_feed) + * [Asset_service.list_feeds](#asset_service.list_feeds) + * [Asset_service.update_feed](#asset_service.update_feed) + * [Asset_service.analyze_iam_policy](#asset_service.analyze_iam_policy) + * [Asset_service.export_iam_policy_analysis](#asset_service.export_iam_policy_analysis) + * [Asset_service.list_assets](#asset_service.list_assets) * [Asset History Quickstart](#asset-history-quickstart) - * [Search All Iam Policies](#search-all-iam-policies) - * [Search All Resources](#search-all-resources) - * [Update Feed](#update-feed) + * [Sample.test](#sample.test) ## 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-asset#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -44,18 +60,33 @@ Before running the samples, make sure you've followed the steps outlined in -### Analyze Iam Policy +### Asset_service.analyze_iam_policy -Analyzes accessible IAM policies that match a request. +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy.js). -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicy.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/asset_service.analyze_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy.js` + + +----- -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicy.js,samples/README.md) + + + +### Asset_service.analyze_iam_policy_longrunning + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.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/asset_service.analyze_iam_policy_longrunning.js,samples/README.md) __Usage:__ -`node analyzeIamPolicy` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js` ----- @@ -63,18 +94,33 @@ __Usage:__ -### Analyze Iam Policy Longrunning and write results to Bigquery +### Asset_service.analyze_move + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_move.js). -Analyzes accessible IAM policies that match a request. +[![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/asset_service.analyze_move.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_move.js` + + +----- -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningBigquery.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningBigquery.js,samples/README.md) + + +### Asset_service.batch_get_assets_history + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_assets_history.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/asset_service.batch_get_assets_history.js,samples/README.md) __Usage:__ -`node analyzeIamPolicyLongrunningBigquery ` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_assets_history.js` ----- @@ -82,18 +128,33 @@ __Usage:__ -### Analyze Iam Policy Longrunning and write results to GCS +### Asset_service.batch_get_effective_iam_policies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js). -Analyzes accessible IAM policies that match a request. +[![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/asset_service.batch_get_effective_iam_policies.js,samples/README.md) -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/analyzeIamPolicyLongrunningGcs.js). +__Usage:__ -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/analyzeIamPolicyLongrunningGcs.js,samples/README.md) + +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js` + + +----- + + + + +### Asset_service.create_feed + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_feed.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/asset_service.create_feed.js,samples/README.md) __Usage:__ -`node analyzeIamPolicyLongrunningGcs ` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.create_feed.js` ----- @@ -101,18 +162,33 @@ __Usage:__ -### Create Feed +### Asset_service.create_saved_query -Create Feed. +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_saved_query.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/asset_service.create_saved_query.js,samples/README.md) + +__Usage:__ -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/createFeed.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/createFeed.js,samples/README.md) +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.create_saved_query.js` + + +----- + + + + +### Asset_service.delete_feed + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_feed.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/asset_service.delete_feed.js,samples/README.md) __Usage:__ -`node createFeed "storage.googleapis.com/", projects//topics/, "RESOURCE"` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.delete_feed.js` ----- @@ -120,18 +196,33 @@ __Usage:__ -### Delete Feed +### Asset_service.delete_saved_query -Delete Feed. +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_saved_query.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/asset_service.delete_saved_query.js,samples/README.md) + +__Usage:__ -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/deleteFeed.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/deleteFeed.js,samples/README.md) +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.delete_saved_query.js` + + +----- + + + + +### Asset_service.export_assets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.export_assets.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/asset_service.export_assets.js,samples/README.md) __Usage:__ -`node deleteFeed "project//feeds/"` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.export_assets.js` ----- @@ -139,18 +230,33 @@ __Usage:__ -### Export Assets +### Asset_service.get_feed + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_feed.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/asset_service.get_feed.js,samples/README.md) + +__Usage:__ -Export asserts to specified dump file path. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssets.js). +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.get_feed.js` -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssets.js,samples/README.md) + +----- + + + + +### Asset_service.get_saved_query + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_saved_query.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/asset_service.get_saved_query.js,samples/README.md) __Usage:__ -`node exportAssets.js ` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.get_saved_query.js` ----- @@ -158,18 +264,33 @@ __Usage:__ -### Export Assets To BigQuery +### Asset_service.list_assets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_assets.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/asset_service.list_assets.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.list_assets.js` + + +----- + + -Export asserts to specified BigQuery table. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/exportAssetsBigquery.js). +### Asset_service.list_feeds -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/exportAssetsBigquery.js,samples/README.md) +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_feeds.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/asset_service.list_feeds.js,samples/README.md) __Usage:__ -`node exportAssetsBigquery.js ` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.list_feeds.js` ----- @@ -177,18 +298,33 @@ __Usage:__ -### Get Batch Asset History +### Asset_service.list_saved_queries + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_saved_queries.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/asset_service.list_saved_queries.js,samples/README.md) + +__Usage:__ -Batch get history of assets. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchAssetHistory.js). +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.list_saved_queries.js` -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchAssetHistory.js,samples/README.md) + +----- + + + + +### Asset_service.query_assets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.query_assets.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/asset_service.query_assets.js,samples/README.md) __Usage:__ -`node getBatchAssetHistory "storage.googleapis.com/"` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.query_assets.js` ----- @@ -196,18 +332,33 @@ __Usage:__ -### Batch Get Effective Iam Policies +### Asset_service.search_all_iam_policies -Batch get effective IAM policies that match a request. +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_iam_policies.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/asset_service.search_all_iam_policies.js,samples/README.md) + +__Usage:__ -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getBatchEffectiveIamPolicies.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getBatchEffectiveIamPolicies.js,samples/README.md) +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_iam_policies.js` + + +----- + + + + +### Asset_service.search_all_resources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_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/asset_service.search_all_resources.js,samples/README.md) __Usage:__ -`node batchGetEffectiveIamPolicies` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_resources.js` ----- @@ -215,18 +366,33 @@ __Usage:__ -### Get Feed +### Asset_service.update_feed + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_feed.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/asset_service.update_feed.js,samples/README.md) + +__Usage:__ -Get Feed. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/getFeed.js). +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.update_feed.js` -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/getFeed.js,samples/README.md) + +----- + + + + +### Asset_service.update_saved_query + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_saved_query.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/asset_service.update_saved_query.js,samples/README.md) __Usage:__ -`node getFeed "project//feeds/"` +`node /workspace/google-cloud-node/samples/generated/v1/asset_service.update_saved_query.js` ----- @@ -234,18 +400,33 @@ __Usage:__ -### List Assets +### Asset_service.search_all_iam_policies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.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/v1p1beta1/asset_service.search_all_iam_policies.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js` + + +----- + + -List assets under the current project. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listAssets.js). +### Asset_service.search_all_resources -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listAssets.js,samples/README.md) +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_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/v1p1beta1/asset_service.search_all_resources.js,samples/README.md) __Usage:__ -`node listAssets ` +`node /workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_resources.js` ----- @@ -253,18 +434,33 @@ __Usage:__ -### List Feeds +### Asset_service.create_feed + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.create_feed.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/v1p2beta1/asset_service.create_feed.js,samples/README.md) + +__Usage:__ -List Feeds. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/listFeeds.js). +`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.create_feed.js` -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/listFeeds.js,samples/README.md) + +----- + + + + +### Asset_service.delete_feed + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.delete_feed.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/v1p2beta1/asset_service.delete_feed.js,samples/README.md) __Usage:__ -`node listFeeds` +`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.delete_feed.js` ----- @@ -272,18 +468,33 @@ __Usage:__ -### Asset History Quickstart +### Asset_service.get_feed -Batch get history of assets. +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.get_feed.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/v1p2beta1/asset_service.get_feed.js,samples/README.md) + +__Usage:__ -View the [source code](https://github.com/googleapis/nodejs-asset/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-asset&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.get_feed.js` + + +----- + + + + +### Asset_service.list_feeds + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.list_feeds.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/v1p2beta1/asset_service.list_feeds.js,samples/README.md) __Usage:__ -`node getBatchAssetHistory "storage.googleapis.com/"` +`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.list_feeds.js` ----- @@ -291,18 +502,33 @@ __Usage:__ -### Search All Iam Policies +### Asset_service.update_feed -Search All Iam Policies. +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.update_feed.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/v1p2beta1/asset_service.update_feed.js,samples/README.md) + +__Usage:__ -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllIamPolicies.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllIamPolicies.js,samples/README.md) +`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.update_feed.js` + + +----- + + + + +### Asset_service.analyze_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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/v1p4beta1/asset_service.analyze_iam_policy.js,samples/README.md) __Usage:__ -`node searchAllIamPolicies ` +`node /workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js` ----- @@ -310,18 +536,33 @@ __Usage:__ -### Search All Resources +### Asset_service.export_iam_policy_analysis + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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/v1p4beta1/asset_service.export_iam_policy_analysis.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js` + + +----- + -Search All Resources. -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/searchAllResources.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/searchAllResources.js,samples/README.md) +### Asset_service.list_assets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p5beta1/asset_service.list_assets.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/v1p5beta1/asset_service.list_assets.js,samples/README.md) __Usage:__ -`node searchAllResources ` +`node /workspace/google-cloud-node/samples/generated/v1p5beta1/asset_service.list_assets.js` ----- @@ -329,18 +570,35 @@ __Usage:__ -### Update Feed +### Asset History Quickstart + +Batch get history of assets. + +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 getBatchAssetHistory "storage.googleapis.com/"` + + +----- + + + -Update Feed. +### Sample.test -View the [source code](https://github.com/googleapis/nodejs-asset/blob/main/samples/updateFeed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/sample.test.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-asset&page=editor&open_in_editor=samples/updateFeed.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/sample.test.js,samples/README.md) __Usage:__ -`node updateFeed "project//feeds/" projects//topics/` +`node /workspace/google-cloud-node/samples/test/sample.test.js` @@ -348,5 +606,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-asset&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/resource-manager/docs/cloud-asset-inventory/overview diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index fc2b6f63346..e64d9b90e22 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/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..cb4ffd3d3e6 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-asset": {}, "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 fdb9b2bb4fd26be577c622297667f7c029732321 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 12 Nov 2022 00:46:09 +0000 Subject: [PATCH 427/429] =?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 --- packages/google-cloud-asset/README.md | 64 +++--- packages/google-cloud-asset/samples/README.md | 190 +++++++++--------- release-please-config.json | 2 +- 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 7bd7bbe1df6..866de22fbfc 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -94,38 +94,38 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy.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/asset_service.analyze_iam_policy.js,samples/README.md) | -| Asset_service.analyze_iam_policy_longrunning | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.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/asset_service.analyze_iam_policy_longrunning.js,samples/README.md) | -| Asset_service.analyze_move | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_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/v1/asset_service.analyze_move.js,samples/README.md) | -| Asset_service.batch_get_assets_history | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_assets_history.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/asset_service.batch_get_assets_history.js,samples/README.md) | -| Asset_service.batch_get_effective_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_effective_iam_policies.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/asset_service.batch_get_effective_iam_policies.js,samples/README.md) | -| Asset_service.create_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_feed.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/asset_service.create_feed.js,samples/README.md) | -| Asset_service.create_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_saved_query.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/asset_service.create_saved_query.js,samples/README.md) | -| Asset_service.delete_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_feed.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/asset_service.delete_feed.js,samples/README.md) | -| Asset_service.delete_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_saved_query.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/asset_service.delete_saved_query.js,samples/README.md) | -| Asset_service.export_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.export_assets.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/asset_service.export_assets.js,samples/README.md) | -| Asset_service.get_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_feed.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/asset_service.get_feed.js,samples/README.md) | -| Asset_service.get_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_saved_query.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/asset_service.get_saved_query.js,samples/README.md) | -| Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_assets.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/asset_service.list_assets.js,samples/README.md) | -| Asset_service.list_feeds | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_feeds.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/asset_service.list_feeds.js,samples/README.md) | -| Asset_service.list_saved_queries | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_saved_queries.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/asset_service.list_saved_queries.js,samples/README.md) | -| Asset_service.query_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.query_assets.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/asset_service.query_assets.js,samples/README.md) | -| Asset_service.search_all_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_iam_policies.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/asset_service.search_all_iam_policies.js,samples/README.md) | -| Asset_service.search_all_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_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/asset_service.search_all_resources.js,samples/README.md) | -| Asset_service.update_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_feed.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/asset_service.update_feed.js,samples/README.md) | -| Asset_service.update_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_saved_query.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/asset_service.update_saved_query.js,samples/README.md) | -| Asset_service.search_all_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.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/v1p1beta1/asset_service.search_all_iam_policies.js,samples/README.md) | -| Asset_service.search_all_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_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/v1p1beta1/asset_service.search_all_resources.js,samples/README.md) | -| Asset_service.create_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.create_feed.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/v1p2beta1/asset_service.create_feed.js,samples/README.md) | -| Asset_service.delete_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.delete_feed.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/v1p2beta1/asset_service.delete_feed.js,samples/README.md) | -| Asset_service.get_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.get_feed.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/v1p2beta1/asset_service.get_feed.js,samples/README.md) | -| Asset_service.list_feeds | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.list_feeds.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/v1p2beta1/asset_service.list_feeds.js,samples/README.md) | -| Asset_service.update_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.update_feed.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/v1p2beta1/asset_service.update_feed.js,samples/README.md) | -| Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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/v1p4beta1/asset_service.analyze_iam_policy.js,samples/README.md) | -| Asset_service.export_iam_policy_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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/v1p4beta1/asset_service.export_iam_policy_analysis.js,samples/README.md) | -| Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p5beta1/asset_service.list_assets.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/v1p5beta1/asset_service.list_assets.js,samples/README.md) | -| Asset History 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) | -| Sample.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/sample.test.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/sample.test.js,samples/README.md) | +| Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.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-asset/samples/generated/v1/asset_service.analyze_iam_policy.js,samples/README.md) | +| Asset_service.analyze_iam_policy_longrunning | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.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-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js,samples/README.md) | +| Asset_service.analyze_move | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_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-asset/samples/generated/v1/asset_service.analyze_move.js,samples/README.md) | +| Asset_service.batch_get_assets_history | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.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-asset/samples/generated/v1/asset_service.batch_get_assets_history.js,samples/README.md) | +| Asset_service.batch_get_effective_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.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-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js,samples/README.md) | +| Asset_service.create_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.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-asset/samples/generated/v1/asset_service.create_feed.js,samples/README.md) | +| Asset_service.create_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.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-asset/samples/generated/v1/asset_service.create_saved_query.js,samples/README.md) | +| Asset_service.delete_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.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-asset/samples/generated/v1/asset_service.delete_feed.js,samples/README.md) | +| Asset_service.delete_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.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-asset/samples/generated/v1/asset_service.delete_saved_query.js,samples/README.md) | +| Asset_service.export_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.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-asset/samples/generated/v1/asset_service.export_assets.js,samples/README.md) | +| Asset_service.get_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.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-asset/samples/generated/v1/asset_service.get_feed.js,samples/README.md) | +| Asset_service.get_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.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-asset/samples/generated/v1/asset_service.get_saved_query.js,samples/README.md) | +| Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.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-asset/samples/generated/v1/asset_service.list_assets.js,samples/README.md) | +| Asset_service.list_feeds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.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-asset/samples/generated/v1/asset_service.list_feeds.js,samples/README.md) | +| Asset_service.list_saved_queries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.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-asset/samples/generated/v1/asset_service.list_saved_queries.js,samples/README.md) | +| Asset_service.query_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.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-asset/samples/generated/v1/asset_service.query_assets.js,samples/README.md) | +| Asset_service.search_all_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.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-asset/samples/generated/v1/asset_service.search_all_iam_policies.js,samples/README.md) | +| Asset_service.search_all_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_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-asset/samples/generated/v1/asset_service.search_all_resources.js,samples/README.md) | +| Asset_service.update_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.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-asset/samples/generated/v1/asset_service.update_feed.js,samples/README.md) | +| Asset_service.update_saved_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.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-asset/samples/generated/v1/asset_service.update_saved_query.js,samples/README.md) | +| Asset_service.search_all_iam_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.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-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js,samples/README.md) | +| Asset_service.search_all_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_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-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js,samples/README.md) | +| Asset_service.create_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.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-asset/samples/generated/v1p2beta1/asset_service.create_feed.js,samples/README.md) | +| Asset_service.delete_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.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-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js,samples/README.md) | +| Asset_service.get_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.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-asset/samples/generated/v1p2beta1/asset_service.get_feed.js,samples/README.md) | +| Asset_service.list_feeds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.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-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js,samples/README.md) | +| Asset_service.update_feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.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-asset/samples/generated/v1p2beta1/asset_service.update_feed.js,samples/README.md) | +| Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js,samples/README.md) | +| Asset_service.export_iam_policy_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js,samples/README.md) | +| Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.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-asset/samples/generated/v1p5beta1/asset_service.list_assets.js,samples/README.md) | +| Asset History Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/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-asset/samples/quickstart.js,samples/README.md) | +| Sample.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/test/sample.test.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-asset/samples/test/sample.test.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index c069cc22181..7798cf622fb 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -62,14 +62,14 @@ Before running the samples, make sure you've followed the steps outlined in ### Asset_service.analyze_iam_policy -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.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/asset_service.analyze_iam_policy.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-asset/samples/generated/v1/asset_service.analyze_iam_policy.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js` ----- @@ -79,14 +79,14 @@ __Usage:__ ### Asset_service.analyze_iam_policy_longrunning -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.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/asset_service.analyze_iam_policy_longrunning.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-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js` ----- @@ -96,14 +96,14 @@ __Usage:__ ### Asset_service.analyze_move -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_move.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_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/v1/asset_service.analyze_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-asset/samples/generated/v1/asset_service.analyze_move.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.analyze_move.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js` ----- @@ -113,14 +113,14 @@ __Usage:__ ### Asset_service.batch_get_assets_history -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_assets_history.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.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/asset_service.batch_get_assets_history.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-asset/samples/generated/v1/asset_service.batch_get_assets_history.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_assets_history.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js` ----- @@ -130,14 +130,14 @@ __Usage:__ ### Asset_service.batch_get_effective_iam_policies -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.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/asset_service.batch_get_effective_iam_policies.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-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js` ----- @@ -147,14 +147,14 @@ __Usage:__ ### Asset_service.create_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.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/asset_service.create_feed.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-asset/samples/generated/v1/asset_service.create_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.create_feed.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js` ----- @@ -164,14 +164,14 @@ __Usage:__ ### Asset_service.create_saved_query -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.create_saved_query.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.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/asset_service.create_saved_query.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-asset/samples/generated/v1/asset_service.create_saved_query.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.create_saved_query.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js` ----- @@ -181,14 +181,14 @@ __Usage:__ ### Asset_service.delete_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.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/asset_service.delete_feed.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-asset/samples/generated/v1/asset_service.delete_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.delete_feed.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js` ----- @@ -198,14 +198,14 @@ __Usage:__ ### Asset_service.delete_saved_query -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.delete_saved_query.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.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/asset_service.delete_saved_query.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-asset/samples/generated/v1/asset_service.delete_saved_query.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.delete_saved_query.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js` ----- @@ -215,14 +215,14 @@ __Usage:__ ### Asset_service.export_assets -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.export_assets.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.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/asset_service.export_assets.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-asset/samples/generated/v1/asset_service.export_assets.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.export_assets.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js` ----- @@ -232,14 +232,14 @@ __Usage:__ ### Asset_service.get_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.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/asset_service.get_feed.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-asset/samples/generated/v1/asset_service.get_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.get_feed.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js` ----- @@ -249,14 +249,14 @@ __Usage:__ ### Asset_service.get_saved_query -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.get_saved_query.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.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/asset_service.get_saved_query.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-asset/samples/generated/v1/asset_service.get_saved_query.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.get_saved_query.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js` ----- @@ -266,14 +266,14 @@ __Usage:__ ### Asset_service.list_assets -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_assets.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.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/asset_service.list_assets.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-asset/samples/generated/v1/asset_service.list_assets.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.list_assets.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js` ----- @@ -283,14 +283,14 @@ __Usage:__ ### Asset_service.list_feeds -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_feeds.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.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/asset_service.list_feeds.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-asset/samples/generated/v1/asset_service.list_feeds.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.list_feeds.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js` ----- @@ -300,14 +300,14 @@ __Usage:__ ### Asset_service.list_saved_queries -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.list_saved_queries.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.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/asset_service.list_saved_queries.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-asset/samples/generated/v1/asset_service.list_saved_queries.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.list_saved_queries.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js` ----- @@ -317,14 +317,14 @@ __Usage:__ ### Asset_service.query_assets -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.query_assets.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.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/asset_service.query_assets.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-asset/samples/generated/v1/asset_service.query_assets.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.query_assets.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js` ----- @@ -334,14 +334,14 @@ __Usage:__ ### Asset_service.search_all_iam_policies -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_iam_policies.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.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/asset_service.search_all_iam_policies.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-asset/samples/generated/v1/asset_service.search_all_iam_policies.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_iam_policies.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js` ----- @@ -351,14 +351,14 @@ __Usage:__ ### Asset_service.search_all_resources -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_resources.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_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/asset_service.search_all_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-asset/samples/generated/v1/asset_service.search_all_resources.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.search_all_resources.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js` ----- @@ -368,14 +368,14 @@ __Usage:__ ### Asset_service.update_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.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/asset_service.update_feed.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-asset/samples/generated/v1/asset_service.update_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.update_feed.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js` ----- @@ -385,14 +385,14 @@ __Usage:__ ### Asset_service.update_saved_query -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/asset_service.update_saved_query.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.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/asset_service.update_saved_query.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-asset/samples/generated/v1/asset_service.update_saved_query.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/asset_service.update_saved_query.js` +`node packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js` ----- @@ -402,14 +402,14 @@ __Usage:__ ### Asset_service.search_all_iam_policies -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.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/v1p1beta1/asset_service.search_all_iam_policies.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-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js` +`node packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js` ----- @@ -419,14 +419,14 @@ __Usage:__ ### Asset_service.search_all_resources -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_resources.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_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/v1p1beta1/asset_service.search_all_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-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p1beta1/asset_service.search_all_resources.js` +`node packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js` ----- @@ -436,14 +436,14 @@ __Usage:__ ### Asset_service.create_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.create_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.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/v1p2beta1/asset_service.create_feed.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-asset/samples/generated/v1p2beta1/asset_service.create_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.create_feed.js` +`node packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js` ----- @@ -453,14 +453,14 @@ __Usage:__ ### Asset_service.delete_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.delete_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.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/v1p2beta1/asset_service.delete_feed.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-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.delete_feed.js` +`node packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js` ----- @@ -470,14 +470,14 @@ __Usage:__ ### Asset_service.get_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.get_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.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/v1p2beta1/asset_service.get_feed.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-asset/samples/generated/v1p2beta1/asset_service.get_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.get_feed.js` +`node packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js` ----- @@ -487,14 +487,14 @@ __Usage:__ ### Asset_service.list_feeds -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.list_feeds.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.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/v1p2beta1/asset_service.list_feeds.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-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.list_feeds.js` +`node packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js` ----- @@ -504,14 +504,14 @@ __Usage:__ ### Asset_service.update_feed -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.update_feed.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.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/v1p2beta1/asset_service.update_feed.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-asset/samples/generated/v1p2beta1/asset_service.update_feed.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p2beta1/asset_service.update_feed.js` +`node packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js` ----- @@ -521,14 +521,14 @@ __Usage:__ ### Asset_service.analyze_iam_policy -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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/v1p4beta1/asset_service.analyze_iam_policy.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-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js` +`node packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js` ----- @@ -538,14 +538,14 @@ __Usage:__ ### Asset_service.export_iam_policy_analysis -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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/v1p4beta1/asset_service.export_iam_policy_analysis.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-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js` +`node packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js` ----- @@ -555,14 +555,14 @@ __Usage:__ ### Asset_service.list_assets -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1p5beta1/asset_service.list_assets.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.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/v1p5beta1/asset_service.list_assets.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-asset/samples/generated/v1p5beta1/asset_service.list_assets.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1p5beta1/asset_service.list_assets.js` +`node packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js` ----- @@ -574,9 +574,9 @@ __Usage:__ Batch get history of assets. -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-asset/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-asset/samples/quickstart.js,samples/README.md) __Usage:__ @@ -591,14 +591,14 @@ __Usage:__ ### Sample.test -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/sample.test.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/test/sample.test.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/sample.test.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-asset/samples/test/sample.test.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/test/sample.test.js` +`node packages/google-cloud-asset/samples/test/sample.test.js` diff --git a/release-please-config.json b/release-please-config.json index b5eae8a885a..41c050a9349 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -57,4 +57,4 @@ } ], "release-type": "node" -} +} \ No newline at end of file From 50e87f47d831ed3c243f763c337213747d1eea60 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 18:48:44 -0800 Subject: [PATCH 428/429] samples: update test --- .../google-cloud-asset/samples/quickstart.js | 62 +++-- .../samples/test/sample.test.js | 231 +----------------- 2 files changed, 39 insertions(+), 254 deletions(-) diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index ef8d3cb17d2..014bbe04578 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -1,4 +1,4 @@ -// Copyright 2018 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. @@ -15,41 +15,49 @@ 'use strict'; // sample-metadata: -// title: Asset History Quickstart -// description: Batch get history of assets. -// usage: node getBatchAssetHistory "//storage.googleapis.com/" +// title: List Assets +// description: List assets under the current project. +// usage: node listAssets +// example: node listAssets "storage.googleapis.com/Bucket,bigquery.googleapis.com/Table" 'RESOURCE' + +async function main(assetTypes, contentType, projectId) { + // [START asset_quickstart_list_assets] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const assetTypes = 'storage.googleapis.com/Bucket,bigquery.googleapis.com/Table'; + // const contentType = 'RESOURCE'; -async function main(assetNames) { - // [START asset_quickstart] const util = require('util'); - const {AssetServiceClient} = require('@google-cloud/asset'); + const {v1} = require('@google-cloud/asset'); + const client = new v1.AssetServiceClient(); - const client = new AssetServiceClient(); - - async function quickstart() { - const projectId = await client.getProjectId(); - const projectResource = `projects/${projectId}`; - // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. - // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; + const projectResource = `projects/${projectId}`; + // TODO(developer): Choose types of assets to list, such as 'storage.googleapis.com/Bucket': + // const assetTypes = 'storage.googleapis.com/Bucket,bigquery.googleapis.com/Table'; + // Or simply use empty string to list all types of assets: + // const assetTypes = ''; + const assetTypesList = assetTypes ? assetTypes.split(',') : []; + async function listAssets() { const request = { parent: projectResource, - assetNames: assetNames.split(','), - contentType: 'RESOURCE', - readTimeWindow: { - startTime: { - seconds: Math.floor(new Date().getTime() / 1000), - }, - }, + assetTypes: assetTypesList, + contentType: contentType, + // (Optional) Add readTime parameter to list assets at the given time instead of current time: + // readTime: { seconds: 1593988758 }, }; - // Handle the operation using the promise pattern. - const result = await client.batchGetAssetsHistory(request); - // Do things with with the response. + // Call cloud.assets.v1.ListAssets API. + const result = await client.listAssets(request); + // Handle the response. console.log(util.inspect(result, {depth: null})); - // [END asset_quickstart] } - await quickstart(); + listAssets(); + // [END asset_quickstart_list_assets] } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-asset/samples/test/sample.test.js b/packages/google-cloud-asset/samples/test/sample.test.js index bbbea928228..93ed65a7adb 100644 --- a/packages/google-cloud-asset/samples/test/sample.test.js +++ b/packages/google-cloud-asset/samples/test/sample.test.js @@ -15,248 +15,25 @@ 'use strict'; const {assert} = require('chai'); -const {after, before, describe, it} = require('mocha'); -const uuid = require('uuid'); +const {before, describe, it} = require('mocha'); const cp = require('child_process'); -const {Storage} = require('@google-cloud/storage'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -const storage = new Storage(); -const bucketName = `asset-nodejs-${uuid.v4()}`; -const bucket = storage.bucket(bucketName); -const fileSuffix = `${uuid.v4()}`; - -const {BigQuery} = require('@google-cloud/bigquery'); -const bigquery = new BigQuery(); -const options = { - location: 'US', -}; -const datasetId = `asset_nodejs_${uuid.v4()}`.replace(/-/gi, '_'); - const compute = require('@google-cloud/compute'); const instancesClient = new compute.InstancesClient(); -// Some of these tests can take an extremely long time, and occasionally -// timeout, see: -// "Timeout of 180000ms exceeded. For async tests and hooks". -function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - describe('quickstart sample tests', () => { let projectId; - let zone; - let instanceName; - let machineType; - let sourceImage; - let networkName; before(async () => { - zone = 'us-central1-a'; - instanceName = `asset-nodejs-${uuid.v4()}`; - machineType = 'n1-standard-1'; - sourceImage = - 'projects/ubuntu-os-cloud/global/images/family/ubuntu-1804-lts'; - networkName = 'global/networks/default'; projectId = await instancesClient.getProjectId(); - - await bucket.create(); - await bigquery.createDataset(datasetId, options); - await bigquery.dataset(datasetId).exists(); - - const [response] = await instancesClient.insert({ - instanceResource: { - name: instanceName, - disks: [ - { - // Describe the size and source image of the boot disk to attach to the instance. - initializeParams: { - diskSizeGb: '10', - sourceImage, - }, - autoDelete: true, - boot: true, - type: 'PERSISTENT', - }, - ], - machineType: `zones/${zone}/machineTypes/${machineType}`, - networkInterfaces: [ - { - // Use the network interface provided in the networkName argument. - name: networkName, - }, - ], - }, - project: projectId, - zone, - }); - let operation = response.latestResponse; - const operationsClient = new compute.ZoneOperationsClient(); - - // Wait for the create operation to complete. - while (operation.status !== 'DONE') { - [operation] = await operationsClient.wait({ - operation: operation.name, - project: projectId, - zone: operation.zone.split('/').pop(), - }); - } - }); - - after(async () => { - await bucket.delete(); - await bigquery.dataset(datasetId).delete({force: true}).catch(console.warn); - const [response] = await instancesClient.delete({ - instance: instanceName, - project: projectId, - zone, - }); - let operation = response.latestResponse; - const operationsClient = new compute.ZoneOperationsClient(); - - // Wait for the delete operation to complete. - while (operation.status !== 'DONE') { - [operation] = await operationsClient.wait({ - operation: operation.name, - project: projectId, - zone: operation.zone.split('/').pop(), - }); - } - }); - - it('should export assets to specified path', async () => { - const dumpFilePath = `gs://${bucketName}/my-assets-${fileSuffix}.txt`; - execSync(`node exportAssets ${dumpFilePath}`); - let waitMs = 4000; - let exists = false; - let file; - for (let retry = 0; retry < 3 && !exists; ++retry) { - await sleep((waitMs *= 2)); - file = await bucket.file(`my-assets-${fileSuffix}.txt`); - exists = await file.exists(); - } - assert.ok(exists); - await file.delete(); - }); - - it('should export asset relationships to specified path', async () => { - const dumpFilePath = `gs://${bucketName}/my-relationships-${fileSuffix}.txt`; - const contentType = 'RELATIONSHIP'; - execSync(`node exportAssets ${dumpFilePath} ${contentType}`); - let waitMs = 4000; - let exists = false; - let file; - for (let retry = 0; retry < 3 && !exists; ++retry) { - await sleep((waitMs *= 2)); - file = await bucket.file(`my-relationships-${fileSuffix}.txt`); - exists = await file.exists(); - } - assert.ok(exists); - await file.delete(); - }); - - // The assets returned within 'readTimeWindow' frequently do not include - // the newly created bucket: - it('should get assets history successfully', async () => { - const assetName = `//storage.googleapis.com/${bucketName}`; - let waitMs = 1000; - let included = false; - for (let retry = 0; retry < 3 && !included; ++retry) { - await sleep((waitMs *= 2)); - const stdout = execSync( - `node getBatchAssetHistory ${assetName} 'RESOURCE'` - ); - included = stdout.includes(assetName); - } - assert.ok(included); - }); - - it('should run the quickstart', async () => { - const assetName = `//storage.googleapis.com/${bucketName}`; - const stdout = execSync(`node quickstart ${assetName}`); - assert.include(stdout, assetName); - }); - - // https://github.com/googleapis/nodejs-asset/issues/650 - it.skip('should search all resources successfully', async () => { - const query = `name:${instanceName}`; - const stdout = execSync(`node searchAllResources '' ${query}`); - assert.include(stdout, instanceName); - }); - - it('should search all iam policies successfully', async () => { - const query = 'policy:roles/owner'; - const stdout = execSync(`node searchAllIamPolicies '' ${query}`); - assert.include(stdout, 'roles/owner'); }); it('should list assets successfully', async () => { const assetType = 'storage.googleapis.com/Bucket'; - const stdout = execSync(`node listAssets ${assetType} 'RESOURCE'`); - assert.include(stdout, assetType); - }); - - it('should list asset relationship successfully', async () => { - const stdout = execSync("node listAssets '' 'RELATIONSHIP'"); - assert.include(stdout, 'relatedAsset'); - }); - - it('should get effective iam policies successfully', async () => { - const assetName = `//storage.googleapis.com/${bucketName}`; - const stdout = execSync(`node getBatchEffectiveIamPolicies ${assetName}`); - assert.include(stdout, assetName); - }); - - it('should analyze iam policy successfully', async () => { - const stdout = execSync('node analyzeIamPolicy'); - assert.include(stdout, '//cloudresourcemanager.googleapis.com/projects'); - }); - - it('should analyze iam policy and write analysis results to gcs successfully', async () => { - const uri = `gs://${bucketName}/my-analysis.json`; - execSync(`node analyzeIamPolicyLongrunningGcs ${uri}`); - let waitMs = 1000; - let exists = false; - let file; - for (let retry = 0; retry < 3 && !exists; ++retry) { - await sleep((waitMs *= 2)); - file = await bucket.file('my-analysis.json'); - exists = await file.exists(); - } - assert.ok(exists); - await file.delete(); - }); - - it('should analyze iam policy and write analysis results to bigquery successfully', async () => { - const tablePrefix = 'analysis_nodejs'; - execSync( - `node analyzeIamPolicyLongrunningBigquery ${datasetId} ${tablePrefix}` + const stdout = execSync( + `node quickstart ${assetType} 'RESOURCE' ${projectId}` ); - let waitMs = 4000; - let metadataTable; - let metadataTable_exists = false; - let resultsTable; - let resultsTable_exists = false; - - for ( - let retry = 0; - retry < 3 && !(metadataTable_exists || resultsTable_exists); - ++retry - ) { - await sleep((waitMs *= 2)); - metadataTable = await bigquery - .dataset(datasetId) - .table('analysis_nodejs_analysis'); - metadataTable_exists = await metadataTable.exists(); - resultsTable = await bigquery - .dataset(datasetId) - .table('analysis_nodejs_analysis_result'); - resultsTable_exists = await resultsTable.exists(); - } - - assert.ok(metadataTable_exists); - assert.ok(resultsTable_exists); - await metadataTable.delete(); - await resultsTable.delete(); + assert.include(stdout, assetType); }); }); From 1d3dc98bf1875d7b75ed13152c80eec6f86da6fc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 12 Nov 2022 03:16:29 +0000 Subject: [PATCH 429/429] =?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 --- packages/google-cloud-asset/README.md | 44 +++++++++++-------- packages/google-cloud-asset/samples/README.md | 8 ++-- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 866de22fbfc..2e293fdf10c 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -57,32 +57,38 @@ npm install @google-cloud/asset ### Using the client library ```javascript -const util = require('util'); -const {AssetServiceClient} = require('@google-cloud/asset'); +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +// const assetTypes = 'storage.googleapis.com/Bucket,bigquery.googleapis.com/Table'; +// const contentType = 'RESOURCE'; -const client = new AssetServiceClient(); +const util = require('util'); +const {v1} = require('@google-cloud/asset'); +const client = new v1.AssetServiceClient(); -async function quickstart() { - const projectId = await client.getProjectId(); - const projectResource = `projects/${projectId}`; - // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. - // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; +const projectResource = `projects/${projectId}`; +// TODO(developer): Choose types of assets to list, such as 'storage.googleapis.com/Bucket': +// const assetTypes = 'storage.googleapis.com/Bucket,bigquery.googleapis.com/Table'; +// Or simply use empty string to list all types of assets: +// const assetTypes = ''; +const assetTypesList = assetTypes ? assetTypes.split(',') : []; +async function listAssets() { const request = { parent: projectResource, - assetNames: assetNames.split(','), - contentType: 'RESOURCE', - readTimeWindow: { - startTime: { - seconds: Math.floor(new Date().getTime() / 1000), - }, - }, + assetTypes: assetTypesList, + contentType: contentType, + // (Optional) Add readTime parameter to list assets at the given time instead of current time: + // readTime: { seconds: 1593988758 }, }; - // Handle the operation using the promise pattern. - const result = await client.batchGetAssetsHistory(request); - // Do things with with the response. + // Call cloud.assets.v1.ListAssets API. + const result = await client.listAssets(request); + // Handle the response. console.log(util.inspect(result, {depth: null})); +} +listAssets(); ``` @@ -124,7 +130,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Asset_service.analyze_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.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-asset/samples/generated/v1p4beta1/asset_service.analyze_iam_policy.js,samples/README.md) | | Asset_service.export_iam_policy_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.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-asset/samples/generated/v1p4beta1/asset_service.export_iam_policy_analysis.js,samples/README.md) | | Asset_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.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-asset/samples/generated/v1p5beta1/asset_service.list_assets.js,samples/README.md) | -| Asset History Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/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-asset/samples/quickstart.js,samples/README.md) | +| List Assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/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-asset/samples/quickstart.js,samples/README.md) | | Sample.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/test/sample.test.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-asset/samples/test/sample.test.js,samples/README.md) | diff --git a/packages/google-cloud-asset/samples/README.md b/packages/google-cloud-asset/samples/README.md index 7798cf622fb..96980dfd880 100644 --- a/packages/google-cloud-asset/samples/README.md +++ b/packages/google-cloud-asset/samples/README.md @@ -42,7 +42,7 @@ * [Asset_service.analyze_iam_policy](#asset_service.analyze_iam_policy) * [Asset_service.export_iam_policy_analysis](#asset_service.export_iam_policy_analysis) * [Asset_service.list_assets](#asset_service.list_assets) - * [Asset History Quickstart](#asset-history-quickstart) + * [List Assets](#list-assets) * [Sample.test](#sample.test) ## Before you begin @@ -570,9 +570,9 @@ __Usage:__ -### Asset History Quickstart +### List Assets -Batch get history of assets. +List assets under the current project. View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-asset/samples/quickstart.js). @@ -581,7 +581,7 @@ View the [source code](https://github.com/googleapis/google-cloud-node/blob/main __Usage:__ -`node getBatchAssetHistory "storage.googleapis.com/"` +`node listAssets ` -----